forked from zcZhangCheng/BinPickingSimulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (50 loc) · 2.25 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
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(BinPickingSimulation)
add_subdirectory(include)
FIND_PACKAGE(PCL REQUIRED)
if (WIN32)
find_package(Bullet CONFIG REQUIRED HINTS "bullet3\\share\\bullet3")
elseif(UNIX AND NOT APPLE)
find_package(Bullet CONFIG REQUIRED HINTS "bullet3_linux\\share\\bullet3")
endif ()
FIND_PACKAGE(OpenMP)
FIND_PACKAGE(CUDA)
# For bullet lib. You may need to modify here.
SET(__BULLET_INCLUDE_DIRS "${BULLET_INCLUDE_DIRS}; ${BULLET_INCLUDE_DIRS}/bullet/")
SET(__BULLET_LIBRARY_DIRS "${BULLET_INCLUDE_DIRS}/../lib")
SET(__BULLET_LIBRARIES "${BULLET_LIBRARIES};optimized;LinearMath;optimized;BulletDynamics;optimized;BulletCollision;optimized;BulletInverseDynamics;optimized;HACD")
IF(OPENMP_FOUND)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF()
IF(CUDA_FOUND)
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}; -Xcompiler \"/wd 4819\" -arch=sm_61")
OPTION(USE_CUDA "Enable CUDA" TRUE)
ELSE()
OPTION(USE_CUDA "Enable CUDA" FALSE)
ENDIF()
IF(USE_CUDA)
ADD_DEFINITIONS(-DUSE_GPU)
MESSAGE(STATUS "CUDA Enabled.")
ENDIF()
OPTION(USE_SIMD "Enable SIMD" FALSE)
IF(USE_SIMD)
ADD_DEFINITIONS(-DUSE_SIMD)
MESSAGE(STATUS "SIMD Enabled.")
ENDIF()
IF(USE_SIMD AND USE_CUDA)
MESSAGE(FATAL_ERROR "You cannot set USE_GPU and USE_SIMD simultaneously.")
ENDIF()
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${__BULLET_INCLUDE_DIRS})
LINK_DIRECTORIES(${PCL_LIBRARY_DIRS} ${__BULLET_LIBRARY_DIRS})
ADD_DEFINITIONS(${PCL_DEFINITIONS})
ADD_EXECUTABLE(binSceneMaker binSceneMaker.cpp convexDecomposition.hpp setting.hpp)
TARGET_LINK_LIBRARIES(binSceneMaker ${PCL_LIBRARIES} ${__BULLET_LIBRARIES} HPR meshSampling)
TARGET_INCLUDE_DIRECTORIES(binSceneMaker PUBLIC ${HPR_INCLUDE_DIR} ${MESHSAMPLING_INCLUDE_DIR})
IF(USE_CUDA)
CUDA_ADD_EXECUTABLE(visibleSceneMaker visibleSceneMaker.cpp setting.hpp visible_check.cu visible_check.cpp visible_check.h visible_check.cuh)
ELSE()
ADD_EXECUTABLE(visibleSceneMaker visibleSceneMaker.cpp setting.hpp visible_check.cpp visible_check.h)
ENDIF()
TARGET_LINK_LIBRARIES(visibleSceneMaker ${PCL_LIBRARIES} HPR meshSampling)
TARGET_INCLUDE_DIRECTORIES(visibleSceneMaker PUBLIC ${HPR_INCLUDE_DIR} ${MESHSAMPLING_INCLUDE_DIR})