-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
101 lines (80 loc) · 3.33 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
########################################################################
# Preamble
########################################################################
cmake_minimum_required( VERSION 3.14 )
project( GNDStk LANGUAGES CXX )
########################################################################
# Project-wide setup
########################################################################
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED YES )
option( GNDStk_unit_tests
"Compile the GNDStk unit tests and integrate with ctest" ON
)
########################################################################
# Dependencies
########################################################################
include( cmake/GNDStk_dependencies.cmake )
########################################################################
# Project targets
########################################################################
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# GNDStk : library
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
include_directories( src/ )
add_library( GNDStk INTERFACE )
target_include_directories( GNDStk INTERFACE src/ )
target_link_libraries( GNDStk
INTERFACE Log
INTERFACE catch-adapter
INTERFACE pugixml-adapter
INTERFACE nlohmann_json::nlohmann_json
)
add_executable( json2class.exe
EXCLUDE_FROM_ALL
autogen/json2class.cpp
)
target_link_libraries( json2class.exe
PRIVATE GNDStk
PRIVATE nlohmann_json::nlohmann_json
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# GNDStk : python bindings
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
include_directories( python/src/ )
pybind11_add_module( GNDStk.python
EXCLUDE_FROM_ALL
python/src/GNDStk.python.cpp
python/src/core/Node.python.cpp
python/src/Interpolation.python.cpp
python/src/GridStyle.python.cpp
python/src/v1.9/containers.python.cpp
python/src/v1.9/containers/Axis.python.cpp
python/src/v1.9/containers/Values.python.cpp
python/src/v1.9/containers/Link.python.cpp
python/src/v1.9/containers/Grid.python.cpp
python/src/v1.9/containers/Axes.python.cpp
python/src/v1.9/containers/XYs1d.python.cpp
python/src/v1.9/containers/Regions1d.python.cpp
python/src/v1.9/transport/CrossSection.python.cpp
python/src/v1.9/transport/Reaction.python.cpp
python/src/v1.9/transport/Reactions.python.cpp
python/src/v1.9/transport/ReactionSuite.python.cpp
python/src/v1.9/transport.python.cpp
python/src/v1.9/GNDS.python.cpp
)
target_link_libraries( GNDStk.python PRIVATE GNDStk )
target_compile_options( GNDStk.python PRIVATE "-fvisibility=hidden" )
set_target_properties( GNDStk.python PROPERTIES OUTPUT_NAME GNDStk )
set_target_properties( GNDStk.python PROPERTIES COMPILE_DEFINITIONS "PYBIND11" )
set_target_properties( pugixml-adapter PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties( GNDStk.python PROPERTIES POSITION_INDEPENDENT_CODE ON)
#######################################################################
# Top-level Only
#######################################################################
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
# unit testing
if( GNDStk_unit_tests )
include( cmake/unit_testing.cmake )
endif()
endif()