-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
57 lines (39 loc) · 1.77 KB
/
CMakeLists.txt
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
CMAKE_MINIMUM_REQUIRED ( VERSION 2.8 )
PROJECT ( houio )
set( HOUIO_VERSION 0.1 )
set(CMAKE_DEBUG_POSTFIX "d")
INCLUDE_DIRECTORIES ( include )
ADD_LIBRARY ( houio STATIC
src/Attribute.cpp
src/Field.cpp
src/math/Color.cpp
src/math/Math.cpp
src/json.cpp
src/HouGeoAdapter.cpp
src/HouGeo.cpp
src/HouGeoIO.cpp
src/Geometry.cpp
)
# trigger cxx standard (c++11)
set_property(TARGET houio PROPERTY CXX_STANDARD 11)
add_subdirectory ( tests )
# install target (the lib file) and register the target in export set ---
install( TARGETS houio DESTINATION lib EXPORT houio-targets )
# copy header files
install( DIRECTORY include DESTINATION . )
# location of cmake config files in binary tree
set(ConfigPackageLocation lib/cmake/houio)
include(CMakePackageConfigHelpers)
# create version config file ---
write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/houio/houio-config-version.cmake" VERSION ${HOUIO_VERSION} COMPATIBILITY AnyNewerVersion )
# export targets (which have been defined during previous calls to install)
export(EXPORT houio-targets FILE "${CMAKE_CURRENT_BINARY_DIR}/houio/houio-targets.cmake" NAMESPACE Upstream:: )
# install houio-targets cmake file ---
install( EXPORT houio-targets DESTINATION ${ConfigPackageLocation} )
# install version and config package file ---
install( FILES cmake/houio-config.cmake "${CMAKE_CURRENT_BINARY_DIR}/houio/houio-config-version.cmake" DESTINATION ${ConfigPackageLocation} COMPONENT Devel )
# for the final config file you can also use configure_file to replace some variables and move it into place
# create final package config file (by copying from source-tree)
#configure_file(cmake/houio-config.cmake "${CMAKE_CURRENT_BINARY_DIR}/houio/houio-config.cmake" COPYONLY )
# tests -----------
add_subdirectory( tests )