1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-03 02:41:59 -05:00

CMake: add CURL_ENABLE_EXPORT_TARGET option

install(EXPORT ...) causes trouble when embedding curl dependencies
which don't provide install(EXPORT ...) targets (e.g libressl and
nghttp2) with cmake's add_subdirectory.

Reviewed-by: Jakub Zakrzewski
Closes #7060
This commit is contained in:
Paweł Wegner 2021-05-14 12:36:12 +02:00 committed by Daniel Stenberg
parent 424aa64d54
commit 643ec29645
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -191,6 +191,9 @@ mark_as_advanced(CURL_DISABLE_GOPHER)
option(CURL_DISABLE_MQTT "to disable MQTT" OFF)
mark_as_advanced(CURL_DISABLE_MQTT)
option(CURL_ENABLE_EXPORT_TARGET "to enable cmake export target" ON)
mark_as_advanced(CURL_ENABLE_EXPORT_TARGET)
if(HTTP_ONLY)
set(CURL_DISABLE_DICT ON)
set(CURL_DISABLE_FILE ON)
@ -1561,11 +1564,13 @@ configure_package_config_file(CMake/curl-config.cmake.in
INSTALL_DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)
install(
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${PROJECT_NAME}::"
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)
if(CURL_ENABLE_EXPORT_TARGET)
install(
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${PROJECT_NAME}::"
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)
endif()
install(
FILES ${version_config} ${project_config}