CMakeLists.txt
1.21 KB
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
#Specify the version being used aswell as the language
cmake_minimum_required(VERSION 2.8)
#Name your project here
project(rts-validate)
#set the module directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
#set up CUDA
find_package(CUDA)
#find OpenGL
find_package(OpenGL REQUIRED)
#find GLUT
set(GLUT_ROOT_PATH $ENV{GLUT_ROOT_PATH})
find_package(GLUT REQUIRED)
#find GLEW
find_package(GLEW REQUIRED)
#ask the user for the RTS location
set(RTS_ROOT_PATH $ENV{RTS_ROOT_PATH})
find_package(RTS REQUIRED)
#set the include directories
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
${RTS_INCLUDE_DIR}
)
#enable warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wall)
endif()
#Assign source files to the appropriate variables
file(GLOB SRC_CPP "*.cpp")
file(GLOB SRC_H "*.h")
file(GLOB SRC_CU "*.cu")
#create an executable
cuda_add_executable(rts-validate ${SRC_CPP} ${SRC_H} ${UI_H} ${SRC_CU})
#set the link libraries
target_link_libraries(rts-validate ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLEW_LIBRARY} ${CUDA_cufft_LIBRARY} ${GLUT_glut_LIBRARY})