blob: 8da44597504877874618d37f65617730bf9c6f27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt
index 563b785..20f8a54 100644
--- a/cpr/CMakeLists.txt
+++ b/cpr/CMakeLists.txt
@@ -20,6 +20,7 @@ add_library(cpr
add_library(cpr::cpr ALIAS cpr)
+target_include_directories(cpr PUBLIC $<INSTALL_INTERFACE:include>)
target_link_libraries(cpr PUBLIC CURL::libcurl) # todo should be private, but first dependencys in ssl_options need to be removed
# Set version for shared libraries.
@@ -28,4 +29,18 @@ set_target_properties(cpr
VERSION ${${PROJECT_NAME}_VERSION}
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
-install(TARGETS cpr)
+set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
+install(TARGETS cpr
+ EXPORT ${TARGETS_EXPORT_NAME}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(
+ EXPORT ${TARGETS_EXPORT_NAME}
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+)
+
+if (NOT DISABLE_INSTALL_HEADERS)
+ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../include/cpr DESTINATION include)
+endif()
\ No newline at end of file
|