From 18fc7be7ee1b532339b37da51ecc5f3659032fc3 Mon Sep 17 00:00:00 2001 From: Peter Soetens Date: Thu, 31 Jan 2013 16:29:51 +0100 Subject: [PATCH] typekit: allow to generate typekit libs into target/pkg subdirs This will only be enabled when the user included himself UseOrocos-RTT.cmake or if he set -DUSE_OROCOS_RTT=1 in cmake This provides deployer imports on a package directory basis instead of on a filename basis. Signed-off-by: Peter Soetens --- lib/orogen/templates/typekit/CMakeLists.txt | 13 ++++++++----- lib/orogen/templates/typekit/corba/CMakeLists.txt | 2 +- .../templates/typekit/corba/transport-corba.pc | 2 +- lib/orogen/templates/typekit/mqueue/CMakeLists.txt | 2 +- .../templates/typekit/mqueue/transport-mqueue.pc | 2 +- lib/orogen/templates/typekit/typekit.pc | 2 +- .../templates/typekit/typelib/CMakeLists.txt | 2 +- .../templates/typekit/typelib/transport-typelib.pc | 2 +- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/orogen/templates/typekit/CMakeLists.txt b/lib/orogen/templates/typekit/CMakeLists.txt index 8156c48..09fd50a 100644 --- a/lib/orogen/templates/typekit/CMakeLists.txt +++ b/lib/orogen/templates/typekit/CMakeLists.txt @@ -11,10 +11,13 @@ SET (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config") # In Orogen components, the build target is specified at generation time set(OROCOS_TARGET "<%= typekit.orocos_target %>") -# By default, install libs in /target/ subdir in order to allow -# multi-target installs. -if ( NOT OROCOS_SUFFIX ) +# If UseOrocos-RTT.cmake is used, install libs in /target/package subdir in order to allow +# multi-target/package installs. +if ( USE_OROCOS_RTT ) + if ( NOT OROCOS_SUFFIX ) set (OROCOS_SUFFIX "/${OROCOS_TARGET}") + endif() + set(OROCOS_PKG_DIR "${OROCOS_SUFFIX}/<%= typekit.name %>") endif() # Enable -Wall for compilers that know it @@ -29,7 +32,7 @@ endif (CXX_SUPPORTS_WALL) option(WITH_RPATH "enables or disables embedding RPath information in binaries" ON) if(WITH_RPATH) include(RPATHHandling) - CMAKE_USE_FULL_RPATH("${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/orocos") + CMAKE_USE_FULL_RPATH("${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/orocos:${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_PKG_DIR}/types") endif(WITH_RPATH) # Set the build type to debug by default @@ -100,7 +103,7 @@ target_link_libraries(${libname} LINK_INTERFACE_LIBRARIES ${OrocosRTT_LIBRARIES} set(PKG_CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/<%= typekit.name %>-typekit-${OROCOS_TARGET}.pc) configure_file(<%= typekit.name %>-typekit.pc.in ${PKG_CONFIG_FILE} @ONLY) -install(TARGETS ${libname} LIBRARY DESTINATION lib/orocos/types) +install(TARGETS ${libname} LIBRARY DESTINATION lib/orocos${OROCOS_PKG_DIR}/types) install(FILES Types.hpp <% if typekit.has_opaques_with_templates? %> diff --git a/lib/orogen/templates/typekit/corba/CMakeLists.txt b/lib/orogen/templates/typekit/corba/CMakeLists.txt index 93d73f6..d3cc66a 100644 --- a/lib/orogen/templates/typekit/corba/CMakeLists.txt +++ b/lib/orogen/templates/typekit/corba/CMakeLists.txt @@ -46,7 +46,7 @@ target_link_libraries(${libname_corba} LINK_INTERFACE_LIBRARIES ${OrocosCORBA_LI SET(PKG_CONFIG_FILE_CORBA ${CMAKE_CURRENT_BINARY_DIR}/<%= typekit.name %>-transport-corba-${OROCOS_TARGET}.pc) CONFIGURE_FILE(<%= typekit.name %>-transport-corba.pc.in ${PKG_CONFIG_FILE_CORBA} @ONLY) -install(TARGETS ${libname_corba} LIBRARY DESTINATION lib/orocos/types) +install(TARGETS ${libname_corba} LIBRARY DESTINATION lib/orocos${OROCOS_PKG_DIR}/types) install(FILES ${PKG_CONFIG_FILE_CORBA} DESTINATION lib/pkgconfig) install(FILES <%= headers.join("\n ") %> diff --git a/lib/orogen/templates/typekit/corba/transport-corba.pc b/lib/orogen/templates/typekit/corba/transport-corba.pc index ae19b65..0a5f18e 100644 --- a/lib/orogen/templates/typekit/corba/transport-corba.pc +++ b/lib/orogen/templates/typekit/corba/transport-corba.pc @@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/lib/orocos/types +libdir=${prefix}/lib/orocos@OROCOS_PKG_DIR@/types includedir=${prefix}/include/orocos project_name=<%= typekit.name %> diff --git a/lib/orogen/templates/typekit/mqueue/CMakeLists.txt b/lib/orogen/templates/typekit/mqueue/CMakeLists.txt index 1af0b1e..3544310 100644 --- a/lib/orogen/templates/typekit/mqueue/CMakeLists.txt +++ b/lib/orogen/templates/typekit/mqueue/CMakeLists.txt @@ -33,7 +33,7 @@ target_link_libraries(${libname_mqueue} SET(PKG_CONFIG_FILE_MQueue ${CMAKE_CURRENT_BINARY_DIR}/<%= typekit.name %>-transport-mqueue-${OROCOS_TARGET}.pc) CONFIGURE_FILE(<%= typekit.name %>-transport-mqueue.pc.in ${PKG_CONFIG_FILE_MQueue} @ONLY) -install(TARGETS ${libname_mqueue} LIBRARY DESTINATION lib/orocos/types) +install(TARGETS ${libname_mqueue} LIBRARY DESTINATION lib/orocos${OROCOS_PKG_DIR}/types) install(FILES ${PKG_CONFIG_FILE_MQueue} DESTINATION lib/pkgconfig) install(FILES <%= headers.join("\n ") %> diff --git a/lib/orogen/templates/typekit/mqueue/transport-mqueue.pc b/lib/orogen/templates/typekit/mqueue/transport-mqueue.pc index 21f8e41..8d281a4 100644 --- a/lib/orogen/templates/typekit/mqueue/transport-mqueue.pc +++ b/lib/orogen/templates/typekit/mqueue/transport-mqueue.pc @@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/lib/orocos/types +libdir=${prefix}/lib/orocos@OROCOS_PKG_DIR@/types includedir=${prefix}/include/orocos project_name=<%= typekit.name %> diff --git a/lib/orogen/templates/typekit/typekit.pc b/lib/orogen/templates/typekit/typekit.pc index da8447c..956ace7 100644 --- a/lib/orogen/templates/typekit/typekit.pc +++ b/lib/orogen/templates/typekit/typekit.pc @@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/lib/orocos/types +libdir=${prefix}/lib/orocos@OROCOS_PKG_DIR@/types includedir=${prefix}/include/orocos project_name=<%= typekit.name %> diff --git a/lib/orogen/templates/typekit/typelib/CMakeLists.txt b/lib/orogen/templates/typekit/typelib/CMakeLists.txt index b3aa636..75669c5 100644 --- a/lib/orogen/templates/typekit/typelib/CMakeLists.txt +++ b/lib/orogen/templates/typekit/typelib/CMakeLists.txt @@ -64,5 +64,5 @@ install(FILES ${PKG_CONFIG_FILE_TYPELIB} DESTINATION lib/pkgconfig) install(FILES TransportPlugin.hpp DESTINATION include/orocos/<%= typekit.name %>/transports/typelib) -install(TARGETS ${libname_typelib} LIBRARY DESTINATION lib/orocos/types) +install(TARGETS ${libname_typelib} LIBRARY DESTINATION lib/orocos${OROCOS_PKG_DIR}/types) diff --git a/lib/orogen/templates/typekit/typelib/transport-typelib.pc b/lib/orogen/templates/typekit/typelib/transport-typelib.pc index 740b454..dd9dc5b 100644 --- a/lib/orogen/templates/typekit/typelib/transport-typelib.pc +++ b/lib/orogen/templates/typekit/typelib/transport-typelib.pc @@ -2,7 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/lib/orocos/types +libdir=${prefix}/lib/orocos@OROCOS_PKG_DIR@/types includedir=${prefix}/include/orocos project_name=<%= typekit.name %> -- 1.7.9.5