diff extern/json/CMakeLists.txt @ 710:a17de53db29b

Misc: export libraries Export all libraries with CMake and install headers. While here, build Duktape as object library to avoid exporting it. Don't mix static/dynamic libraries anymore. closes #867 closes #439
author David Demelier <markand@malikania.fr>
date Sat, 07 Jul 2018 14:03:04 +0200
parents f16a876e4a6a
children 2dfba38e93f0
line wrap: on
line diff
--- a/extern/json/CMakeLists.txt	Sat Jul 07 10:59:19 2018 +0200
+++ b/extern/json/CMakeLists.txt	Sat Jul 07 14:03:04 2018 +0200
@@ -17,7 +17,12 @@
 #
 
 project(json)
-
-add_library(libextern-json INTERFACE)
-target_sources(libextern-json INTERFACE ${json_SOURCE_DIR}/json.hpp)
-target_include_directories(libextern-json INTERFACE ${json_SOURCE_DIR})
+add_library(libjson INTERFACE)
+target_include_directories(
+    libjson
+    INTERFACE
+        $<BUILD_INTERFACE:${json_SOURCE_DIR}>
+        $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR/irccd/extern}>
+)
+install(TARGETS libjson EXPORT irccd-targets)
+install(FILES json.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/irccd/extern)