Blame view

CMakeLists.txt 2.18 KB
ee96a02c   David Mayerich   first commit from...
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
71
72
  #Specify the version being used aswell as the language
  cmake_minimum_required(VERSION 2.8)
  #Name your project here
  project(TrueEyes)
  
  #set the module directory
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
  
  #find the Qt4
  find_package(Qt4 REQUIRED)
  include_directories(${QT_INCLUDE_DIRECTORY})
  include(${QT_USE_FILE})
  
  #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)
  
  #add Qt OpenGL stuff
  set(QT_USE_QTOPENGL TRUE)
  
  #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}
  	${QT_INCLUDES}
  	${QT_QTOPENGL_INCLUDE_DIR}
  	${OPENGL_INCLUDE_DIR}
  	${GLEW_INCLUDE_PATH}
  	${GLUT_INCLUDE_DIR}
  	${RTS_INCLUDE_DIR}
  )
  
  #set up copying data files
  configure_file(fragPrefix.glsl ${CMAKE_CURRENT_BINARY_DIR}/fragPrefix.glsl @ONLY)
  configure_file(fragPostfix.glsl ${CMAKE_CURRENT_BINARY_DIR}/fragPostfix.glsl @ONLY)
  configure_file(fragRayCast.glsl ${CMAKE_CURRENT_BINARY_DIR}/fragRayCast.glsl @ONLY)
  #configure_file(example/genus.tep ${CMAKE_CURRENT_BINARY_DIR}/example/genus.tep @ONLY)
  #configure_file(example/gradient.glsl ${CMAKE_CURRENT_BINARY_DIR}/example/gradient.glsl @ONLY)
  #configure_file(example/intensity.glsl ${CMAKE_CURRENT_BINARY_DIR}/example/intensity.glsl @ONLY)
  #configure_file(example/high_genus_512_512_512.raw ${CMAKE_CURRENT_BINARY_DIR}/example/high_genus_512_512_512.raw @ONLY)
  
  #Assign source files to the appropriate variables
  file(GLOB SRC_CPP "*.cpp")
  file(GLOB SRC_H "*.h")
  file(GLOB SRC_UI "*.ui")
  file(GLOB SRC_QRC "*.qrc")
  
  #determine which source files have to be moc'd
  Qt4_wrap_cpp(UI_MOC ${SRC_H})
  Qt4_wrap_ui(UI_H ${SRC_UI})
  Qt4_add_resources(ALL_RCC ${ALL_QRC})
  
  #moc the necessary files
  Qt4_automoc(${ALL_CPP})
  
  source_group(QtMoc FILES ${UI_MOC})
  source_group(QtUI FILES ${SRC_UI})
  
  #create an executable
  add_executable(TrueEyes ${SRC_CPP} ${SRC_H} ${UI_H} ${UI_MOC} ${ALL_RCC})
  
  #set the link libraries
  target_link_libraries(TrueEyes ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLEW_LIBRARY} ${GLUT_glut_LIBRARY})