mirror of
https://github.com/curl/curl.git
synced 2026-07-03 19:57:16 +03:00
cmake: honor CURL_DISABLE_INSTALL and CURL_ENABLE_EXPORT_TARGET in lib and src
Based on existing code and commit history it appears `CURL_DISABLE_INSTALL` means to prevent calling `install()`; `CURL_ENABLE_EXPORT_TARGET` means to prevent calling `export()` and `install()`s with `EXPORT` in them. Fix them to also apply to the lib and src directories in that vain: - lib: honor `CURL_DISABLE_INSTALL` - src: honor `CURL_DISABLE_INSTALL` - src: honor `CURL_ENABLE_EXPORT_TARGET` https://cmake.org/cmake/help/v4.2/command/install.html https://cmake.org/cmake/help/v4.2/command/export.html - `CURL_DISABLE_INSTALL` follow-up to:aace27b096#12287 - `CURL_ENABLE_EXPORT_TARGET` follow-up to:8698825106#9638643ec29645#7060 Closes #19144
This commit is contained in:
parent
3d80d37cf0
commit
7e8f36bf8e
3 changed files with 13 additions and 7 deletions
|
|
@ -28,6 +28,7 @@ include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
|||
curl_add_manual_pages(man_MANS)
|
||||
add_custom_target(curl-opts-man DEPENDS ${man_MANS})
|
||||
add_dependencies(curl-man curl-opts-man)
|
||||
|
||||
if(NOT CURL_DISABLE_INSTALL)
|
||||
set(_src "")
|
||||
foreach(_file IN LISTS man_MANS)
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ add_library(${LIB_NAME} ALIAS ${LIB_SELECTED})
|
|||
add_library(${PROJECT_NAME}::${LIB_NAME} ALIAS ${LIB_SELECTED})
|
||||
|
||||
if(CURL_ENABLE_EXPORT_TARGET)
|
||||
if(BUILD_STATIC_LIBS)
|
||||
if(NOT CURL_DISABLE_INSTALL AND BUILD_STATIC_LIBS)
|
||||
install(TARGETS ${LIB_STATIC}
|
||||
EXPORT ${TARGETS_EXPORT_NAME}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
|
@ -312,7 +312,7 @@ if(CURL_ENABLE_EXPORT_TARGET)
|
|||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(NOT CURL_DISABLE_INSTALL AND BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${LIB_SHARED}
|
||||
EXPORT ${TARGETS_EXPORT_NAME}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
|
|
|||
|
|
@ -141,8 +141,13 @@ endif()
|
|||
|
||||
################################################################################
|
||||
|
||||
install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
export(TARGETS ${EXE_NAME}
|
||||
FILE "${PROJECT_BINARY_DIR}/curl-target.cmake"
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
)
|
||||
if(CURL_ENABLE_EXPORT_TARGET)
|
||||
if(NOT CURL_DISABLE_INSTALL)
|
||||
install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
export(TARGETS ${EXE_NAME}
|
||||
FILE "${PROJECT_BINARY_DIR}/curl-target.cmake"
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue