CMakeLists.txt 3.44 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
  ../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})

Jan Möbius's avatar
   
Jan Möbius committed
50
if (WIN32)
51
52
  add_executable (OpenFlipper WIN32 ${CMAKE_CURRENT_SOURCE_DIR}/CoreApp.rc ${uic_targets} ${sources} ${headers} ${moc_targets})
  target_link_libraries (OpenFlipper ${QT_QTMAIN_LIBRARY})
Jan Möbius's avatar
Jan Möbius committed
53
54
elseif (APPLE)
  add_executable (OpenFlipper MACOSX_BUNDLE ${uic_targets} ${sources} ${headers} ${moc_targets})
Jan Möbius's avatar
   
Jan Möbius committed
55
56
57
else ()
  add_executable (OpenFlipper ${uic_targets} ${sources} ${headers} ${moc_targets})
endif ()
Jan Möbius's avatar
   
Jan Möbius committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

set_target_props (OpenFlipper)

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

Jan Möbius's avatar
Jan Möbius committed
73
74
75
76
77
78
79
80
81
82
if (APPLE)
   set_target_properties (
      OpenFlipper PROPERTIES
      RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Build"
      MACOSX_BUNDLE_INFO_STRING "ACG OpenFlipper"
      MACOSX_BUNDLE_ICON_FILE "Icons/OpenFlipper_Icon.icns"
   )
else ()
  install (TARGETS OpenFlipper DESTINATION ${OPENFLIPPER_BINDIR})
endif ()
Jan Möbius's avatar
   
Jan Möbius committed
83
84
85
86
87
88

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
Jan Möbius's avatar
   
Jan Möbius committed
89
                        ${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_BINDIR}/OpenFlipper.exe)
Jan Möbius's avatar
   
Jan Möbius committed
90
91
92
endif ()


Jan Möbius's avatar
Jan Möbius committed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Shaders" "${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Shaders")
copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Textures" "${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Textures")
copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Icons" "${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Icons")
copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Fonts" "${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Fonts")
copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Docs" "${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Docs")
copy_after_build (OpenFlipper "${CMAKE_CURRENT_SOURCE_DIR}/../Help" "${CMAKE_BINARY_DIR}/Build/${OPENFLIPPER_DATADIR}/Help")


if (NOT APPLE)
  install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/../Shaders" "${OPENFLIPPER_DATADIR}/Shaders")
  install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/../Textures" "${OPENFLIPPER_DATADIR}/Textures")
  install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/../Icons" "${OPENFLIPPER_DATADIR}/Icons")
  install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/../Fonts" "${OPENFLIPPER_DATADIR}/Fonts")
  install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/../Docs" "${OPENFLIPPER_DATADIR}/Docs")
  install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/../Help" "${OPENFLIPPER_DATADIR}/Help")
endif ()