mirror of
https://github.com/curl/curl.git
synced 2024-12-03 06:20:31 +08:00
cmake: link curl to the OpenSSL targets instead of lib absolute paths
Reviewed-by: Jakub Zakrzewski Reviewed-by: Sergei Nikulov Closes #2753
This commit is contained in:
parent
537763f7f5
commit
7867aaa9a0
@ -9,6 +9,11 @@ if(NOT CURL_FIND_COMPONENTS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(CMakeFindDependencyMacro)
|
||||||
|
if(CURL_FIND_REQUIRED_libcurl)
|
||||||
|
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(_curl_missing_components)
|
set(_curl_missing_components)
|
||||||
foreach(_comp ${CURL_FIND_COMPONENTS})
|
foreach(_comp ${CURL_FIND_COMPONENTS})
|
||||||
if(EXISTS "${_DIR}/${_comp}-target.cmake")
|
if(EXISTS "${_DIR}/${_comp}-target.cmake")
|
@ -352,8 +352,8 @@ if(CMAKE_USE_OPENSSL)
|
|||||||
set(USE_OPENSSL ON)
|
set(USE_OPENSSL ON)
|
||||||
set(HAVE_LIBCRYPTO ON)
|
set(HAVE_LIBCRYPTO ON)
|
||||||
set(HAVE_LIBSSL ON)
|
set(HAVE_LIBSSL ON)
|
||||||
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
|
list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto)
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||||
check_include_file("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
check_include_file("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||||
check_include_file("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
check_include_file("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||||
@ -1308,9 +1308,9 @@ write_basic_package_version_file(
|
|||||||
COMPATIBILITY SameMajorVersion
|
COMPATIBILITY SameMajorVersion
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(CMake/curl-config.cmake
|
configure_file(CMake/curl-config.cmake.in
|
||||||
"${PROJECT_BINARY_DIR}/curl-config.cmake"
|
"${PROJECT_BINARY_DIR}/curl-config.cmake"
|
||||||
COPYONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
|
@ -31,7 +31,7 @@ CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \
|
|||||||
CMake/CurlSymbolHiding.cmake CMake/FindCARES.cmake \
|
CMake/CurlSymbolHiding.cmake CMake/FindCARES.cmake \
|
||||||
CMake/FindLibSSH2.cmake CMake/FindNGHTTP2.cmake \
|
CMake/FindLibSSH2.cmake CMake/FindNGHTTP2.cmake \
|
||||||
CMake/FindMbedTLS.cmake CMake/cmake_uninstall.cmake.in \
|
CMake/FindMbedTLS.cmake CMake/cmake_uninstall.cmake.in \
|
||||||
CMake/curl-config.cmake
|
CMake/curl-config.cmake.in
|
||||||
|
|
||||||
VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl
|
VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl
|
||||||
VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist
|
VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist
|
||||||
|
Loading…
Reference in New Issue
Block a user