File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ endmacro()
5151
5252message (STATUS "C++ Requests CMake Options" )
5353message (STATUS "=======================================================" )
54+ cpr_option (CPR_ENABLE_INSTALL "Set to ON to enable all cpr install targets." ON )
5455cpr_option (CPR_GENERATE_COVERAGE "Set to ON to generate coverage reports." OFF )
5556cpr_option (CPR_CURL_NOSIGNAL "Set to ON to disable use of signals in libcurl." OFF )
5657cpr_option (CURL_VERBOSE_LOGGING "Curl verbose logging during building curl" OFF )
Original file line number Diff line number Diff line change @@ -50,11 +50,13 @@ set_target_properties(cpr
5050# Import GNU common install directory variables
5151include (GNUInstallDirs )
5252
53- install (TARGETS cpr
54- EXPORT cprTargets
55- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
56- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
57- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
53+ if (CPR_ENABLE_INSTALL)
54+ install (TARGETS cpr
55+ EXPORT cprTargets
56+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
57+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
58+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
59+ endif ()
5860
5961if (CPR_USE_SYSTEM_CURL)
6062 # Include CMake helpers for package config files
@@ -76,11 +78,15 @@ if(CPR_USE_SYSTEM_CURL)
7678 INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/cpr )
7779 endif ()
7880
79- install (FILES ${PROJECT_BINARY_DIR } /cpr/cprConfig.cmake
80- ${PROJECT_BINARY_DIR } /cpr/cprConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/cpr)
81+ if (CPR_ENABLE_INSTALL)
82+ install (FILES ${PROJECT_BINARY_DIR } /cpr/cprConfig.cmake
83+ ${PROJECT_BINARY_DIR } /cpr/cprConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/cpr)
84+ endif ()
8185endif ()
8286
83- install (EXPORT cprTargets
84- FILE cprTargets.cmake
85- NAMESPACE cpr::
86- DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/cpr)
87+ if (CPR_ENABLE_INSTALL)
88+ install (EXPORT cprTargets
89+ FILE cprTargets.cmake
90+ NAMESPACE cpr::
91+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/cpr)
92+ endif ()
Original file line number Diff line number Diff line change @@ -100,5 +100,8 @@ else()
100100 endif ()
101101endif ()
102102
103- install (DIRECTORY cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
104- install (DIRECTORY ${PROJECT_BINARY_DIR } /cpr_generated_includes/cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
103+
104+ if (CPR_ENABLE_INSTALL)
105+ install (DIRECTORY cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
106+ install (DIRECTORY ${PROJECT_BINARY_DIR } /cpr_generated_includes/cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
107+ endif ()
You can’t perform that action at this time.
0 commit comments