Skip to content

Commit

Permalink
typekit/corba/cmake: get Corba bindings compiling from catkin_make
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Smits <[email protected]>
  • Loading branch information
Ruben Smits committed Dec 26, 2013
1 parent e6c2b91 commit 70e131f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/orogen/templates/typekit/corba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

<% typekit_deps = typekit.plugin('corba').dependencies(typekit); %>

find_package(Orocos-RTT 2 REQUIRED)
find_package(OrocosCORBA REQUIRED COMPONENTS Typekit)
add_definitions(${OrocosCORBA_DEFINES})
include_directories(${OrocosCORBA_INCLUDE_DIRS})

if(NOT OROCOS-RTT_CORBA_FOUND)
message(FATAL "Could not find Orocos RTT Corba bindings")
endif()
<%= Generation.cmake_pkgconfig_require(typekit_deps, 'corba') %>

IF (NOT OrocosCORBA_Typekit_FOUND)
MESSAGE(FATAL_ERROR "could not find development files for Orocos/CORBA")
ENDIF(NOT OrocosCORBA_Typekit_FOUND)

set(CORBA_FILES ${CMAKE_CURRENT_BINARY_DIR}/<%= typekit.name %>TypesC.cpp)
if(CORBA_IMPLEMENTATION STREQUAL "OMNIORB")
list(APPEND CORBA_FILES ${CMAKE_CURRENT_BINARY_DIR}/<%= typekit.name %>TypesDynSK.cpp)
Expand All @@ -20,6 +23,9 @@ add_custom_command(OUTPUT ${CORBA_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/<%= typekit.name %>Types.idl
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/<%= typekit.name %>Types.idl)

add_definitions(${OrocosCORBA_Typekit_DEFINES})
include_directories(${OrocosCORBA_Typekit_INCLUDE_DIRS})

# Generate the CORBA transport
set(libname_corba <%= typekit.name %>-transport-corba-${OROCOS_TARGET})
orocos_typekit(${libname_corba}
Expand All @@ -28,12 +34,6 @@ orocos_typekit(${libname_corba}
target_link_libraries(${libname_corba}
<%= typekit.name %>-typekit-${OROCOS_TARGET} ${OROCOS-RTT_CORBA_LIBRARIES})

if(WITH_RPATH AND APPLE)
set_target_properties( ${libname_corba} PROPERTIES
INSTALL_NAME_DIR "@rpath"
LINK_FLAGS "-Wl,-rpath ${CMAKE_INSTALL_PREFIX}/lib -rpath ${CMAKE_INSTALL_PREFIX}/lib/orocos -rpath ${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_PKG_DIR}/types")
endif()

<%= Generation.cmake_pkgconfig_link('corba', '${libname_corba}', typekit_deps) %>
target_link_libraries(${libname_corba} LINK_INTERFACE_LIBRARIES ${OROCOS-RTT_CORBA_LIBRARIES})

Expand Down

0 comments on commit 70e131f

Please sign in to comment.