CMakeLists.txt 2.59 KB
Newer Older
1 2 3 4 5 6
cmake_minimum_required (VERSION 2.6)

project (OpenMesh)

# add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
7
set (CMAKE_DEBUG_POSTFIX "d")
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

# include our cmake files
include (ACGCommon)

acg_get_version ()

include(OpenMeshPackage)
include (ACGOutput)

if (WIN32)
  add_definitions(
      -D_USE_MATH_DEFINES -DNOMINMAX
  )
endif ()

Jan Möbius's avatar
Jan Möbius committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
# ========================================================================
# Add bundle targets here
# ========================================================================
if (WIN32)
  add_custom_target (fixbundle ALL
    COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.win.cmake" )
endif()

if (APPLE)
  add_custom_target (fixbundle ALL
    COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake"
  )
endif()

# ========================================================================
# Call the subdirectories with there projects
# ========================================================================

41 42 43 44 45 46
add_subdirectory (src/OpenMesh/Core)
add_subdirectory (src/OpenMesh/Tools)
add_subdirectory (src/OpenMesh/Apps)
add_subdirectory (Doc)

# ========================================================================
Jan Möbius's avatar
Jan Möbius committed
47
# Bundle generation (Targets exist, now configure them)
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
# ========================================================================

if (WIN32 )
  # prepare bundle generation cmake file and add a build target for it
  configure_file ("${CMAKE_SOURCE_DIR}/cmake/fixbundle.cmake.win.in"
     "${CMAKE_BINARY_DIR}/fixbundle.win.cmake" @ONLY IMMEDIATE)

  # let bundle generation depend on all targets
  add_dependencies (fixbundle QtViewer DecimaterGui)
 
endif(WIN32)


if (APPLE)
  # prepare bundle generation cmake file and add a build target for it
  configure_file ("${CMAKE_SOURCE_DIR}/cmake/fixbundle.cmake.in"
     "${CMAKE_BINARY_DIR}/fixbundle.cmake" @ONLY IMMEDIATE)
Jan Möbius's avatar
Jan Möbius committed
65

66
  # let bundle generation depend on all targets
67
  add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui) 
68

69 70 71 72 73 74 75 76

  # Required for Snow leopard, and the latest qt. Then the resources have to be copied
  if ( EXISTS "/opt/local/libexec/qt4-mac/lib/QtGui.framework/Versions/4/Resources/qt_menu.nib" )
      add_custom_command(TARGET OpenMesh POST_BUILD
         COMMAND ${CMAKE_COMMAND} -E copy_directory "/opt/local/libexec/qt4-mac/lib/QtGui.framework/Versions/4/Resources/qt_menu.nib" "${CMAKE_BINARY_DIR}/Build/Libraries/qt_menu.nib" 
        )
  endif ()
  
77 78 79 80 81 82 83
endif ()

# ========================================================================


# display results
acg_print_configure_header (OPENMESH "OpenMesh")