1
- cmake_minimum_required (VERSION 3.11...3.15 )
2
-
3
- include (GNUInstallDirs )
4
-
5
- #if using an older VERSION of curl ocsp stapling can be disabled
6
- set (CURL_MIN_VERSION "7.28.0" )
7
-
8
- # Setting up project
9
- project (curlcpp LANGUAGES CXX )
10
-
11
- set (DEFAULT_BUILD_TYPE "Release" )
12
- if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
13
- message (STATUS "Setting build type to '${DEFAULT_BUILD_TYPE} ' as none was specified." )
14
- set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE} " CACHE
15
- STRING "Choose the type of build." FORCE )
16
- # Set the possible values of build type for cmake-gui
17
- set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
18
- "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
19
- endif ()
20
-
21
- include (CheckIPOSupported )
22
- check_ipo_supported (RESULT IPO_SUPPORTED OUTPUT ERROR )
23
-
24
- if (IPO_SUPPORTED )
25
- message (STATUS "IPO / LTO supported, will enable for targets in release build type" )
26
- else ()
27
- message (STATUS "IPO / LTO not supported: <${ERROR} >, will not enable" )
28
- endif ()
29
-
30
- option (CURLCPP_USE_PKGCONFIG
31
- "Use pkg-config to find libcurl. When off, find_package() will be used" OFF )
32
-
33
- # Set up source directories
34
- add_subdirectory (src )
35
-
36
- # Set up test directory.
37
- add_subdirectory (test )
38
-
39
- # Set library location
40
- set (CURLCPP_LIB_LOCATION "$<TARGET_FILE:${curlcpp} >" )
41
-
42
- configure_file (CMake/curlcppConfig.cmake.in
43
- ${CMAKE_BINARY_DIR} /curlcppConfig.cmake @ONLY )
44
- install (FILES ${CMAKE_BINARY_DIR} /curlcppConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR} /curlcpp )
1
+ cmake_minimum_required (VERSION 3.11...3.15 )
2
+
3
+ # Setting up project
4
+ project (curlcpp LANGUAGES CXX )
5
+
6
+ include (GNUInstallDirs )
7
+
8
+ set (BUILD_TEST "Build Tests" OFF )
9
+
10
+ #if using an older VERSION of curl ocsp stapling can be disabled
11
+ set (CURL_MIN_VERSION "7.28.0" )
12
+
13
+ set (DEFAULT_BUILD_TYPE "Release" )
14
+ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
15
+ message (STATUS "Setting build type to '${DEFAULT_BUILD_TYPE} ' as none was specified." )
16
+ set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE} " CACHE
17
+ STRING "Choose the type of build." FORCE )
18
+ # Set the possible values of build type for cmake-gui
19
+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20
+ "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
21
+ endif ()
22
+
23
+ include (CheckIPOSupported )
24
+ check_ipo_supported (RESULT IPO_SUPPORTED OUTPUT ERROR )
25
+
26
+ if (IPO_SUPPORTED )
27
+ message (STATUS "IPO / LTO supported, will enable for targets in release build type" )
28
+ else ()
29
+ message (STATUS "IPO / LTO not supported: <${ERROR} >, will not enable" )
30
+ endif ()
31
+
32
+ option (CURLCPP_USE_PKGCONFIG
33
+ "Use pkg-config to find libcurl. When off, find_package() will be used" OFF )
34
+
35
+ # Set up source directories
36
+ add_subdirectory (src )
37
+
38
+ # Set up test directory.
39
+ if (BUILD_TEST )
40
+ add_subdirectory (test )
41
+ endif ()
42
+
43
+ # Install
44
+ install (EXPORT curlcppTargets
45
+ NAMESPACE curlcpp::
46
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/curlcpp )
47
+ include (CMakePackageConfigHelpers )
48
+ configure_package_config_file (CMake/curlcppConfig.cmake.in
49
+ "${PROJECT_BINARY_DIR} /curlcppConfig.cmake"
50
+ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/curlcpp" )
51
+ install (FILES ${PROJECT_BINARY_DIR} /curlcppConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/curlcpp )
0 commit comments