From 2c6d5722b7683175f7b371def83660fe8d8df1de Mon Sep 17 00:00:00 2001 From: Stephen Roderick Date: Tue, 1 Feb 2011 21:51:10 -0500 Subject: [PATCH] cmake: Correctly pass '-z,defs' option to gcc on Apple --- UseOROCOS-RTT.cmake | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/UseOROCOS-RTT.cmake b/UseOROCOS-RTT.cmake index dbc6f6b..d82e183 100644 --- a/UseOROCOS-RTT.cmake +++ b/UseOROCOS-RTT.cmake @@ -18,7 +18,11 @@ if(OROCOS-RTT_FOUND) # This is for not allowing undefined symbols when using gcc if (CMAKE_COMPILER_IS_GNUCXX) - SET(USE_OROCOS_LINK_FLAGS "-Wl,-z,defs") + if (APPLE) + SET(USE_OROCOS_LINK_FLAGS) + else (APPLE) + SET(USE_OROCOS_LINK_FLAGS LINK_FLAGS "-Wl,-z,defs") + endif (APPLE) endif (CMAKE_COMPILER_IS_GNUCXX) # Detect user flag: install with orocos @@ -116,7 +120,7 @@ macro( orocos_component COMPONENT_NAME ) ${LIB_COMPONENT_VERSION} INSTALL_RPATH_USE_LINK_PATH 1 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_SUFFIX};${CMAKE_INSTALL_PREFIX}/lib;${AC_INSTALL_DIR}" - LINK_FLAGS ${USE_OROCOS_LINK_FLAGS} + ${USE_OROCOS_LINK_FLAGS} ) TARGET_LINK_LIBRARIES( ${COMPONENT_NAME} ${OROCOS-RTT_LIBRARIES} ) @@ -172,7 +176,7 @@ macro( orocos_library LIB_TARGET_NAME ) ${LIB_COMPONENT_VERSION} INSTALL_RPATH_USE_LINK_PATH 1 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${AC_INSTALL_DIR}" - LINK_FLAGS ${USE_OROCOS_LINK_FLAGS} + ${USE_OROCOS_LINK_FLAGS} ) TARGET_LINK_LIBRARIES( ${LIB_TARGET_NAME} ${OROCOS-RTT_LIBRARIES} ) @@ -228,7 +232,7 @@ macro( orocos_executable EXE_TARGET_NAME ) ${EXE_COMPONENT_VERSION} INSTALL_RPATH_USE_LINK_PATH 1 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/bin;${AC_INSTALL_DIR}" - LINK_FLAGS ${USE_OROCOS_LINK_FLAGS} + ${USE_OROCOS_LINK_FLAGS} ) TARGET_LINK_LIBRARIES( ${EXE_TARGET_NAME} ${OROCOS-RTT_LIBRARIES} ) @@ -370,7 +374,7 @@ macro( orocos_plugin LIB_TARGET_NAME ) ${LIB_COMPONENT_VERSION} INSTALL_RPATH_USE_LINK_PATH 1 INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_SUFFIX}/plugins;${AC_INSTALL_DIR}" - LINK_FLAGS ${USE_OROCOS_LINK_FLAGS} + ${USE_OROCOS_LINK_FLAGS} ) TARGET_LINK_LIBRARIES( ${LIB_TARGET_NAME} ${OROCOS-RTT_LIBRARIES} ) -- 1.7.0.2