CMakeLists.txt 2.21 KB
Newer Older
Jan Möbius's avatar
   
Jan Möbius committed
1
include (ACGCommon)
Jan Möbius's avatar
   
Jan Möbius committed
2

Jan Möbius's avatar
Jan Möbius committed
3
4
5

set ( ADDITIONAL_PLUGINLIB_LIBS "")
set ( ADDITIONAL_PLUGINLIB_INCS "")
6
set ( ADDITIONAL_PLUGINLIB_COMPILER_FLAGS "")
Jan Möbius's avatar
Jan Möbius committed
7
8
9
10
11
12
13
14
15
16
17
18
19

# search all ObjectTypes in the ObjectType directory for additional build information
file (
  GLOB _plugin_buildinfos
  RELATIVE "${CMAKE_SOURCE_DIR}"
  "${CMAKE_SOURCE_DIR}/ObjectTypes/*/CMakeLists.txt"
)

# include all cmake files fouund for objecttypes here
foreach ( _buildInfo ${_plugin_buildinfos})
  include ("${CMAKE_SOURCE_DIR}/${_buildInfo}")
endforeach ()

Jan Möbius's avatar
   
Jan Möbius committed
20
21
include_directories (
  ..
Jan Möbius's avatar
   
Jan Möbius committed
22
  ${CMAKE_SOURCE_DIR}/OpenMesh/src
Jan Möbius's avatar
   
Jan Möbius committed
23
24
25
26
27
28
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${OPENGL_INCLUDE_DIR}
  ${GLEW_INCLUDE_DIR}
  ${GLUT_INCLUDE_DIR}
Jan Möbius's avatar
Jan Möbius committed
29
  ${ADDITIONAL_PLUGINLIB_INCS}
Jan Möbius's avatar
   
Jan Möbius committed
30
31
32
33
34
35
)

link_directories (
  ${GLEW_LIBRARY_DIR}
)

Jan Möbius's avatar
Jan Möbius committed
36
# source code directories
Jan Möbius's avatar
   
Jan Möbius committed
37
38
39
40
set (directories 
  ../BasePlugin 
  ../ACGHelper 
  ../common 
41
  ../threads
Jan Möbius's avatar
   
Jan Möbius committed
42
43
44
45
46
  ../common/bsp  
  ../INIFile 
  ../widgets/glWidget
)

Jan Möbius's avatar
Jan Möbius committed
47
# generate dllexport macros on windows
Jan Möbius's avatar
   
Jan Möbius committed
48
49
50
51
52
53
if (WIN32)
  add_definitions (
    -DPLUGINLIBDLL
  )
endif ()

Jan Möbius's avatar
   
Jan Möbius committed
54
55
# define core version
add_definitions (
Jan Möbius's avatar
Jan Möbius committed
56
    -DCORE_VERSION="${OPENFLIPPER_VERSION}"
Jan Möbius's avatar
   
Jan Möbius committed
57
58
)

Jan Möbius's avatar
Jan Möbius committed
59
# collect all header,source and ui files
Jan Möbius's avatar
   
Jan Möbius committed
60
61
62
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})
acg_append_files (ui "*.ui" ${directories})
Jan Möbius's avatar
   
Jan Möbius committed
63

Jan Möbius's avatar
Jan Möbius committed
64
# add additional object type sources
Jan Möbius's avatar
   
Jan Möbius committed
65
66
acg_append_files_recursive (headers "*.hh" ${CMAKE_SOURCE_DIR}/ObjectTypes)
acg_append_files_recursive (sources "*.cc" ${CMAKE_SOURCE_DIR}/ObjectTypes)
Jan Möbius's avatar
   
Jan Möbius committed
67

Jan Möbius's avatar
Jan Möbius committed
68
# remove template cc files from source file list
Jan Möbius's avatar
   
Jan Möbius committed
69
acg_drop_templates (sources)
Jan Möbius's avatar
   
Jan Möbius committed
70

Jan Möbius's avatar
Jan Möbius committed
71
# genereate uic and moc targets
Jan Möbius's avatar
   
Jan Möbius committed
72
73
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
Jan Möbius's avatar
   
Jan Möbius committed
74

Jan Möbius's avatar
   
Jan Möbius committed
75
acg_add_library (PluginLib SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
76
set_target_properties (
Jan Möbius's avatar
Jan Möbius committed
77
  PluginLib PROPERTIES 
78
79
  COMPILE_FLAGS ${ADDITIONAL_PLUGINLIB_COMPILER_FLAGS}
)
Jan Möbius's avatar
   
Jan Möbius committed
80

Jan Möbius's avatar
Jan Möbius committed
81
82
83
84
set (trans_files ${sources})
list (APPEND trans_files ${ui})
list (APPEND trans_files ${headers})
acg_add_translations (PluginLib "de_DE" "${trans_files}")
85

Jan Möbius's avatar
   
Jan Möbius committed
86
87
88
89
90
91
92
93
94
target_link_libraries (PluginLib
  OpenMeshCore
  OpenMeshTools
  ACG
  ${QT_LIBRARIES}
  ${OPENGL_LIBRARIES}
  ${GLEW_LIBRARY}
  ${GLUT_LIBRARIES}
  ${FTGL_LIBS}
95
  ${ADDITIONAL_PLUGINLIB_LIBS}
Jan Möbius's avatar
   
Jan Möbius committed
96
)