summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-05-19 15:41:23 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-05-19 15:41:23 +0200
commit89805c265bbba9bdf2360aa6205880c444d5c119 (patch)
treed3de4bb4c9a695d6a67814f9dd0a63dcd324bef7
parentaf461602b1cdbf3d16336e487a0774672a1ec724 (diff)
backport to cmake 3.3
Change-Id: I3c5c0670da70e2ed6adf425bf645bc2266e96308 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 22765fb..9f6a944 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -143,8 +143,14 @@ install(TARGETS afm-system-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
pkg_check_modules(afb afb-daemon)
if(afb_FOUND)
- MESSAGE(STATUS "Creation afm-main-plugin for AFB-DAEMON")
- pkg_get_variable(afb_plugin_install_dir afb-daemon plugin_install_dir)
+ message(STATUS "Creation afm-main-plugin for AFB-DAEMON")
+ ###############################################################
+ #pkg_get_variable(afb_plugin_install_dir afb-daemon plugin_install_dir)
+ execute_process(
+ COMMAND pkg-config --variable plugin_install_dir afb-daemon
+ OUTPUT_VARIABLE afb_plugin_install_dir OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ ###############################################################
add_library(afm-main-plugin MODULE afm-main-plugin.c)
target_compile_options(afm-main-plugin PRIVATE ${afb_CFLAGS})
target_include_directories(afm-main-plugin PRIVATE ${afb_INCLUDE_DIRS})
@@ -153,8 +159,8 @@ if(afb_FOUND)
PREFIX ""
LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/afm-main-plugin.export-map"
)
- INSTALL(TARGETS afm-main-plugin LIBRARY DESTINATION ${afb_plugin_install_dir})
+ install(TARGETS afm-main-plugin LIBRARY DESTINATION ${afb_plugin_install_dir})
else()
- MESSAGE(STATUS "Not creating the plugin for AFB-DAEMON")
+ message(STATUS "Not creating the plugin for AFB-DAEMON")
endif()