@@ -16,7 +16,9 @@ option(USE_XSDK_DEFAULTS "enable the XDSK v0.3.0 default configuration" NO)
16
16
#requre c++11 without extensions
17
17
set (CMAKE_CXX_STANDARD_REQUIRED ON )
18
18
set (CMAKE_CXX_EXTENSION OFF )
19
- set (CMAKE_CXX_STANDARD 11)
19
+ if (NOT ENABLE_CGNS)
20
+ set (CMAKE_CXX_STANDARD 11)
21
+ endif ()
20
22
21
23
xsdk_begin_package()
22
24
bob_begin_package()
@@ -25,12 +27,22 @@ if(USE_XSDK_DEFAULTS)
25
27
xsdk_compiler_flags()
26
28
endif ()
27
29
30
+ # require c++14
31
+ option (ENABLE_CGNS "Enable the CGNS reader: requires c++14 extensions" OFF )
32
+ message (STATUS "ENABLE_CGNS: ${ENABLE_CGNS} " )
33
+
28
34
# Set some default compiler flags that should always be used
29
35
if (NOT USE_XSDK_DEFAULTS)
30
36
bob_set_shared_libs()
31
37
bob_begin_cxx_flags()
32
38
bob_end_cxx_flags()
33
39
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} " )
40
+ if (ENABLE_CGNS) #takes precedence over SCOREC_ENABLE_CXX11
41
+ message (STATUS "enabling cxx14" )
42
+ bob_cxx14_flags()
43
+ elseif (SCOREC_ENABLE_CXX11)
44
+ bob_cxx11_flags()
45
+ endif ()
34
46
endif ()
35
47
message (STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS} " )
36
48
@@ -95,6 +107,7 @@ message(STATUS "ENABLE_SIMMETRIX: ${ENABLE_SIMMETRIX}")
95
107
option (ENABLE_OMEGA_H "Enable the Omega_h interface" OFF )
96
108
option (PUMI_USE_OMEGA_H_VERSION "Specify the Omega_h version PUMI should use" 10.0.0)
97
109
message (STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H} " )
110
+
98
111
if (ENABLE_SIMMETRIX)
99
112
add_definitions (-DHAVE_SIMMETRIX)
100
113
endif ()
@@ -121,6 +134,15 @@ if(ENABLE_OMEGA_H)
121
134
bob_public_dep(Omega_h)
122
135
endif ()
123
136
137
+ if (ENABLE_CGNS)
138
+ set (SCOREC_USE_CGNS_DEFAULT ${ENABLE_CGNS} )
139
+ bob_public_dep(CGNS)
140
+ #CGNS does not provide cmake targets :(
141
+ include_directories (SYSTEM ${CGNS_INCLUDE_DIR} )
142
+ set (SCOREC_USE_HDF5_DEFAULT ${ENABLE_CGNS} )
143
+ bob_public_dep(HDF5)
144
+ add_definitions (-DHAVE_CGNS)
145
+ endif ()
124
146
125
147
# Include the SCOREC project packages
126
148
add_subdirectory (lion)
@@ -148,7 +170,12 @@ add_subdirectory(omega_h)
148
170
# this INTERFACE target bundles all the enabled libraries together
149
171
add_library (core INTERFACE )
150
172
target_link_libraries (core INTERFACE ${SCOREC_EXPORTED_TARGETS} )
151
- target_compile_features (core INTERFACE cxx_std_11)
173
+ if (ENABLE_CGNS)
174
+ target_link_libraries (core INTERFACE ${CMAKE_DL_LIBS} ) #HDF5 uses dlopen
175
+ target_compile_features (core INTERFACE cxx_std_14)
176
+ else ()
177
+ target_compile_features (core INTERFACE cxx_std_11)
178
+ endif ()
152
179
scorec_export_library(core)
153
180
154
181
#check for mallinfo2
0 commit comments