From 4018a76d953b60b227ed496caa7375af465dfc6c Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Fri, 12 Jan 2024 13:44:33 +0100 Subject: [PATCH] Fixed the missing install export in case we do not use system curl --- cpr/CMakeLists.txt | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt index 52787f56a..3428e0b35 100644 --- a/cpr/CMakeLists.txt +++ b/cpr/CMakeLists.txt @@ -49,13 +49,13 @@ set_target_properties(cpr # Import GNU common install directory variables include(GNUInstallDirs) -if(CPR_USE_SYSTEM_CURL) - install(TARGETS cpr - EXPORT cprTargets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS cpr + EXPORT cprTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(CPR_USE_SYSTEM_CURL) # Include CMake helpers for package config files # Follow this installation guideline: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html include(CMakePackageConfigHelpers) @@ -69,17 +69,11 @@ if(CPR_USE_SYSTEM_CURL) "${PROJECT_BINARY_DIR}/cpr/cprConfig.cmake" INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr) - install(EXPORT cprTargets - FILE cprTargets.cmake - NAMESPACE cpr:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr) - install(FILES ${PROJECT_BINARY_DIR}/cpr/cprConfig.cmake ${PROJECT_BINARY_DIR}/cpr/cprConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr) - -else() - install(TARGETS cpr - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() + +install(EXPORT cprTargets + FILE cprTargets.cmake + NAMESPACE cpr:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cpr)