-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathCMakeLists.txt
41 lines (31 loc) · 1.23 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
cmake_minimum_required(VERSION 2.8)
project(LibISR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
#set(OPEN_NI_ROOT /home/carl/Work/3rdparty/OpenNI2/)
find_package(GLUT REQUIRED)
find_package(OpenGL REQUIRED)
find_package(CUDA REQUIRED)
find_package(OpenNI REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLUT_INCLUDE_DIR})
include_directories(${OpenNI_INCLUDE_DIR})
IF(MSVC_IDE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DUSING_CMAKE=1)
ELSE(MSVC_IDE)
set(CFLAGS_WARN "-Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing")
set(CMAKE_CXX_FLAGS "-fPIC -O3 -march=native ${CFLAGS_WARN} ${CMAKE_CXX_FLAGS}")
#set(CMAKE_CXX_FLAGS "-fPIC -g ${CFLAGS_WARN} ${CMAKE_CXX_FLAGS}")
ENDIF(MSVC_IDE)
if(APPLE)
set(CUDA_HOST_COMPILER /usr/bin/clang)
endif(APPLE)
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -Wno-deprecated-declarations -Wno-unused-function")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libstdc++")
ENDIF()
add_subdirectory(ORUtils)
add_subdirectory(LibISR)
add_executable(demo demo.cpp)
target_link_libraries(demo LibISR_ALL)