CMakeLists.txt 4.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
include (ACGCommon)

include_directories (
  ../..
  ${CMAKE_CURRENT_SOURCE_DIR}
)

# source code directories
set (directories 
  . 
  Decimater
  Smoother
  Subdivider/Adaptive/Composite
  Subdivider/Uniform/Composite 
  Subdivider/Uniform
  Utils
Ellen Dekkers's avatar
 
Ellen Dekkers committed
17
  VDPM
18 19 20 21 22 23 24 25 26 27 28 29 30 31
)

# collect all header and source files
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})

IF(WIN32)
  acg_append_files (sources "*.c" ${directories})
ENDIF(WIN32)

if (WIN32)
  # OpenMesh has no dll exports so we have to build a static library on windows
  acg_add_library (OpenMeshTools STATIC ${sources} ${headers})
else ()
32
  acg_add_library (OpenMeshTools SHAREDANDSTATIC ${sources} ${headers})
Jan Möbius's avatar
Jan Möbius committed
33 34
  set_target_properties (OpenMeshTools PROPERTIES VERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR}
                                                SOVERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR} )
35 36 37 38
endif ()

target_link_libraries (OpenMeshTools OpenMeshCore)

39 40 41 42 43
IF( NOT WIN32 )
  target_link_libraries (OpenMeshToolsStatic OpenMeshCoreStatic)
ENDIF(NOT WIN32)

if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

if ( APPLE )
 FILE(GLOB files_install_Decimater                       "${CMAKE_CURRENT_SOURCE_DIR}/Decimater/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Decimater/*T.cc" )
 FILE(GLOB files_install_KERNEL_OSG                      "${CMAKE_CURRENT_SOURCE_DIR}/Kernel_OSG/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Kernel_OSG/*T.cc" )
 FILE(GLOB files_install_Smoother                        "${CMAKE_CURRENT_SOURCE_DIR}/Smoother/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Decimater/*T.cc" )
 FILE(GLOB files_install_Subdivider_Adaptive             "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Adaptive/Composite/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Adaptive/Composite/*T.cc" )
 FILE(GLOB files_install_Subdivider_Uniform              "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Uniform/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Uniform/*T.cc" )
 FILE(GLOB files_install_Subdivider_Uniform_Composite    "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Uniform/Composite/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Uniform/Composite/*T.cc" )
 FILE(GLOB files_install_Utils                           "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*T.cc"  "${CMAKE_CURRENT_SOURCE_DIR}/Utils/getopt.h" )
 FILE(GLOB files_install_VDPM                            "${CMAKE_CURRENT_SOURCE_DIR}/VDPM/*.hh"  "${CMAKE_CURRENT_SOURCE_DIR}/VDPM/*T.cc" )
 INSTALL(FILES ${files_install_Decimater}                       DESTINATION include/OpenMesh/Tools/Decimater )
 INSTALL(FILES ${files_install_KERNEL_OSG}                      DESTINATION include/OpenMesh/Tools/Kernel_OSG )
 INSTALL(FILES ${files_install_Smoother}                        DESTINATION include/OpenMesh/Tools/Smoother )
 INSTALL(FILES ${files_install_Subdivider_Adaptive}             DESTINATION include/OpenMesh/Tools/Subdivider/Adaptive/Composite )
 INSTALL(FILES ${files_install_Subdivider_Uniform}              DESTINATION include/OpenMesh/Tools/Subdivider/Uniform )
 INSTALL(FILES ${files_install_Subdivider_Uniform_Composite}    DESTINATION include/OpenMesh/Tools/Subdivider/Uniform/Composite )
 INSTALL(FILES ${files_install_Utils}                           DESTINATION include/OpenMesh/Tools/Utils )
 INSTALL(FILES ${files_install_VDPM}                            DESTINATION include/OpenMesh/Tools/VDPM )
endif( APPLE )


65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
# Install Header Files
install(DIRECTORY .
        DESTINATION include/OpenMesh/Tools
        FILES_MATCHING
        PATTERN "*.hh"
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE
        PATTERN "tmp" EXCLUDE
        PATTERN "Templates" EXCLUDE
        PATTERN "Debian*" EXCLUDE)

#install Template cc files (required by headers)
install(DIRECTORY .
        DESTINATION include/OpenMesh/Tools
        FILES_MATCHING
        PATTERN "*T.cc"
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE
        PATTERN "tmp" EXCLUDE
        PATTERN "Templates" EXCLUDE
        PATTERN "Debian*" EXCLUDE)
86 87 88 89

#install the config file
install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils)

90 91
endif ()

92