aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2018-11-20 22:15:13 +0100
committerAvatar Heiko Becker <heirecka@exherbo.org> 2018-12-22 17:15:07 +0100
commitb00405ec77191c022a91829a1ed69af42ca33981 (patch)
tree50ea49be9d72a7c92bf68ab452adda764aa792e8 /cmake
parent1606b0eecc9eb8e0c60fe34ff8d3671563a9ad35 (diff)
downloadpaludis-b00405ec77191c022a91829a1ed69af42ca33981.tar.gz
paludis-b00405ec77191c022a91829a1ed69af42ca33981.tar.xz
build: Generate an import target for Jansson and use it
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindJansson.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/modules/FindJansson.cmake b/cmake/modules/FindJansson.cmake
index feed563be..b48a041a4 100644
--- a/cmake/modules/FindJansson.cmake
+++ b/cmake/modules/FindJansson.cmake
@@ -52,5 +52,13 @@ else()
VERSION_VAR
Jansson_VERSION_STRING)
mark_as_advanced(Jansson_INCLUDE_DIR Jansson_LIBRARIES)
+
+ if(Jansson_FOUND AND NOT TARGET Jansson::Jansson)
+ add_library(Jansson::Jansson UNKNOWN IMPORTED)
+ set_target_properties(Jansson::Jansson PROPERTIES
+ IMPORTED_LOCATION "${Jansson_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Jansson_INCLUDE_DIR}"
+ )
+ endif()
endif()