[openrtm-commit:01008] r427 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake: . cmake src
openrtm @ openrtm.org
openrtm @ openrtm.org
2013年 2月 16日 (土) 01:36:27 JST
Author: n-ando
Date: 2013-02-16 01:36:27 +0900 (Sat, 16 Feb 2013)
New Revision: 427
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/cmake/FindOpenRTM.cmake.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl
Log:
Some CMakeLists.txt bugs have been fixed. refs #2589
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl 2013-02-15 16:35:34 UTC (rev 426)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl 2013-02-15 16:36:27 UTC (rev 427)
@@ -45,10 +45,14 @@
"components/share/${dol}{PROJECT_NAME_LOWER}-${dol}{PROJECT_VERSION_MAJOR}")
${sharp} Get necessary dependency information
-if(NOT WIN32)
- list(APPEND CMAKE_MODULE_PATH ${dol}{PROJECT_SOURCE_DIR}/cmake/Modules)
-endif(NOT WIN32)
-find_package(OpenRTM REQUIRED)
+find_package(OpenRTM)
+if(${dol}{OpenRTM_FOUND})
+ MESSAGE(STATUS "OpenRTM configuration Found")
+else(${dol}{OpenRTM_FOUND})
+ message(STATUS "Use cmake/Modules/FindOpenRTM.cmake in the project")
+ list(APPEND CMAKE_MODULE_PATH ${dol}{PROJECT_SOURCE_DIR}/cmake/Modules)
+ find_package(OpenRTM REQUIRED)
+endif(${dol}{OpenRTM_FOUND})
${sharp} Universal settings
${sharp}enable_testing()
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/cmake/FindOpenRTM.cmake.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/cmake/FindOpenRTM.cmake.vsl 2013-02-15 16:35:34 UTC (rev 426)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/cmake/FindOpenRTM.cmake.vsl 2013-02-15 16:36:27 UTC (rev 427)
@@ -33,7 +33,9 @@
pkg_check_modules(PC_OMNIORB4 omniORB4)
pkg_check_modules(PC_OMNITHREAD3 omnithread3)
pkg_check_modules(PC_OMNIDYNAMIC4 omniDynamic4)
-pkg_check_modules(PC_UUID uuid)
+if ("${dol}{CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ pkg_check_modules(PC_UUID uuid)
+endif ("${dol}{CMAKE_SYSTEM_NAME}" MATCHES "Linux")
find_path(OPENRTM_INCLUDE_DIR rtm/RTC.h
HINTS ${dol}{OPENRTM_ROOT}/include ${dol}{OPENRTM_ROOT} ${dol}ENV{OPENRTM_ROOT}/include ${dol}{PC_OPENRTM_INCLUDE_DIRS})
@@ -56,8 +58,12 @@
HINTS ${dol}{PC_OMNITHREAD3_LIBRARY_DIRS})
find_library(OMNIDYNAMIC4_LIBRARY omniDynamic4
HINTS ${dol}{PC_OMNIDYNAMIC4_LIBRARY_DIRS})
-find_library(UUID_LIBRARY uuid
+if ("${dol}{CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ find_library(UUID_LIBRARY uuid
HINTS ${dol}{PC_UUID_LIBRARY_DIRS})
+else ("${dol}{CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ set(UUID_LIBRARY "")
+endif ("${dol}{CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(OPENRTM_CFLAGS ${dol}{PC_OPENRTM_CFLAGS_OTHER} ${dol}{PC_COIL_CFLAGS_OTHER} ${dol}{PC_OMNIORB4_CFLAGS_OTHER})
set(OPENRTM_INCLUDE_DIRS ${dol}{OPENRTM_INCLUDE_DIR} ${dol}{OPENRTM_INCLUDE_DIR}/rtm/idl
@@ -74,6 +80,10 @@
set(OPENRTM_VERSION_REVISION ${dol}{CMAKE_MATCH_3})
set(OPENRTM_VERSION_CANDIDATE ${dol}{CMAKE_MATCH_4})
+execute_process(COMMAND rtm-config --libs-only-l OUTPUT_VARIABLE
+ OPENRTM_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND rtm-config --libs-only-L OUTPUT_VARIABLE
+ OPENRTM_LIBRARY_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND rtm-config --idlc OUTPUT_VARIABLE OPENRTM_IDL_COMPILER
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND rtm-config --idlflags OUTPUT_VARIABLE OPENRTM_IDL_FLAGS
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl 2013-02-15 16:35:34 UTC (rev 426)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl 2013-02-15 16:36:27 UTC (rev 427)
@@ -1,6 +1,27 @@
set(comp_srcs ${rtcParam.name}.cpp #foreach($providerIdlFile in ${rtcParam.providerIdlPathes})${tmpltHelper.getFilenameNoExt(${providerIdlFile.idlFile})}${tmpltHelper.serviceImplSuffix}.cpp #end)
set(standalone_srcs ${rtcParam.name}Comp.cpp)
+if (DEFINED OPENRTM_INCLUDE_DIRS)
+ string(REGEX REPLACE "-I" ";"
+ OPENRTM_INCLUDE_DIRS "${dol}{OPENRTM_INCLUDE_DIRS}")
+ string(REGEX REPLACE " " ""
+ OPENRTM_INCLUDE_DIRS "${dol}{OPENRTM_INCLUDE_DIRS}")
+endif (DEFINED OPENRTM_INCLUDE_DIRS)
+
+if (DEFINED OPENRTM_LIBRARY_DIRS)
+ string(REGEX REPLACE "-L" ";"
+ OPENRTM_LIBRARY_DIRS "${dol}{OPENRTM_LIBRARY_DIRS}")
+ string(REGEX REPLACE " " ""
+ OPENRTM_LIBRARY_DIRS "${dol}{OPENRTM_LIBRARY_DIRS}")
+endif (DEFINED OPENRTM_LIBRARY_DIRS)
+
+if (DEFINED OPENRTM_LIBRARIES)
+ string(REGEX REPLACE "-l" ";"
+ OPENRTM_LIBRARIES "${dol}{OPENRTM_LIBRARIES}")
+ string(REGEX REPLACE " " ""
+ OPENRTM_LIBRARIES "${dol}{OPENRTM_LIBRARIES}")
+endif (DEFINED OPENRTM_LIBRARIES)
+
include_directories(${dol}{PROJECT_SOURCE_DIR}/include)
include_directories(${dol}{PROJECT_SOURCE_DIR}/include/${dol}{PROJECT_NAME})
include_directories(${dol}{PROJECT_BINARY_DIR})
@@ -15,14 +36,16 @@
link_directories(${dol}{OPENRTM_LIBRARY_DIRS})
link_directories(${dol}{OMNIORB_LIBRARY_DIRS})
-add_library(${dol}{PROJECT_NAME} ${dol}{LIB_TYPE} ${dol}{comp_srcs} ${dol}{comp_headers} ${dol}{ALL_IDL_SRCS})
+add_library(${dol}{PROJECT_NAME} ${dol}{LIB_TYPE} ${dol}{comp_srcs}
+ ${dol}{comp_headers} ${dol}{ALL_IDL_SRCS})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_source_files_properties(${dol}{ALL_IDL_SRCS} PROPERTIES GENERATED 1)
add_dependencies(${dol}{PROJECT_NAME} ALL_IDL_TGT)
target_link_libraries(${dol}{PROJECT_NAME} ${dol}{OPENRTM_LIBRARIES})
-add_executable(${dol}{PROJECT_NAME}Comp ${dol}{standalone_srcs})
-target_link_libraries(${dol}{PROJECT_NAME}Comp ${dol}{PROJECT_NAME})
+add_executable(${dol}{PROJECT_NAME}Comp ${dol}{standalone_srcs}
+ ${dol}{comp_srcs} ${dol}{comp_headers} ${dol}{ALL_IDL_SRCS})
+target_link_libraries(${dol}{PROJECT_NAME}Comp ${dol}{OPENRTM_LIBRARIES})
install(TARGETS ${dol}{PROJECT_NAME} ${dol}{PROJECT_NAME}Comp
EXPORT ${dol}{PROJECT_NAME}
@@ -32,4 +55,3 @@
install(EXPORT ${dol}{PROJECT_NAME}
DESTINATION ${dol}{LIB_INSTALL_DIR}/${dol}{PROJECT_NAME}
FILE ${dol}{PROJECT_NAME}Depends.cmake)
-
\ No newline at end of file
More information about the openrtm-commit
mailing list