From 13183f1e282e2a9da02361acd45a1d8b507c2f66 Mon Sep 17 00:00:00 2001 From: m5k8 <42036168+m5k8@users.noreply.github.com> Date: Wed, 24 Aug 2022 16:58:05 +0200 Subject: [PATCH] Added CURLPP_SKIP_INSTALL option to skip install part --- CMakeLists.txt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f988290..2009aee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,14 +125,16 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NA SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES PREFIX "lib") target_link_libraries(${PROJECT_NAME}_static ${CURL_LIBRARIES} ${CONAN_LIBS}) -# install headers -install(DIRECTORY include/utilspp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/utilspp") -install(DIRECTORY include/curlpp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/curlpp") - -if(CURLPP_BUILD_SHARED_LIBS) -install(TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(NOT CURLPP_SKIP_INSTALL) + # install headers + install(DIRECTORY include/utilspp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/utilspp") + install(DIRECTORY include/curlpp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/curlpp") + + if(CURLPP_BUILD_SHARED_LIBS) + install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + install(TARGETS ${PROJECT_NAME}_static + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() -install(TARGETS ${PROJECT_NAME}_static - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})