Skip to content

Commit a0ff651

Browse files
authored
fix: Cmake config file (#1234)
* fix: Cmake config file * Update cprConfig.cmake.in * fix: Config files
1 parent 6913a8b commit a0ff651

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cmake/cprConfig-ssl.cmake.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include(CMakeFindDependencyMacro)
2+
@PACKAGE_INIT@
3+
4+
find_dependency(CURL REQUIRED)
5+
find_dependency(OpenSSL REQUIRED)
6+
7+
include(${CMAKE_CURRENT_LIST_DIR}/cprTargets.cmake)
8+
9+
check_required_components(cpr)

cpr/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ if(CPR_USE_SYSTEM_CURL)
6565
VERSION ${${PROJECT_NAME}_VERSION}
6666
COMPATIBILITY ExactVersion)
6767

68-
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/cprConfig.cmake.in
68+
if(SSL_BACKEND_USED STREQUAL "OpenSSL")
69+
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/cprConfig-ssl.cmake.in
6970
"${PROJECT_BINARY_DIR}/cpr/cprConfig.cmake"
7071
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr)
72+
else()
73+
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/cprConfig.cmake.in
74+
"${PROJECT_BINARY_DIR}/cpr/cprConfig.cmake"
75+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr)
76+
endif()
7177

7278
install(FILES ${PROJECT_BINARY_DIR}/cpr/cprConfig.cmake
7379
${PROJECT_BINARY_DIR}/cpr/cprConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr)

0 commit comments

Comments
 (0)