-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
45 lines (38 loc) · 1.55 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
cmake_minimum_required(VERSION 2.8)
project(VDRender)
#SET (CMAKE_VERBOSE_MAKEFILE 1)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
include_directories(${GLFW_INCLUDE_DIRS})
link_libraries(${GLFW_LIBRARIES})
find_package(GLEW REQUIRED)
find_package(CUDA QUIET REQUIRED)
include_directories(kernels utility)
if (GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIRS})
link_libraries(${GLEW_LIBRARIES})
else ()
message(FATAL_ERROR "GLEW NOT FOUND")
endif()
set (ARGS_USER_SYSTEM "")
macro(CUDA_INCLUDE_DIRECTORIES_SYSTEM)
foreach(dir ${ARGN})
set(ARGS_USER_SYSTEM "${ARGS_USER_SYSTEM} -isystem '${CMAKE_CURRENT_SOURCE_DIR}/${dir}'")
endforeach()
endmacro()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
include_directories(SYSTEM "extern")
include_directories(SYSTEM "extern/cub")
CUDA_INCLUDE_DIRECTORIES_SYSTEM("extern/cub")
CUDA_INCLUDE_DIRECTORIES_SYSTEM("extern/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra")
set(CUDA_NVCC_FLAGS "-O3 -gencode=arch=compute_20,code=sm_20 -Xcompiler \"${ARGS_USER_SYSTEM}\"")
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/extern/opennurbs)
file(GLOB_RECURSE SRC_CUDA "src/*.cu" "src/*.cuh")
#aux_source_directory("src/" SRC_LIST)
file(GLOB_RECURSE UTIL_SOURCES "src/*.cpp")
file(GLOB_RECURSE UTIL_HEADERS "src/*.h")
CUDA_ADD_EXECUTABLE(${PROJECT_NAME} ${UTIL_SOURCES} ${UTIL_HEADERS} ${SRC_CUDA})
target_link_libraries(${PROJECT_NAME} GL GLU GLEW glfw ${CUDA_LIBRARIES} Threads::Threads ${CMAKE_DL_LIBS} rt)