CMakeLists.txt
1.58 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#Specify the version being used aswell as the language
cmake_minimum_required(VERSION 2.8)
#Name your project here
project(Texture_Test)
#set the module directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
#MESSAGE("CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR})
#MESSAGE("CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH})
#find cuda
find_package(CUDA REQUIRED)
#find glut
find_package(GLUT REQUIRED)
#find glew
find_package(GLEW REQUIRED)
#find OpenGL
find_package(OpenGL REQUIRED)
#find Jpeg
find_package(JPEG REQUIRED)
#find BOOST - particularly the filesystem libraries
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.5.0 COMPONENTS filesystem system regex REQUIRED)
#find the pthreads package
find_package(Threads)
#find the X11 package
find_package(X11)
#include directories
include_directories(${CUDA_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${GLEW_INCLUDE_PATH}
${GLUT_INCLUDE_DIRS}
${JPEG_INCLUDE_DIRS}
)
#link_directories(${GLUT_LIBRARY_DIRS} ${OpenGL_LIBRARY_DIRS})
#add_definitions(${GLUT_DEFINITIONS} ${OpenGL_DEFINITIONS})
#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 file
cuda_add_executable(Texture_Test
${SRC_H}
${SRC_CPP}
${SRC_CU})
#set the link libraries
target_link_libraries(Texture_Test
${CMAKE_THREAD_LIBS_INIT}
${X11_LIBRARIES}
${Boost_LIBRARIES}
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLEW_LIBRARY}
${GLUT_glut_LIBRARY}
${JPEG_LIBRARY}
)