-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
154 lines (129 loc) · 5.24 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
cmake_minimum_required(VERSION 2.6)
#set(IDL_DIR ${CMAKE_CURRENT_BINARY_DIR}/)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if (NOT CMAKE_MODULE_PATH)
#old HDD
#set(CMAKE_MODULE_PATH /opt/grx/share/hrpsys/cmake_modules/ CACHE STRING "set path to cmake_modules")
set(CMAKE_MODULE_PATH ~/src/hrpsys/trunk/cmake_modules/ CACHE STRING "set path to cmake_modules")
#set(CMAKE_MODULE_PATH ~/src/hrpsys_base/trunk/cmake_modules/ CACHE STRING "set path to cmake_modules")
#set(CMAKE_MODULE_PATH ../..//cmake_modules/ CACHE STRING "set path to cmake_modules")
endif (NOT CMAKE_MODULE_PATH)
#message (STATUS "/_/_/_/_/_/_/_/_/_/_/_/=${IDL_DIR}")
####
## settings for OpenRTM and OpenHRP
##
include(FindPkgConfig)
include(CheckIncludeFiles)
find_package(OpenRTM REQUIRED)
find_package(OpenHRP REQUIRED)
#find_package(OpenSceneGraph REQUIRED)
#find_package(Choreonoid REQUIRED)
include_directories(${OPENRTM_INCLUDE_DIRS})
link_directories(${OPENRTM_LIBRARY_DIRS})
include_directories(${OPENHRP_INCLUDE_DIRS})
link_directories(${OPENHRP_LIBRARY_DIRS})
include_directories(${CHOREONOID_INCLUDE_DIRS})
link_directories(${CHOREONOID_LIBRARY_DIRS})
#include_directories(/opt/grx/include)
include_directories(/usr/local/include)
include_directories(${CMAKE_MODULE_PATH})
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/preview_control)
##################
#########
##################
if(NOT CHOREONOID_DIR)
if(UNIX)
pkg_check_modules(CHOREONOID REQUIRED choreonoid-body-plugin)
if(CHOREONOID_FOUND)
set(CHOREONOID_DIR ${CHOREONOID_INCLUDE_DIRS})
endif()
endif()
else()
set(CHOREONOID_INCLUDE_DIRS ${CHOREONOID_DIR})
endif()
message("korekore " ${CHOREONOID_DIR})
set(CHOREONOID_DIR ${CHOREONOID_DIR} CACHE PATH "The directory of the choreonoid library")
if(NOT CHOREONOID_INCLUDE_DIRS)
message(FATAL_ERROR "Please specify the choreonoid directory to CHOREONOID_DIR.")
else()
include_directories(${CHOREONOID_INCLUDE_DIRS})
link_directories(${CHOREONOID_LIBRARY_DIRS})
endif()
######################
##################
# eigen
#if(NOT EIGEN_DIR)
# if(UNIX)
# pkg_check_modules(EIGEN eigen3)
# if(EIGEN_FOUND)
# set(EIGEN_DIR ${EIGEN_INCLUDE_DIRS})
# endif()
# endif()
#else()
# set(EIGEN_INCLUDE_DIRS ${EIGEN_DIR})
#endif()
#set(EIGEN_DIR ${EIGEN_DIR} CACHE PATH "The directory of the Eigen library")
#if(NOT EIGEN_INCLUDE_DIRS)
# message(FATAL_ERROR "Please specify the Eigen directory to EIGEN_DIR.")
#else()
# include_directories(${EIGEN_INCLUDE_DIRS})
#endif()
######################
#if(QNXNTO)
# include_directories(/usr/pkg/include)
# set(NO_COMP true)
# set(CPACK_GENERATOR "DEB")
# set(CPACK_DEB_COMPONENT_INSTALL ON)
# if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# set(CPACK_SYSTEM_NAME "amd64")
# else(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# set(CPACK_SYSTEM_NAME "i386")
# endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# set(CPACK_PACKAGE_NAME "sonyComponent")
# set(CPACK_DEBIAN_PACKAGE_MAINTAINTER "GRX Support")
# set(CPACK_PACKAGE_CONTACT "[email protected]")
# set(CPACK_PACKAGE_VENDOR "General Robotix, Inc.")
# #set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX})
# #set(CPACK_INSTALL_DIRECTORIES ${CMAKE_INSTALL_PREFIX})
# #set(CPACK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# set(CPACK_DEBIAN_BUILD_DEPENDS g++)
# include(CPack)
# include(UploadPPA)
#endif(QNXNTO)
include(GenerateStubSkel)
####
## for each component
##
set(comp_name JojoPDservo)
set(comp_sources ${comp_name}.cpp)
#generate_stub_skel(${comp_name}Service)
#set(comp_sources ${comp_sources} ${comp_name}Service_impl.cpp ${comp_name}ServiceSk.cpp)
#generate_hrpsys_stub_skel_wrapper(SequencePlayerService)
#set(comp_sources ${comp_sources} SequencePlayerServiceStub.cpp)
#set(comp_sources ${comp_sources} hrp2Base.cpp)
#set(comp_sources ${comp_sources} myfunc.cpp)# to be revise tvmet
#set(comp_sources ${comp_sources} ZmpPlaner.cpp)
#set(comp_sources ${comp_sources} ${CMAKE_CURRENT_SOURCE_DIR}/preview_control/PreviewControl.cpp)
#set(comp_sources ${comp_sources} NMSclassQ.cpp)
add_library(${comp_name} SHARED ${comp_sources})
target_link_libraries(${comp_name} ${CHOREONOID_LIBRARIES} CnoidBody CnoidBodyPlugin CnoidUtil CnoidBase )
target_link_libraries(${comp_name} ${OPENRTM_LIBRARIES} hrpModel-3.1 hrpUtil-3.1)
target_link_libraries(${comp_name} lapack blas f2c m)
set_target_properties(${comp_name} PROPERTIES PREFIX "")
if (NO_COMP)
set(target ${comp_name})
else()
set(target ${comp_name} ${comp_name}Comp)
add_executable(${comp_name}Comp ${comp_name}Comp.cpp ${comp_sources})
target_link_libraries(${comp_name}Comp ${OPENRTM_LIBRARIES} hrpModel-3.1 hrpUtil-3.1)
target_link_libraries(${comp_name}Comp ${CHOREONOID_LIBRARIES} CnoidBody CnoidBodyPlugin CnoidUtil CnoidBase )
target_link_libraries(${comp_name}Comp boost_filesystem)
target_link_libraries(${comp_name}Comp m)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb3 -fno-schedule-insns -fno-schedule-insns2 -fno-strict-aliasing")
#install(TARGETS ${comp_name}
# RUNTIME DESTINATION bin CONFIGURATIONS Release Debug
# LIBRARY DESTINATION lib CONFIGURATIONS Release Debug
# )
#INSTALL(FILES ${comp_name}.so DESTINATION "/home/wu/chorenoid/lib/choreonoid-1.5/rtc")
INSTALL(FILES ${comp_name}.so DESTINATION "/home/wu/downloads/src/chnoid_dev/choreonoid/build/lib/choreonoid-1.5/rtc")