CMakeLists.txt 1.64 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
include(ACGCommon)

include_directories (
  ..
  ${ACG_INCLUDE_DIR}
  ${OPENMESH_INCLUDE_DIRS}
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${OPENGL_INCLUDE_DIR}
  ${GLEW_INCLUDE_DIR}
  ${GLUT_INCLUDE_DIR}
)

link_directories (
  ${GLEW_LIBRARY_DIR}
  ${ADDITIONAL_PLUGINLIB_LINK_DIRS}
)

#=======================================================
# General defines
#=======================================================

# generate dllexport macros on windows
if (WIN32)
  add_definitions (
26
    -DPLUGINLIBDLL    
Jan's avatar
Jan committed
27
    -DUSEPLUGINLIBDLL
28
    -DBUILDOBJECTTYPEDLL
Jan Möbius's avatar
Jan Möbius committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    -DACGDLL
    -DUSEACG
  )
endif ()

#=======================================================
# Cleanup
#=======================================================

# remove template cc files from source file list
acg_drop_templates (sources)



# collect all header,source files
acg_append_files (headers "*.hh" . )
acg_append_files (sources "*.cc" . )
Jan Möbius's avatar
Jan Möbius committed
46
acg_qt5_automoc (moc_targets ${headers})
Jan Möbius's avatar
Jan Möbius committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

# Match our current directory name
string (REGEX MATCH "[^/\\]*$" TYPENAME ${CMAKE_CURRENT_SOURCE_DIR})
string(TOUPPER ${TYPENAME} TYPENAME )

include_directories (
  ..
  ${ACG_INCLUDE_DIR}
  ${OPENMESH_INCLUDE_DIRS}
  ${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
64
acg_add_library ( ${TYPENAME} SHARED ${sources} ${headers} ${moc_targets} )
Jan Möbius's avatar
Jan Möbius committed
65 66 67 68 69 70 71 72 73 74 75

add_dependencies( ${TYPENAME} OpenMeshCore OpenMeshTools ACG OpenFlipperPluginLib)


target_link_libraries (${TYPENAME}
  ${OPENMESH_LIBRARIES}
  ACG
  ${QT_LIBRARIES}
  ${OPENGL_LIBRARIES}
  ${GLEW_LIBRARY}
  ${GLUT_LIBRARIES}
76
  OpenFlipperPluginLib
Jan Möbius's avatar
Jan Möbius committed
77 78
)