CMakeLists.txt 2.31 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
include (ACGCommon)

include_directories (
  ..
  ${CMAKE_CURRENT_SOURCE_DIR}
)

# source code directories
set (directories 
  .
  OpenVolumeMesh/Attribs
  OpenVolumeMesh/Core
  OpenVolumeMesh/FileManager
  OpenVolumeMesh/Geometry
  OpenVolumeMesh/Mesh
)

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

Jan Möbius's avatar
Jan Möbius committed
22
23
24
# Don't build template cc files as they only contain templates
acg_drop_templates(sources)

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Disable Library installation when not building OpenVolumeMesh on its own but as part of another project!
if ( NOT ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
  set(ACG_NO_LIBRARY_INSTALL true)
endif()

if (WIN32)
    # OpenVolumeMesh has no dll exports so we have to build a static library on windows
    acg_add_library (OpenVolumeMesh STATIC ${sources} ${headers})
else ()
    acg_add_library (OpenVolumeMesh SHAREDANDSTATIC ${sources} ${headers})
    set_target_properties (OpenVolumeMesh PROPERTIES VERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR}
                                          SOVERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR} )
endif ()

# Only install if the project name matches OpenVolumeMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenVolumeMesh")

# Install Header Files)
install(DIRECTORY . 
44
        DESTINATION include
45
        FILES_MATCHING 
46
        PATTERN "*.hh"
47
        PATTERN "Unittests" EXCLUDE
48
        PATTERN "FileConverter" EXCLUDE
49
50
51
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE
        PATTERN "tmp" EXCLUDE
52
        PATTERN "Templates" EXCLUDE
53
54
55
56
        PATTERN "Debian*" EXCLUDE)

#install Template cc files (required by headers)
install(DIRECTORY . 
57
        DESTINATION include
58
        FILES_MATCHING 
59
        PATTERN "*T.cc"
60
        PATTERN "Unittests" EXCLUDE
61
        PATTERN "FileConverter" EXCLUDE
62
63
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE
64
65
        PATTERN "tmp" EXCLUDE
        PATTERN "Templates" EXCLUDE
66
67
68
69
        PATTERN "Debian*" EXCLUDE)

endif ()

70
71
# Only build unittests and file converter
# if not built as external library
72
73
74
if(${PROJECT_NAME} MATCHES "OpenVolumeMesh")
    # Add unittests target
    add_subdirectory(Unittests)
75
    add_subdirectory(FileConverter)
76
endif()