summaryrefslogtreecommitdiff
path: root/tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt')
-rw-r--r--tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt31
1 files changed, 21 insertions, 10 deletions
diff --git a/tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt b/tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt
index 6d392eed..f5bfee92 100644
--- a/tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt
+++ b/tools/AmbSignalMapper/lib/Intel/IviPoc/templates/CMakeLists.txt
@@ -1,19 +1,27 @@
cmake_minimum_required(VERSION 2.8)
-set( CMAKE_VERBOSE_MAKEFILE on )
+set(CMAKE_VERBOSE_MAKEFILE on )
+set(PLUGIN_SEGMENT_INSTALL_PATH "/etc/ambd/plugins.d")
+set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
+set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_LIBRARY_ARCHITECTURE}" )
+set(PLUGIN_INSTALL_PATH "${LIB_INSTALL_DIR}/automotive-message-broker")
# to install plugin into /usr instead of /usr/local
set (CMAKE_INSTALL_PREFIX /usr)
-IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
+# check that CAN interface is specified and use vcan0 by default
+if(NOT DEFINED ${DEFAULT_CAN_INTERFACE})
+ set(DEFAULT_CAN_INTERFACE "vcan0")
+endif(NOT DEFINED ${DEFAULT_CAN_INTERFACE})
+
+if(CMAKE_BUILD_TYPE MATCHES DEBUG)
message("debug mode")
+else(CMAKE_BUILD_TYPE MATCHES DEBUG)
+ # default is RELEASE mode
+ message("release mode, no logger")
+ add_definitions(-D_LOGGER_NO_LOG)
ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
-IF(CMAKE_BUILD_TYPE MATCHES RELEASE)
- message("release mode")
- add_definitions(-D_LOGGER_NO_LOG)
-ENDIF(CMAKE_BUILD_TYPE MATCHES RELEASE)
-
include(FindPkgConfig)
find_package(Boost REQUIRED)
@@ -21,7 +29,7 @@ find_package(Boost REQUIRED)
pkg_check_modules(glib REQUIRED glib-2.0)
pkg_check_modules(json REQUIRED json)
-add_definitions(-std=gnu++0x -fPIC -fPIE)
+add_definitions(-std=gnu++0x)
pkg_check_modules( amb REQUIRED automotive-message-broker )
pkg_check_modules( amb-plugins-common REQUIRED amb-plugins-common )
@@ -31,6 +39,8 @@ include_directories(${include_dirs} ${amb-plugins-common_INCLUDE_DIRS} ${amb_INC
set(ambtmpl_plugin_headers ambtmpl_plugin.h ambtmpl_cansignals.h ambtmpl_cansignal.h)
set(ambtmpl_plugin_sources ambtmpl_plugin.cpp ambtmpl_cansignal.cpp)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ambtmpl.in.json ${CMAKE_CURRENT_BINARY_DIR}/ambtmpl @ONLY)
+
if(ivipoc_tests)
#########################################
# ivipoc_tests START
@@ -63,6 +73,7 @@ add_library(ambtmpl_plugin MODULE ${ambtmpl_plugin_sources} ${ambtmpl_plugin_hea
set_target_properties(ambtmpl_plugin PROPERTIES PREFIX "")
target_link_libraries(ambtmpl_plugin ${link_libraries} ${libamb_LIBRARY} ${amb_LIBRARIES} ${amb-plugins-common_LIBRARIES})
-install(TARGETS ambtmpl_plugin LIBRARY DESTINATION lib/automotive-message-broker)
+install(TARGETS ambtmpl_plugin LIBRARY DESTINATION "lib/automotive-message-broker")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ambtmpl DESTINATION ${PLUGIN_SEGMENT_INSTALL_PATH})
+
-############################################################################################################################################