CMakeLists.txt 2.21 KB
Newer Older
1
include (ACGCommon)
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 ()

20 21
include_directories (
  ..
22
  ${CMAKE_SOURCE_DIR}/OpenMesh/src
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}
30 31 32 33 34 35
)

link_directories (
  ${GLEW_LIBRARY_DIR}
)

Jan Möbius's avatar
Jan Möbius committed
36
# source code directories
37 38 39 40
set (directories 
  ../BasePlugin 
  ../ACGHelper 
  ../common 
41
  ../threads
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
48 49 50 51 52 53
if (WIN32)
  add_definitions (
    -DPLUGINLIBDLL
  )
endif ()

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

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

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

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

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

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}
)
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

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}
96
)