-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
62 lines (52 loc) · 2.42 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
cmake_minimum_required(VERSION 2.8.3)
project(robot_assembler)
find_package(catkin REQUIRED COMPONENTS
roseus euslisp
)
catkin_package(
DEPENDS
CATKIN_DEPENDS
INCLUDE_DIRS
LIBRARIES
)
if(NOT euslisp_INCLUDE_DIRS)
if(EXISTS ${euslisp_SOURCE_DIR}/jskeus)
set(euslisp_PACKAGE_PATH ${euslisp_SOURCE_DIR})
else()
set(euslisp_PACKAGE_PATH ${euslisp_PREFIX}/share/euslisp)
endif()
message("-- Set euslisp_PACKAGE_PATH to ${euslisp_PACKAGE_PATH}")
set(euslisp_INCLUDE_DIRS ${euslisp_PACKAGE_PATH}/jskeus/eus/include)
endif()
message("-- Set euslisp_INCLUDE_DIRS to ${euslisp_INCLUDE_DIRS}")
include_directories(/usr/include /usr/X11R6/include ${euslisp_INCLUDE_DIRS} ${assimpdevel_INCLUDE_DIRS})
find_package(yaml-cpp)
add_library(eus_yaml_cpp src/eus_yaml_cpp.cpp)
target_link_libraries(eus_yaml_cpp ${YAML_CPP_LIBRARIES})
set_target_properties(eus_yaml_cpp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/euslisp)
# compile flags
add_definitions(-std=c++11 -O2 -Wno-write-strings -Wno-comment)
add_definitions(-Di486 -DLinux -D_REENTRANT -DVERSION='\"9.00\"' -DTHREADED -DPTHREAD -DX11R6_1)
add_definitions('-DREPOVERSION="\\"${REPOVERSION}\\""')
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64* OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64* OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES aarch64* )
add_definitions(-Dx86_64)
else()
add_definitions(-Di486)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
add_definitions(-Dx86_64)
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -flat_namespace -undefined suppress")
endif()
set_target_properties(eus_yaml_cpp PROPERTIES PREFIX "" SUFFIX ".so")
###
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler-viewer.so ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler.so ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler-utils.so
COMMAND ./compile.sh
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/euslisp
DEPENDS ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler-viewer.l ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler.l ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler-utils.l)
add_custom_target(compile_lisp_files ALL DEPENDS eus_yaml_cpp ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler-viewer.so ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler.so ${PROJECT_SOURCE_DIR}/euslisp/robot-assembler-utils.so)
# install
install(DIRECTORY euslisp launch gazebo sample config meshes scripts
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS)