-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
133 lines (100 loc) · 3.39 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
cmake_minimum_required(VERSION 2.6)
include(cmake/base.cmake)
include(cmake/boost.cmake)
include(cmake/ros.cmake)
#include(cmake/pthread.cmake)
project(openhrp3_simulator_wo_rtm)
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation)
#if (UNIX)
# search_for_pthread()
#endif(UNIX)
set(PROJECT_NAME openhrp3_simulator_wo_rtm)
set(PROJECT_DESCRIPTION "OpenHRP simulator")
set(PROJECT_URL "https://github.com/olivier-stasse/openhrp3-simulator-wo-rtm")
# Disable -Werror on Unix for now.
set(CXX_DISABLE_WERROR True)
set(CMAKE_VERBOSE_MAKEFILE True)
# Add std=c++11 flag
if (UNIX)
SET(LFLAG -std=c++11)
SET(CMAKE_CXX_FLAGS "${LFLAG} ${CMAKE_CXX_FLAGS}")
endif(UNIX)
setup_project()
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
set(OPENHRP_SIMULATOR_VERSION_MAJOR 3)
set(OPENHRP_SIMULATOR_VERSION_MINOR 1)
set(OPENHRP_SIMULATOR_VERSION_MICRO 3)
set(OPENHRP_LIBRARY_VERSION "${OPENHRP_SIMULATOR_VERSION_MAJOR}.${OPENHRP_SIMULATOR_VERSION_MINOR}.${OPENHRP_SIMULATOR_VERSION_MICRO}")
catkin_package(CATKIN_DEPENDS message_runtime roscpp)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
# Add local modules
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/)
include(FindPkgConfig)
include(CheckIncludeFiles)
# Check boost
find_package(Boost 1.35.0 REQUIRED COMPONENTS program_options filesystem signals system regex thread)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
# check blas and lapack
find_package(Lapack REQUIRED)
include_directories(${LAPACK_INCLUDE_DIRS})
link_directories(${LAPACK_LIBRARY_DIRS})
# eigen
find_package(Eigen)
include_directories(${EIGEN_INCLUDE_DIR})
# png
if (UNIX)
set(PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/hrplib/hrpUtil/lpng1232" )
include_directories(${PNG_INCLUDE_DIR})
set(PNG_LIBRARY png)
endif()
# jpeg
if (UNIX)
set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/hrplib/hrpUtil/Jpeg-6b" )
include_directories(${JPEG_INCLUDE_DIR})
set(JPEG_LIBRARY jpeg)
endif()
# zlib
if (UNIX)
set(ZLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/hrplib/hrpUtil/zlib123" )
include_directories(${ZLIB_INCLUDE_DIR})
set(ZLIB_LIBRARY zlib)
endif()
# omniORB
if(UNIX)
if(NOT OMNIORB_DIR)
pkg_check_modules(OMNIORB REQUIRED omniORB4)
if(OMNIORB_FOUND)
set(OMNIORB_DIR ${OMNIORB_PREFIX})
message(STATUS "Found omniORB ${OMNIORB_VERSION} in ${OMNIORB_PREFIX}")
endif()
else()
set(OMNIORB_INCLUDE_DIRS ${OMNIORB_DIR}/include)
set(OMNIORB_LIBRARY_DIRS ${OMNIORB_DIR}/lib)
endif()
endif()
# OnlineViewer
if(UNIX)
add_required_dependency("gepetto-viewer")
include_directories(${GEPETTO_VIEWER_INCLUDE_DIR})
add_required_dependency("libxml-2.0")
endif()
include_directories(${PROJECT_BINARY_DIR}/hrplib)
include_directories(${PROJECT_SOURCE_DIR}/hrplib)
set(OPENHRP_SIMULATOR_IDL_DIR ${CMAKE_SOURCE_DIR}/idl)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH )
set(OPENHRP_IDL_DIR ${OpenHRP_SOURCE_DIR}/idl)
set(OPENHRP_DIR ${CMAKE_INSTALL_PREFIX})
set(OPENHRP_SHARE_DIR ${OPENHRP_DIR}/${RELATIVE_SHARE_INSTALL_PATH})
# Subdirectories
add_subdirectory(idl)
add_subdirectory(hrplib)
add_subdirectory(server)
add_subdirectory(sample)
add_subdirectory(scripts)
install(FILES package.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
setup_project_finalize()