vcpkg/ports/cpr/001-cpr-config.patch

33 lines
1.0 KiB
Diff
Raw Normal View History

2020-10-14 06:02:41 +08:00
diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt
index 8061a14..e8daf19 100644
2020-10-14 06:02:41 +08:00
--- a/cpr/CMakeLists.txt
+++ b/cpr/CMakeLists.txt
@@ -21,6 +21,7 @@ add_library(cpr
2020-10-14 06:02:41 +08:00
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.
@@ -29,4 +30,18 @@ set_target_properties(cpr
2020-10-14 06:02:41 +08:00
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()