summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-01-04 12:10:44 +0100
committertastytea2020-01-04 12:10:44 +0100
commitc9009e1de03d28a96447571a12dde72e1cda6d95 (patch)
treeef3a0cbd6048443ed7d2b6424e3446efc567f0b5
parent892f1c6f874120fe7573828f3cd377f58574c46d (diff)
downloadmastodonpp-c9009e1de03d28a96447571a12dde72e1cda6d95.tar
mastodonpp-c9009e1de03d28a96447571a12dde72e1cda6d95.tar.gz
mastodonpp-c9009e1de03d28a96447571a12dde72e1cda6d95.zip
Add FindCURL-workaround CMake < 3.12.
-rw-r--r--src/CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8bc8557..e6d20ee 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,8 +24,16 @@ target_include_directories(${PROJECT_NAME}
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
-target_link_libraries(${PROJECT_NAME}
- PUBLIC CURL::libcurl)
+# FindCURL provides an IMPORTED target since CMake 3.12.
+if(NOT ${CMAKE_VERSION} VERSION_LESS 3.12)
+ target_link_libraries(${PROJECT_NAME}
+ PUBLIC CURL::libcurl)
+else()
+ target_include_directories(${PROJECT_NAME}
+ PUBLIC ${CURL_INCLUDE_DIRS})
+ target_link_libraries(${PROJECT_NAME}
+ PUBLIC ${CURL_LIBRARIES})
+endif()
install(TARGETS ${PROJECT_NAME}