-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
555 lines (501 loc) · 19.6 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
cmake_minimum_required(VERSION 2.8)
project(H5FDdsm C CXX)
#-----------------------------------------------------------------------------
# Variable naming convention
#-----------------------------------------------------------------------------
# Inside CMakeLists files for the project, variable names use H5FDdsm_XXX
#
#-----------------------------------------------------------------------------
# Version information
#-----------------------------------------------------------------------------
set(H5FDdsm_VERS_MAJOR "0")
set(H5FDdsm_VERS_MINOR "9")
set(H5FDdsm_VERS_RELEASE "9")
set(H5FDdsm_PACKAGE "h5fddsm")
set(H5FDdsm_PACKAGE_NAME "H5FDdsm")
set(H5FDdsm_PACKAGE_VERSION "${H5FDdsm_VERS_MAJOR}.${H5FDdsm_VERS_MINOR}.${H5FDdsm_VERS_RELEASE}")
set(H5FDdsm_PACKAGE_VERSION_MAJOR "${H5FDdsm_VERS_MAJOR}.${H5FDdsm_VERS_MINOR}")
set(H5FDdsm_PACKAGE_VERSION_MINOR "${H5FDdsm_VERS_RELEASE}")
set(H5FDdsm_PACKAGE_STRING "${H5FDdsm_PACKAGE_NAME} ${H5FDdsm_PACKAGE_VERSION}")
set(H5FDdsm_PACKAGE_TARNAME "h5fddsm")
#-----------------------------------------------------------------------------
# Setup install and output Directories
#-----------------------------------------------------------------------------
if(NOT H5FDdsm_INSTALL_BIN_DIR)
set(H5FDdsm_INSTALL_BIN_DIR bin)
endif(NOT H5FDdsm_INSTALL_BIN_DIR)
if(NOT H5FDdsm_INSTALL_LIB_DIR)
set(H5FDdsm_INSTALL_LIB_DIR lib)
endif(NOT H5FDdsm_INSTALL_LIB_DIR)
if(NOT H5FDdsm_INSTALL_INCLUDE_DIR)
set(H5FDdsm_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
endif(NOT H5FDdsm_INSTALL_INCLUDE_DIR)
if(NOT H5FDdsm_INSTALL_DATA_DIR)
set(H5FDdsm_INSTALL_DATA_DIR share)
endif(NOT H5FDdsm_INSTALL_DATA_DIR)
if(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables."
)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries"
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries."
)
set(CMAKE_Fortran_MODULE_DIRECTORY
${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules."
)
set(H5FDdsm_LIB_DEPENDENCIES
hdf5
)
endif(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
#-----------------------------------------------------------------------------
# Targets built within this project are exported at Install time for use
# by other projects using FindH5FDdsm.
#-----------------------------------------------------------------------------
if(NOT H5FDdsm_EXPORTED_TARGETS)
set(H5FDdsm_EXPORTED_TARGETS "H5FDdsm-targets")
endif(NOT H5FDdsm_EXPORTED_TARGETS)
#-----------------------------------------------------------------------------
# Choose static or shared libraries.
#-----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build with shared libraries." OFF)
# Set unique var used in the autogenerated config file (symbol import/export)
if(BUILD_SHARED_LIBS)
set(H5FDdsm_BUILD_SHARED_LIBS 1)
set(H5FDdsm_LIBTYPE SHARED)
else(BUILD_SHARED_LIBS)
set(H5FDdsm_BUILD_SHARED_LIBS 0)
set(H5FDdsm_LIBTYPE STATIC)
endif(BUILD_SHARED_LIBS)
#-----------------------------------------------------------------------------
# Choose to enable global debug or not.
#-----------------------------------------------------------------------------
option(H5FDdsm_DEBUG_GLOBAL "Turn on all debug messages." OFF)
#-----------------------------------------------------------------------------
# Choose to enable global debug or not.
#-----------------------------------------------------------------------------
set(H5FDdsm_DEBUG_LEVEL "1" CACHE STRING "Level of printing for debug messages.")
#-----------------------------------------------------------------------------
# Choose to enable coverage or not.
#-----------------------------------------------------------------------------
option(H5FDdsm_ENABLE_COVERAGE "Enable coverage." OFF)
if(H5FDdsm_ENABLE_COVERAGE)
set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage" CACHE STRING
"Flags to the coverage program that CTest uses for performing coverage inspection"
)
mark_as_advanced(COVERAGE_FLAGS)
endif(H5FDdsm_ENABLE_COVERAGE)
macro(set_coverage_flags target)
set_target_properties(${target}
PROPERTIES
COMPILE_FLAGS ${COVERAGE_FLAGS}
LINK_FLAGS ${COVERAGE_FLAGS}
)
endmacro(set_coverage_flags)
#-----------------------------------------------------------------------------
# Choose to build steering API or not.
#-----------------------------------------------------------------------------
option(H5FDdsm_BUILD_STEERING "Build H5FDdsm steering functionalities." OFF)
if(H5FDdsm_BUILD_STEERING)
set(H5FDdsm_HAVE_STEERING TRUE)
endif(H5FDdsm_BUILD_STEERING)
#-----------------------------------------------------------------------------
# Choose to build steering API or not.
#-----------------------------------------------------------------------------
option(H5FDdsm_BUILD_TOOLS "Build H5FDdsm tools." ON)
if(H5FDdsm_BUILD_TOOLS)
set(H5FDdsm_HAVE_TOOLS TRUE)
endif(H5FDdsm_BUILD_TOOLS)
#-----------------------------------------------------------------------------
# Choose to build CRAY DMAPP/UGNI communicators or not.
#-----------------------------------------------------------------------------
option(H5FDdsm_USE_CRAY_DMAPP "Use Cray DMAPP inter-communicator." OFF)
if(H5FDdsm_USE_CRAY_DMAPP)
#
find_path(CRAY_UGNI_INCLUDE_DIR gni_pub.h)
if(CRAY_UGNI_INCLUDE_DIR)
include_directories(${CRAY_UGNI_INCLUDE_DIR})
endif(CRAY_UGNI_INCLUDE_DIR)
#
find_path(CRAY_DMAPP_INCLUDE_DIR dmapp.h)
if(CRAY_DMAPP_INCLUDE_DIR)
include_directories(${CRAY_DMAPP_INCLUDE_DIR})
endif(CRAY_DMAPP_INCLUDE_DIR)
#
find_library(CRAY_DMAPP_LIBRARY NAMES dmapp)
if(CRAY_DMAPP_LIBRARY)
set(H5FDdsm_LIB_DEPENDENCIES ${H5FDdsm_LIB_DEPENDENCIES} ${CRAY_DMAPP_LIBRARY})
endif(CRAY_DMAPP_LIBRARY)
#
if(CRAY_UGNI_INCLUDE_DIR AND CRAY_DMAPP_INCLUDE_DIR AND CRAY_DMAPP_LIBRARY)
set(H5FDdsm_HAVE_DMAPP TRUE)
endif(CRAY_UGNI_INCLUDE_DIR AND CRAY_DMAPP_INCLUDE_DIR AND CRAY_DMAPP_LIBRARY)
#
endif(H5FDdsm_USE_CRAY_DMAPP)
#
option(H5FDdsm_USE_CRAY_UGNI "Use Cray UGNI inter-communicator." OFF)
if(H5FDdsm_USE_CRAY_UGNI)
#
find_path(CRAY_UGNI_INCLUDE_DIR gni_pub.h)
if(CRAY_UGNI_INCLUDE_DIR)
include_directories(${CRAY_UGNI_INCLUDE_DIR})
endif(CRAY_UGNI_INCLUDE_DIR)
#
find_path(CRAY_LIBONESIDED_INTEROP_INCLUDE_DIR gni_libonesided_interop.h)
if(CRAY_LIBONESIDED_INTEROP_INCLUDE_DIR)
include_directories(${CRAY_LIBONESIDED_INTEROP_INCLUDE_DIR})
endif(CRAY_LIBONESIDED_INTEROP_INCLUDE_DIR)
#
if(CRAY_UGNI_INCLUDE_DIR AND CRAY_LIBONESIDED_INTEROP_INCLUDE_DIR)
set(H5FDdsm_HAVE_UGNI TRUE)
endif(CRAY_UGNI_INCLUDE_DIR AND CRAY_LIBONESIDED_INTEROP_INCLUDE_DIR)
#
endif(H5FDdsm_USE_CRAY_UGNI)
#-------------------------------------------------------------------------------
macro(set_lib_options libtarget libname libtype)
if(${libtype} MATCHES "SHARED")
if(WIN32 AND NOT MINGW)
set(LIB_RELEASE_NAME "${libname}")
set(LIB_DEBUG_NAME "${libname}_D")
set(LIB_DSM_VERSION ${H5FDdsm_PACKAGE_VERSION_MAJOR})
else(WIN32 AND NOT MINGW)
set(LIB_RELEASE_NAME "${libname}")
set(LIB_DEBUG_NAME "${libname}_debug")
set(LIB_DSM_VERSION ${H5FDdsm_PACKAGE_VERSION})
endif(WIN32 AND NOT MINGW)
else(${libtype} MATCHES "SHARED")
if(WIN32 AND NOT MINGW)
set(LIB_RELEASE_NAME "lib${libname}")
set(LIB_DEBUG_NAME "lib${libname}_D")
else(WIN32 AND NOT MINGW)
# if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
set(LIB_RELEASE_NAME "${libname}")
set(LIB_DEBUG_NAME "${libname}_debug")
else(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
set(LIB_RELEASE_NAME "lib${libname}")
set(LIB_DEBUG_NAME "lib${libname}_debug")
endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
endif(WIN32 AND NOT MINGW)
endif(${libtype} MATCHES "SHARED")
set_target_properties(${libtarget}
PROPERTIES
DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME}
RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME}
MINSIZEREL_OUTPUT_NAME ${LIB_RELEASE_NAME}
RELWITHDEBINFO_OUTPUT_NAME ${LIB_RELEASE_NAME}
VERSION ${LIB_DSM_VERSION}
SOVERSION ${LIB_DSM_VERSION}
)
#----- Use MSVC Naming conventions for Shared Libraries
if(MINGW AND ${libtype} MATCHES "SHARED")
set_target_properties(${libtarget}
PROPERTIES
IMPORT_SUFFIX ".lib"
IMPORT_PREFIX ""
PREFIX ""
)
endif(MINGW AND ${libtype} MATCHES "SHARED")
endmacro(set_lib_options)
#-----------------------------------------------------------------------------
# To fix potential linker problems with mixed static/shared on linux
#-----------------------------------------------------------------------------
if(NOT BUILD_SHARED_LIBS)
if(NOT WIN32)
# should this be a user setting : Everyone uses it anyway ?
add_definitions(-DPIC)
endif(NOT WIN32)
endif(NOT BUILD_SHARED_LIBS)
#-----------------------------------------------------------------------------
# To fix CRT secure warning on WIN32
#-----------------------------------------------------------------------------
if(WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(WIN32)
#-----------------------------------------------------------------------------
# Find HDF5
#-----------------------------------------------------------------------------
if(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${H5FDdsm_SOURCE_DIR}/CMake/")
find_package(HDF5 REQUIRED)
else(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
if(NOT VTK_USE_SYSTEM_HDF5)
if(HDF5_CONFIG)
include("${HDF5_CONFIG}")
else(HDF5_CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${H5FDdsm_SOURCE_DIR}/CMake/")
find_package(HDF5 REQUIRED PATHS "${HDF5_DIR}")
endif(HDF5_CONFIG)
endif(NOT VTK_USE_SYSTEM_HDF5)
endif(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
if(NOT TARGET "hdf5")
# MESSAGE(FATAL_ERROR "The Project requires HDF5")
endif(NOT TARGET "hdf5")
if(NOT HDF5_ENABLE_PARALLEL)
# MESSAGE (FATAL_ERROR "The Project requires HDF5 to be compiled with HDF5_ENABLE_PARALLEL ON")
endif(NOT HDF5_ENABLE_PARALLEL)
include_directories(${HDF5_INCLUDE_DIR})
#-----------------------------------------------------------------------------
# Find MPI
#-----------------------------------------------------------------------------
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
# MPI C libraries are imported with HDF5
set(H5FDdsm_LIB_DEPENDENCIES ${H5FDdsm_LIB_DEPENDENCIES} ${MPI_CXX_LIBRARIES})
#-----------------------------------------------------------------------------
# Include all directories used by this source
#-----------------------------------------------------------------------------
include_directories(${H5FDdsm_SOURCE_DIR}/src)
include_directories(${H5FDdsm_SOURCE_DIR}/tools)
include_directories(${H5FDdsm_BINARY_DIR}/src)
#----------------------------
# Fortran
#----------------------------
macro(set_fortran_link_options target)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
set_target_properties(${target}
PROPERTIES
COMPILE_FLAGS "/libs:dll /threads "
LINK_FLAGS "/SUBSYSTEM:CONSOLE"
)
else(BUILD_SHARED_LIBS)
set_target_properties(${target}
PROPERTIES
COMPILE_FLAGS "/libs:dll /threads "
LINK_FLAGS "/SUBSYSTEM:CONSOLE /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD ${addlinkflags}"
)
endif(BUILD_SHARED_LIBS)
endif(WIN32 AND MSVC)
set_target_properties(${target} PROPERTIES LINKER_LANGUAGE Fortran)
endmacro(set_fortran_link_options)
#-----------------------------------------------------------------------------
# Specify project source files
#-----------------------------------------------------------------------------
set(H5FDdsmSources
src/H5FDdsm.c
src/H5FDdsmDriver.cxx
src/H5FDdsmBuffer.cxx
src/H5FDdsmBufferService.cxx
src/H5FDdsmComm.cxx
src/H5FDdsmCommMpi.cxx
src/H5FDdsmCommMpiRma.cxx
src/H5FDdsmCommSocket.cxx
src/H5FDdsmIniFile.cxx
src/H5FDdsmObject.cxx
src/H5FDdsmMsg.cxx
src/H5FDdsmSocket.cxx
src/H5FDdsmStorage.cxx
src/H5FDdsmStorageMpi.cxx
src/H5FDdsmManager.cxx
src/H5FDdsmAddressMapper.cxx
src/H5FDdsmMutex.cxx
src/H5FDdsmLock.cxx
src/H5FDdsmCondition.cxx
src/H5FDdsmThread.cxx
)
if(H5FDdsm_BUILD_STEERING)
set(H5FDdsmSources
src/H5FDdsmSteerer.cxx
src/H5FDdsmSteering.cxx
${H5FDdsmSources}
)
endif(H5FDdsm_BUILD_STEERING)
if(H5FDdsm_USE_CRAY_DMAPP)
set(H5FDdsmSources
src/H5FDdsmCommDmapp.cxx
${H5FDdsmSources}
)
endif(H5FDdsm_USE_CRAY_DMAPP)
if(H5FDdsm_USE_CRAY_UGNI)
set(H5FDdsmSources
src/H5FDdsmCommUGni.cxx
${H5FDdsmSources}
)
endif(H5FDdsm_USE_CRAY_UGNI)
SET(H5FDdsmToolsSources
tools/h5dump.cxx
tools/h5tools.c
tools/h5tools_ref.c
tools/h5tools_str.c
tools/h5tools_type.c
tools/h5tools_utils.cxx
tools/h5trav.c
tools/H5FDdsmTools.cxx
)
#-----------------------------------------------------------------------------
# Create the libraries
#-----------------------------------------------------------------------------
add_library(H5FDdsm ${H5FDdsmSources})
set(H5FDdsm_EXPORTED_LIBS H5FDdsm)
target_link_libraries(H5FDdsm
${H5FDdsm_LIB_DEPENDENCIES}
)
if(WIN32)
target_link_libraries(H5FDdsm
wsock32 ws2_32
)
endif(WIN32)
set_lib_options(H5FDdsm "H5FDdsm" ${H5FDdsm_LIBTYPE})
if(H5FDdsm_ENABLE_COVERAGE)
set_coverage_flags(H5FDdsm)
endif(H5FDdsm_ENABLE_COVERAGE)
#-----------------------------------------------------------------------------
if(H5FDdsm_BUILD_TOOLS)
add_library(H5FDdsmTools ${H5FDdsmToolsSources})
set(H5FDdsm_EXPORTED_LIBS ${H5FDdsm_EXPORTED_LIBS} H5FDdsmTools)
set_lib_options(H5FDdsmTools "H5FDdsmTools" ${H5FDdsm_LIBTYPE})
set_target_properties(H5FDdsmTools
PROPERTIES
COMPILE_FLAGS "-Dhdf5_tools_EXPORTS"
)
target_link_libraries(H5FDdsmTools
H5FDdsm
)
endif(H5FDdsm_BUILD_TOOLS)
#-----------------------------------------------------------------------------
# Option to build Fortran bindings
# We will use the name mangling and type checks from the HDF5 project
#-----------------------------------------------------------------------------
option(H5FDdsm_BUILD_FORTRAN "Build FORTRAN bindings." OFF)
if(H5FDdsm_BUILD_FORTRAN)
set(H5FDdsm_HAVE_FORTRAN TRUE)
include_directories(${HDF5_INCLUDE_DIR_FORTRAN})
add_subdirectory(${H5FDdsm_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran)
endif(H5FDdsm_BUILD_FORTRAN)
#-----------------------------------------------------------------------------
# Configure our module header files
#-----------------------------------------------------------------------------
configure_file(
${H5FDdsm_SOURCE_DIR}/src/H5FDdsmConfig.h.in
${H5FDdsm_BINARY_DIR}/src/H5FDdsmConfig.h
)
configure_file(
${H5FDdsm_SOURCE_DIR}/src/H5FDdsmToolsConfig.h.in
${H5FDdsm_BINARY_DIR}/src/H5FDdsmToolsConfig.h
)
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
option(BUILD_TESTING "Build H5FDdsm Complete Testing" ON)
if(NOT H5FDdsm_BUILD_TOOLS AND BUILD_TESTING)
message(FATAL_ERROR "Please turn on H5FDdsm_BUILD_TOOLS to enable testing.")
endif(NOT H5FDdsm_BUILD_TOOLS AND BUILD_TESTING)
if(NOT H5FDdsm_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
enable_testing()
include(CTest)
add_subdirectory(Testing)
endif(NOT H5FDdsm_EXTERNALLY_CONFIGURED AND BUILD_TESTING)
#-----------------------------------------------------------------------------
# Specify project header files to be installed
#-----------------------------------------------------------------------------
set(H5FDdsmHeaders
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsm.h
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsmManager.h
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsmBuffer.h
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsmBufferService.h
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsmObject.h
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsmComm.h
${H5FDdsm_BINARY_DIR}/src/H5FDdsmConfig.h
${H5FDdsm_BINARY_DIR}/src/H5FDdsmToolsConfig.h
)
if(H5FDdsm_BUILD_STEERING)
set(H5FDdsmHeaders
${CMAKE_CURRENT_SOURCE_DIR}/src/H5FDdsmSteering.h
${H5FDdsmHeaders}
)
endif(H5FDdsm_BUILD_STEERING)
if(H5FDdsm_BUILD_TOOLS)
set(H5FDdsmHeaders
${CMAKE_CURRENT_SOURCE_DIR}/tools/H5FDdsmTools.h
${H5FDdsmHeaders}
)
endif(H5FDdsm_BUILD_TOOLS)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
install(
FILES
${H5FDdsmHeaders}
DESTINATION
${H5FDdsm_INSTALL_INCLUDE_DIR}
COMPONENT
headers
)
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install
#-----------------------------------------------------------------------------
install(
TARGETS
${H5FDdsm_EXPORTED_LIBS}
EXPORT
${H5FDdsm_EXPORTED_TARGETS}
LIBRARY DESTINATION ${H5FDdsm_INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${H5FDdsm_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${H5FDdsm_INSTALL_BIN_DIR}
)
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
install(
EXPORT
${H5FDdsm_EXPORTED_TARGETS}
DESTINATION
${H5FDdsm_INSTALL_DATA_DIR}/cmake/h5fddsm
FILE
h5fddsm-targets.cmake
)
#-----------------------------------------------------------------------------
# Export all exported targets to the build tree for use by parent project
#-----------------------------------------------------------------------------
if(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
EXPORT (
TARGETS
${H5FDdsm_EXPORTED_LIBS}
FILE
h5fddsm-targets.cmake
)
endif(NOT H5FDdsm_EXTERNALLY_CONFIGURED)
#-----------------------------------------------------------------------------
# Configure the HDF5-config.cmake file for the build directory
#-----------------------------------------------------------------------------
set(H5FDdsm_INCLUDES_BUILD_TIME
${H5FDdsm_SOURCE_DIR}/src
${H5FDdsm_SOURCE_DIR}/tools
)
configure_file(
${H5FDdsm_SOURCE_DIR}/CMake/H5FDdsm-config.cmake.build.in
${H5FDdsm_BINARY_DIR}/h5fddsm-config.cmake @ONLY
)
#-----------------------------------------------------------------------------
# Configure the h5fddsm-config.cmake file for the install directory
#-----------------------------------------------------------------------------
configure_file(
${H5FDdsm_SOURCE_DIR}/CMake/H5FDdsm-config.cmake.install.in
${H5FDdsm_BINARY_DIR}/CMakeFiles/h5fddsm-config.cmake @ONLY
)
install(
FILES
${H5FDdsm_BINARY_DIR}/CMakeFiles/h5fddsm-config.cmake
DESTINATION
${H5FDdsm_INSTALL_DATA_DIR}/cmake/h5fddsm
)
#-----------------------------------------------------------------------------
# Configure the hdf5-config-version .cmake file for the install directory
#-----------------------------------------------------------------------------
configure_file(
${H5FDdsm_SOURCE_DIR}/CMake/H5FDdsm-config-version.cmake.in
${H5FDdsm_BINARY_DIR}/CMakeFiles/h5fddsm-config-version.cmake @ONLY
)
install(
FILES
${H5FDdsm_BINARY_DIR}/CMakeFiles/h5fddsm-config-version.cmake
DESTINATION
${H5FDdsm_INSTALL_DATA_DIR}/cmake/h5fddsm
)
#-----------------------------------------------------------------------------
# Debugging below here
#-----------------------------------------------------------------------------