-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
54 lines (36 loc) · 1.67 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
cmake_minimum_required(VERSION 2.4)
project(voxel-collision-checker-plugin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
message(STATUS "CMAKE_SOURCE_DIR : " ${CMAKE_SOURCE_DIR})
message(STATUS "CMAKE_MODULE_PATH : " ${CMAKE_MODULE_PATH})
# Build Type, Default mode is Debug
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
IF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
ADD_DEFINITIONS(-g -Wall -Wno-unknown-pragmas -fstack-protector-all)
ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Release")
ADD_DEFINITIONS(-O2 -Wall -Wno-unknown-pragmas)
ENDIF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
SET(LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/lib/$ENV{HOSTTYPE}")
# Default Flags
ADD_DEFINITIONS(-DKCD_MOVE3D -DPRINT_ERROR -DPRINT_INFO)
# Find packages
find_package(OpenRAVE REQUIRED)
if( NOT OPENRAVE_FOUND )
message(FATAL_ERROR "could not find openrave, check for openrave-config in path")
endif( NOT OPENRAVE_FOUND )
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
add_definitions("-fno-strict-aliasing ")
endif()
add_definitions("-g ")
cmake_minimum_required(VERSION 2.4.6)
file(GLOB source_files src/*.cpp)
add_library( voxelcollcheck SHARED ${source_files} )
set_target_properties( voxelcollcheck PROPERTIES LINK_FLAGS ${OPENRAVE_LINK_FLAGS} COMPILE_FLAGS ${OPENRAVE_CXXFLAGS})
include_directories(${OPENRAVE_INCLUDE_DIRS} src/)
target_link_libraries( voxelcollcheck ${OPENRAVE_LIBRARY} )
set(PLUGIN_INSTALL_DIR "${CMAKE_SOURCE_DIR}/plugins")
install(TARGETS voxelcollcheck DESTINATION ${PLUGIN_INSTALL_DIR} )