CMakeLists.txt 2.69 KB
Newer Older
Jan Möbius's avatar
   
Jan Möbius committed
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
include (common)

find_package (OpenGL)
find_package (GLUT)
find_package (GLEW)
ftgl ()

include_directories (
  ..
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${OPENGL_INCLUDE_DIR}
  ${GLEW_INCLUDE_DIR}
  ${GLUT_INCLUDE_DIR}
)

link_directories (
  ${GLEW_LIBRARY_DIR}
)

set (directories 
  .. 
  ../Core
  ../Logging
  ../Scripting
  ../Scripting/scriptPrototypes
  ../Scripting/scriptWrappers
  ../SimpleOpt
  ../widgets/aboutWidget 
  ../widgets/addEmptyWidget
  ../widgets/loggerWidget
  ../widgets/coreWidget 
34
  ../widgets/helpWidget
Jan Möbius's avatar
   
Jan Möbius committed
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  ../widgets/loadWidget
  ../widgets/optionsWidget
  ../widgets/PluginDialog
  ../widgets/viewModeWidget
)

append_files (headers "*.hh" ${directories})
append_files (sources "*.cc" ${directories})
append_files (ui "*.ui" ${directories})

drop_templates (sources)

qt4_autouic (uic_targets ${ui})
qt4_automoc (moc_targets ${headers})

add_executable (OpenFlipper ${uic_targets} ${sources} ${headers} ${moc_targets})

set_target_props (OpenFlipper)

target_link_libraries (OpenFlipper
  OpenMeshCore
  OpenMeshTools
  ACG
  PluginLib
  ${QT_LIBRARIES}
  ${OPENGL_LIBRARIES}
  ${GLEW_LIBRARY}
  ${GLUT_LIBRARIES}
  ${FTGL_LIBS}
)

install (TARGETS OpenFlipper DESTINATION ${OPENFLIPPER_BINDIR})

if (WIN32)
  add_custom_command (TARGET OpenFlipper POST_BUILD
                      COMMAND ${CMAKE_COMMAND} -E
                      copy_if_different 
                        ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/OpenFlipper.exe
                        ${CMAKE_BINARY_DIR}/Build)
endif ()

add_custom_command(TARGET OpenFlipper POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../Shaders ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Shaders
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../Textures ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Textures
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../Icons ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Icons
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../Fonts ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Fonts
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../Docs ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Docs
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../Help ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Help
)

install(DIRECTORY
  ${CMAKE_CURRENT_SOURCE_DIR}/../Shaders
  ${CMAKE_CURRENT_SOURCE_DIR}/../Textures
  ${CMAKE_CURRENT_SOURCE_DIR}/../Icons
  ${CMAKE_CURRENT_SOURCE_DIR}/../Fonts
  ${CMAKE_CURRENT_SOURCE_DIR}/../Docs
  ${CMAKE_CURRENT_SOURCE_DIR}/../Help
  DESTINATION ${OPENFLIPPER_DATADIR}
93
)