parent
6a9fe250a7
commit
59b3e78451
5
Help/release/dev/FindCURL-per-config.rst
Normal file
5
Help/release/dev/FindCURL-per-config.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FindCURL-per-config
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
* The :module:`FindCURL` module learned to find debug and release variants
|
||||||
|
separately.
|
@ -34,8 +34,9 @@
|
|||||||
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
|
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
|
||||||
mark_as_advanced(CURL_INCLUDE_DIR)
|
mark_as_advanced(CURL_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if(NOT CURL_LIBRARY)
|
||||||
# Look for the library (sorted from most current/relevant entry to least).
|
# Look for the library (sorted from most current/relevant entry to least).
|
||||||
find_library(CURL_LIBRARY NAMES
|
find_library(CURL_LIBRARY_RELEASE NAMES
|
||||||
curl
|
curl
|
||||||
# Windows MSVC prebuilts:
|
# Windows MSVC prebuilts:
|
||||||
curllib
|
curllib
|
||||||
@ -44,7 +45,18 @@ find_library(CURL_LIBRARY NAMES
|
|||||||
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
|
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
|
||||||
libcurl
|
libcurl
|
||||||
)
|
)
|
||||||
mark_as_advanced(CURL_LIBRARY)
|
mark_as_advanced(CURL_LIBRARY_RELEASE)
|
||||||
|
|
||||||
|
find_library(CURL_LIBRARY_DEBUG NAMES
|
||||||
|
# Windows MSVC CMake builds in debug configuration on vcpkg:
|
||||||
|
libcurl-d_imp
|
||||||
|
libcurl-d
|
||||||
|
)
|
||||||
|
mark_as_advanced(CURL_LIBRARY_DEBUG)
|
||||||
|
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
|
||||||
|
select_library_configurations(CURL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CURL_INCLUDE_DIR)
|
if(CURL_INCLUDE_DIR)
|
||||||
foreach(_curl_version_header curlver.h curl.h)
|
foreach(_curl_version_header curlver.h curl.h)
|
||||||
@ -71,7 +83,25 @@ if(CURL_FOUND)
|
|||||||
add_library(CURL::libcurl UNKNOWN IMPORTED)
|
add_library(CURL::libcurl UNKNOWN IMPORTED)
|
||||||
set_target_properties(CURL::libcurl PROPERTIES
|
set_target_properties(CURL::libcurl PROPERTIES
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
|
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
|
||||||
set_property(TARGET CURL::libcurl PROPERTY
|
|
||||||
|
if(EXISTS "${CURL_LIBRARY}")
|
||||||
|
set_target_properties(CURL::libcurl PROPERTIES
|
||||||
|
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||||
IMPORTED_LOCATION "${CURL_LIBRARY}")
|
IMPORTED_LOCATION "${CURL_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
|
if(CURL_LIBRARY_RELEASE)
|
||||||
|
set_property(TARGET CURL::libcurl APPEND PROPERTY
|
||||||
|
IMPORTED_CONFIGURATIONS RELEASE)
|
||||||
|
set_target_properties(CURL::libcurl PROPERTIES
|
||||||
|
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||||
|
IMPORTED_LOCATION_RELEASE "${CURL_LIBRARY_RELEASE}")
|
||||||
|
endif()
|
||||||
|
if(CURL_LIBRARY_DEBUG)
|
||||||
|
set_property(TARGET CURL::libcurl APPEND PROPERTY
|
||||||
|
IMPORTED_CONFIGURATIONS DEBUG)
|
||||||
|
set_target_properties(CURL::libcurl PROPERTIES
|
||||||
|
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||||
|
IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user