From 745938236d26cde7b8329c4c77cd097967d3d79a Mon Sep 17 00:00:00 2001 From: Peter Soetens Date: Mon, 11 Apr 2011 15:07:49 +0200 Subject: [PATCH] cmake: allow to override the plugin path for typelib. Cmake code to allow an alternative path + rosmake code for setting it when building the Debian packages. Signed-off-by: Peter Soetens --- Makefile | 5 +++++ typelib/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index 29d03d9..64fe7f3 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,11 @@ include $(shell rospack find mk)/cmake.mk export PKG_CONFIG_PATH:=$(shell rospack find utilmm)/install/lib/pkgconfig EXTRA_CMAKE_FLAGS=-DCMAKE_INSTALL_PREFIX=`rospack find typelib`/install\ -DLIBRARY_OUTPUT_PATH=`rospack find typelib`/lib + +ifdef ROS_STACK_DIR_FINAL +EXTRA_CMAKE_FLAGS +=-DTYPELIB_PLUGIN_PATH="${ROS_STACK_DIR_FINAL}/orocos_toolchain_ros/typelib/install/lib/typelib" +endif + install: all mkdir -p build && cd build && cmake .. && ${MAKE} install else diff --git a/typelib/CMakeLists.txt b/typelib/CMakeLists.txt index 4d1476f..86d58a2 100644 --- a/typelib/CMakeLists.txt +++ b/typelib/CMakeLists.txt @@ -3,8 +3,13 @@ ADD_LIBRARY(typeLib SHARED typedisplay.cc exporter.cc pluginmanager.cc value.cc importer.cc csvoutput.cc endianness.cc memory_layout.cc value_ops.cc) +if (NOT TYPELIB_PLUGIN_PATH) set_source_files_properties(pluginmanager.cc PROPERTIES COMPILE_FLAGS -DTYPELIB_PLUGIN_PATH="\\"${CMAKE_INSTALL_PREFIX}/lib/typelib\\"") +else (NOT TYPELIB_PLUGIN_PATH) +set_source_files_properties(pluginmanager.cc PROPERTIES + COMPILE_FLAGS -DTYPELIB_PLUGIN_PATH="\\"${TYPELIB_PLUGIN_PATH}\\"") +endif (NOT TYPELIB_PLUGIN_PATH) set_source_files_properties(endianness.cc PROPERTIES COMPILE_FLAGS -fno-strict-aliasing) -- 1.7.0.4