aboutsummaryrefslogtreecommitdiff
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
parent1606b0eecc9eb8e0c60fe34ff8d3671563a9ad35 (diff)
downloadpaludis-b00405ec77191c022a91829a1ed69af42ca33981.tar.gz
paludis-b00405ec77191c022a91829a1ed69af42ca33981.tar.xz
build: Generate an import target for Jansson and use itHEADmaster
-rw-r--r--cmake/modules/FindJansson.cmake8
-rw-r--r--paludis/repositories/gemcutter/CMakeLists.txt5
2 files changed, 9 insertions, 4 deletions
diff --git a/cmake/modules/FindJansson.cmake b/cmake/modules/FindJansson.cmake
index feed563..b48a041 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()
diff --git a/paludis/repositories/gemcutter/CMakeLists.txt b/paludis/repositories/gemcutter/CMakeLists.txt
index dff65d1..a3ed4a4 100644
--- a/paludis/repositories/gemcutter/CMakeLists.txt
+++ b/paludis/repositories/gemcutter/CMakeLists.txt
@@ -13,12 +13,9 @@ add_dependencies(libpaludisgemcutterrepository libpaludisutil_SE)
paludis_add_library(libpaludisgemcutterrepositoryjsonthings
json_things.cc)
-target_include_directories(libpaludisgemcutterrepositoryjsonthings
- PRIVATE
- ${Jansson_INCLUDE_DIRS})
target_link_libraries(libpaludisgemcutterrepositoryjsonthings
PRIVATE
- ${Jansson_LIBRARIES})
+ Jansson::Jansson)
install(TARGETS
libpaludisgemcutterrepositoryjsonthings