From 71f3d02e1244c7fe29abf64d7b9519b2537e39ba Mon Sep 17 00:00:00 2001 From: Shunichi Nozawa Date: Fri, 8 Apr 2016 15:07:51 +0900 Subject: [PATCH] [CMakeLists.txt] Specify include_directories as higher priority to pass QNX build. --- CMakeLists.txt | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 686b8f0376e..1eab99df0a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,20 +33,10 @@ elseif(WIN32) set(SH_SFX "bat") endif() -# OpenRTM-aist(>= 1.0.0) -find_package(OpenRTM REQUIRED) -if(EXISTS "${OPENRTM_DIR}/include/openrtm-1.1/rtm/RTObjectStateMachine.h") -add_definitions(-DOPENRTM_VERSION_TRUNK) -endif() - -# OpenHRP -find_package(OpenHRP REQUIRED) -include_directories(${OPENHRP_INCLUDE_DIRS}) -link_directories(${OPENHRP_LIBRARY_DIRS}) -if(UNIX) - add_definitions(${OPENHRP_DEFINITIONS}) -endif() - +# Specify include directory. +# After https://github.com/fkanehiro/hrpsys-base/pull/842, hrpsys-base local include files are used as "hrpsys/xx/yy.h". +# For this reason, we make ${CMAKE_BINARY_DIR}/hrpsys directory and generate symbolic link for related include files under it. +# To deal with include files in ${CMAKE_BINARY_DIR}/hrpsys as hrpsys-base local include files, we set cmake's include_directories before other include_directories setting to set higher priority for ${CMAKE_BINARY_DIR}/hrpsys. execute_process( COMMAND mkdir -p ${CMAKE_BINARY_DIR}/hrpsys ) @@ -67,6 +57,20 @@ if (NOT EXISTS ${CMAKE_BINARY_DIR}/hrpsys/idl) endif() include_directories(${CMAKE_BINARY_DIR}) +# OpenRTM-aist(>= 1.0.0) +find_package(OpenRTM REQUIRED) +if(EXISTS "${OPENRTM_DIR}/include/openrtm-1.1/rtm/RTObjectStateMachine.h") +add_definitions(-DOPENRTM_VERSION_TRUNK) +endif() + +# OpenHRP +find_package(OpenHRP REQUIRED) +include_directories(${OPENHRP_INCLUDE_DIRS}) +link_directories(${OPENHRP_LIBRARY_DIRS}) +if(UNIX) + add_definitions(${OPENHRP_DEFINITIONS}) +endif() + if(ENABLE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../../../lib:${OPENHRP_LIBRARY_DIRS}") endif()