CMakeLists.txt 1.99 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
3
4

include_directories (
  ..
Jan Möbius's avatar
   
Jan Möbius committed
5
  ${CMAKE_SOURCE_DIR}/OpenMesh/src
Jan Möbius's avatar
   
Jan Möbius committed
6
7
8
9
10
11
12
13
14
15
16
17
  ${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}
)

Jan Möbius's avatar
Jan Möbius committed
18
# source code directories
Jan Möbius's avatar
   
Jan Möbius committed
19
20
21
22
set (directories 
  ../BasePlugin 
  ../ACGHelper 
  ../common 
23
  ../threads
Jan Möbius's avatar
   
Jan Möbius committed
24
25
26
27
28
  ../common/bsp  
  ../INIFile 
  ../widgets/glWidget
)

Jan Möbius's avatar
Jan Möbius committed
29
# generate dllexport macros on windows
Jan Möbius's avatar
   
Jan Möbius committed
30
31
32
33
34
35
if (WIN32)
  add_definitions (
    -DPLUGINLIBDLL
  )
endif ()

Jan Möbius's avatar
   
Jan Möbius committed
36
37
# define core version
add_definitions (
Jan Möbius's avatar
Jan Möbius committed
38
    -DCORE_VERSION="${OPENFLIPPER_VERSION}"
Jan Möbius's avatar
   
Jan Möbius committed
39
40
)

Jan Möbius's avatar
Jan Möbius committed
41
# collect all header,source and ui files
Jan Möbius's avatar
   
Jan Möbius committed
42
43
44
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
45

Jan Möbius's avatar
Jan Möbius committed
46
# add additional object type sources
Jan Möbius's avatar
   
Jan Möbius committed
47
48
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
49

50
51
52
53
54
55
56
57
58
set ( ADDITIONAL_PLUGINLIB_LIBS "")

# 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"
)

59
# include all cmake files fouund for objecttypes here
60
61
62
63
foreach ( _buildInfo ${_plugin_buildinfos})
  include ("${CMAKE_SOURCE_DIR}/${_buildInfo}")
endforeach ()
  
Jan Möbius's avatar
Jan Möbius committed
64
# remove template cc files from source file list
Jan Möbius's avatar
   
Jan Möbius committed
65
acg_drop_templates (sources)
Jan Möbius's avatar
   
Jan Möbius committed
66

Jan Möbius's avatar
Jan Möbius committed
67
# genereate uic and moc targets
Jan Möbius's avatar
   
Jan Möbius committed
68
69
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
Jan Möbius's avatar
   
Jan Möbius committed
70

Jan Möbius's avatar
   
Jan Möbius committed
71
acg_add_library (PluginLib SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
Jan Möbius's avatar
   
Jan Möbius committed
72

Jan Möbius's avatar
Jan Möbius committed
73
74
75
76
set (trans_files ${sources})
list (APPEND trans_files ${ui})
list (APPEND trans_files ${headers})
acg_add_translations (PluginLib "de_DE" "${trans_files}")
77

Jan Möbius's avatar
   
Jan Möbius committed
78
79
80
81
82
83
84
85
86
target_link_libraries (PluginLib
  OpenMeshCore
  OpenMeshTools
  ACG
  ${QT_LIBRARIES}
  ${OPENGL_LIBRARIES}
  ${GLEW_LIBRARY}
  ${GLUT_LIBRARIES}
  ${FTGL_LIBS}
87
  ${ADDITIONAL_PLUGINLIB_LIBS}
Jan Möbius's avatar
   
Jan Möbius committed
88
)