CMakeLists.txt 2.01 KB
Newer Older
Mike Kremer's avatar
Mike Kremer committed
1 2 3 4 5 6 7 8 9
include (ACGCommon)

include_directories (
  ..
  ${CMAKE_CURRENT_SOURCE_DIR}
)

# source code directories
set (directories 
Mike Kremer's avatar
Mike Kremer committed
10
  .
11
  OpenVolumeMesh/Core
Mike Kremer's avatar
Mike Kremer committed
12
  OpenVolumeMesh/FileManager
13 14 15 16 17
  OpenVolumeMesh/Geometry
  OpenVolumeMesh/PolyhedralMesh
  OpenVolumeMesh/PolyhedralMesh/Utils
  OpenVolumeMesh/HexahedralMesh
  OpenVolumeMesh/HexahedralMesh/Utils
Mike Kremer's avatar
Mike Kremer committed
18 19 20 21 22 23 24 25 26 27 28 29
)

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

# 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)
Mike Kremer's avatar
Mike Kremer committed
30 31
    # OpenVolumeMesh has no dll exports so we have to build a static library on windows
    acg_add_library (OpenVolumeMesh STATIC ${sources} ${headers})
Mike Kremer's avatar
Mike Kremer committed
32 33 34
else ()
    acg_add_library (OpenVolumeMesh SHAREDANDSTATIC ${sources} ${headers})
    set_target_properties (OpenVolumeMesh PROPERTIES VERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR}
Mike Kremer's avatar
Mike Kremer committed
35
                                          SOVERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR} )
Mike Kremer's avatar
Mike Kremer committed
36 37 38 39 40 41 42
endif ()

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

# Install Header Files)
install(DIRECTORY . 
43
	DESTINATION include
Mike Kremer's avatar
Mike Kremer committed
44 45
        FILES_MATCHING 
	PATTERN "*.hh"
46
        PATTERN "Unittests" EXCLUDE
Mike Kremer's avatar
Mike Kremer committed
47 48 49 50 51 52 53 54
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE
        PATTERN "tmp" EXCLUDE
	PATTERN "Templates" EXCLUDE
        PATTERN "Debian*" EXCLUDE)

#install Template cc files (required by headers)
install(DIRECTORY . 
55
	DESTINATION include
Mike Kremer's avatar
Mike Kremer committed
56 57
        FILES_MATCHING 
	PATTERN "*T.cc"
58
        PATTERN "Unittests" EXCLUDE
Mike Kremer's avatar
Mike Kremer committed
59 60 61 62 63 64 65 66
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE
	PATTERN "tmp" EXCLUDE
	PATTERN "Templates" EXCLUDE
        PATTERN "Debian*" EXCLUDE)

endif ()

67 68 69
# Add unittests target
add_subdirectory(Unittests)

Mike Kremer's avatar
Mike Kremer committed
70