CMakeLists.txt 1.47 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 34 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
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 
  ../BasePlugin 
  ../ACGHelper 
  ../common 
  ../common/bsp  
  ../INIFile 
  ../widgets/glWidget
)

if (WIN32)
  add_definitions (
    -DPLUGINLIBDLL
  )
endif ()

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

append_files_recursive (headers "*.hh" ${CMAKE_SOURCE_DIR}/ObjectTypes)
append_files_recursive (sources "*.cc" ${CMAKE_SOURCE_DIR}/ObjectTypes)

drop_templates (sources)

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

add_library (PluginLib SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})

set_target_props (PluginLib)

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

install (TARGETS PluginLib DESTINATION ${OPENFLIPPER_LIBDIR})

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