-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
918 lines (789 loc) · 36.7 KB
/
CMakeLists.txt
File metadata and controls
918 lines (789 loc) · 36.7 KB
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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
# ===============================================================================
# ------ Prerequisites & Policies -----------------------------------------------
# ===============================================================================
# cmake_minimum_required(3.18.2): need CMP0091 policy + target properties support
cmake_minimum_required(VERSION 3.18.2)
# CMP0091: Enable MSVC runtime library selection via CMAKE_MSVC_RUNTIME_LIBRARY
cmake_policy(SET CMP0091 NEW)
# CMP0074: Use <PackageName>_ROOT variables for find_package()
cmake_policy(SET CMP0074 NEW)
# Guard against in-source builds to prevent polluting source directory
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt.")
endif()
# ===============================================================================
# ------- Project Definition & Defaults -----------------------------------------
# ===============================================================================
project(HydroChrono
VERSION 0.7.0
DESCRIPTION "Hydrodynamics for Project Chrono."
LANGUAGES CXX
)
# MSVC: CMake may pass "SYSTEM" include directories as external headers (/external:I).
# Some third-party headers rely on nested quoted includes that can fail intermittently when treated as external headers.
# Force SYSTEM include dirs to be emitted as normal /I include paths instead.
if(MSVC)
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "/I")
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "/I")
endif()
# ===============================================================================
# -------- Project Metadata ----------------------------------------------------
# ===============================================================================
# Project metadata derived from project() command - single source of truth
set(HYDROCHRONO_NAME "${PROJECT_NAME}")
set(HYDROCHRONO_VERSION "${PROJECT_VERSION}")
set(HYDROCHRONO_DESCRIPTION "${PROJECT_DESCRIPTION}")
message(STATUS "Project: ${HYDROCHRONO_NAME} v${HYDROCHRONO_VERSION}")
message(STATUS "Description: ${HYDROCHRONO_DESCRIPTION}")
# Generate version.h header from template
configure_file(${CMAKE_SOURCE_DIR}/cmake/version.h.in
${CMAKE_BINARY_DIR}/hydroc/version.h @ONLY)
# Add the cmake folder so the FindSphinx module is found
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# Prefer config-mode package discovery (finds vcpkg *-config.cmake files
# instead of CMake's built-in Find*.cmake modules which may not understand vcpkg).
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
set(CMAKE_FIND_USE_PACKAGE_REGISTRY OFF)
# Force Release by default so CI builds are optimized and users get good performance
if(NOT DEFINED HYDROCHRONO_DEFAULT_BUILD_TYPE)
set(HYDROCHRONO_DEFAULT_BUILD_TYPE "Release")
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${HYDROCHRONO_DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE ${HYDROCHRONO_DEFAULT_BUILD_TYPE}
CACHE STRING "Choose the type of build." FORCE)
mark_as_advanced(CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
# ===============================================================================
# ------ User Options -----------------------------------------------------------
# ===============================================================================
option(HYDROCHRONO_ENABLE_TESTS "Enable tests" ON)
option(HYDROCHRONO_ENABLE_IRRLICHT "Enable Irrlicht visualization library" OFF)
option(HYDROCHRONO_ENABLE_VSG "Enable VSG visualization library" OFF)
option(HYDROCHRONO_ENABLE_DEMOS "Enable demo executables" OFF)
option(HYDROCHRONO_ENABLE_YAML_RUNNER "Enable YAML-based CLI runner" OFF)
option(HYDROCHRONO_ENABLE_MOORDYN "Enable MoorDyn mooring coupling" OFF)
# ===============================================================================
# ------ Build setup ------------------------------------------------------------
# ===============================================================================
message(STATUS "")
# Fix for VS 2017 15.8 and newer to handle alignment specification with Eigen
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(MSVC AND ${MSVC_VERSION} GREATER_EQUAL 1915)
add_compile_definitions("ENABLE_EXTENDED_ALIGNED_STORAGE")
endif()
endif()
# Disable common MSVC warnings that pollute build output
if(MSVC)
add_definitions(
-D_CRT_SECURE_NO_DEPRECATE # Disable CRT deprecation warnings
-D_SCL_SECURE_NO_DEPRECATE # Disable SCL deprecation warnings
-DNOMINMAX # Prevent Windows.h from defining min/max macros
)
add_compile_options(/wd4275) # Disable non-DLL class used as base for DLL-interface class
add_compile_options(/wd4251) # Disable "class needs to have dll-interface" warnings
endif()
# -- HydroChrono data directory
message(STATUS "HydroChrono data directory")
# Destination directory for HydroChrono data in BUILD tree
set(HC_BUILD_DATA "${CMAKE_BINARY_DIR}/data")
# Destination directory for HydroChrono data in INSTALL tree
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(HC_INSTALL_DATA "data")
set(HC_INSTALL_DEMO "bin")
set(HC_INSTALL_PYTHON "bin")
else()
set(HC_INSTALL_DATA "share/chrono/data")
set(HC_INSTALL_DEMO "share/chrono/bin")
set(HC_INSTALL_PYTHON "share/chrono/python")
endif()
# Copy data directory to BUILD tree
file(COPY ${CMAKE_SOURCE_DIR}/data/ DESTINATION ${HC_BUILD_DATA})
message(STATUS " copied to: ${HC_BUILD_DATA}/")
# Install data directory (trailing slash copies contents, not the directory itself)
install(DIRECTORY ${HC_BUILD_DATA}/ DESTINATION ${HC_INSTALL_DATA})
message(STATUS " installed to: ${CMAKE_INSTALL_PREFIX}/${HC_INSTALL_DATA}/")
# -- Output Directory Structure --
# Centralize all binaries for easier deployment and testing
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Replicate for multi-config generators (Visual Studio, Xcode, Ninja Multi-Config)
if(CMAKE_CONFIGURATION_TYPES)
foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${cfg}" cfg_uc)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${cfg_uc} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${cfg})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${cfg_uc} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${cfg})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${cfg_uc} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${cfg})
endforeach()
elseif(CMAKE_BUILD_TYPE)
# Single-config generator with explicit build type
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_uc)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${build_type_uc} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${build_type_uc} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${build_type_uc} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
endif()
# ===============================================================================
# ------- Find Dependencies -----------------------------------------------------
# ===============================================================================
# -- Chrono package --
message(STATUS "\n---- Find Chrono")
if(NOT Chrono_DIR)
message("Specify the directory containing a CMake configuration file for Chrono")
set(Chrono_DIR "" CACHE PATH "The directory containing a CMake configuration file for Chrono.")
return()
endif()
# Pre-load HDF5 targets so the shims below are only created when genuinely
# needed (i.e., when HDF5 config-mode doesn't provide hdf5_tools).
# Without this, installers that define all HDF5 targets as a batch
# (e.g., HDF Group installer) error out on the partial pre-definition.
find_package(HDF5 CONFIG QUIET)
# Chrono's export file may reference hdf5::hdf5_tools-{shared,static} which is
# absent from some HDF5 installations (e.g., vcpkg). Provide empty shims so
# ChronoTargets.cmake loads without errors. Must be created BEFORE find_package(Chrono).
if(NOT TARGET hdf5::hdf5_tools-shared)
add_library(hdf5::hdf5_tools-shared INTERFACE IMPORTED)
endif()
if(NOT TARGET hdf5::hdf5_tools-static)
add_library(hdf5::hdf5_tools-static INTERFACE IMPORTED)
endif()
find_package(Chrono
CONFIG REQUIRED
COMPONENTS Parsers)
# If the early HDF5 find failed but Chrono has now set HDF5_DIR, retry.
# The early find may have cached HDF5_DIR-NOTFOUND, blocking Chrono's
# non-FORCE cache set. Clear it and retry with the Chrono-provided path.
if(NOT HDF5_FOUND AND DEFINED CACHE{HDF5_DIR})
if("${HDF5_DIR}" MATCHES "NOTFOUND")
unset(HDF5_DIR CACHE)
find_package(HDF5 CONFIG QUIET)
endif()
endif()
message(STATUS "----\n")
message(STATUS "Chrono targets: ${CHRONO_TARGETS}")
# Verify required Chrono targets are available
if(NOT TARGET Chrono::Chrono_core)
message(FATAL_ERROR "Chrono::Chrono_core target not found. Ensure Chrono was built with modern CMake target exports.")
endif()
if(NOT TARGET Chrono::Chrono_parsers)
message(FATAL_ERROR "Chrono::Chrono_parsers target not found. Ensure Chrono was built with modern CMake target exports.")
endif()
# Ensure we have a compatible Chrono version (check after find_package)
if(DEFINED CHRONO_VERSION)
if(CHRONO_VERSION VERSION_LESS "9.0.1")
message(WARNING "HydroChrono now requires Chrono ≥ 9.0.1 for modular target support. Found version: ${CHRONO_VERSION}")
endif()
else()
# If CHRONO_VERSION is not defined, assume it's a compatible version
# since the modern targets are available
message(STATUS "Chrono version not explicitly set, but modern targets are available - assuming compatible version")
endif()
# To ensure ABI compatibility, use the same C++ standard as the one used to build Chrono
if (CHRONO_CXX_STANDARD)
set(HC_CXX_STANDARD ${CHRONO_CXX_STANDARD})
message(STATUS "Set C++ standard same as Chrono: ${HC_CXX_STANDARD}")
else()
set(HC_CXX_STANDARD cxx_std_17)
message(STATUS "Set C++ standard to: ${HC_CXX_STANDARD}")
endif()
# Detect whether Chrono has the newer ChLoadHydrodynamics API.
# If not, fall back to HydroChrono's legacy added-mass implementation.
set(CHRONO_HAS_LOAD_HYDRODYNAMICS FALSE)
get_target_property(_chrono_inc_dirs Chrono::Chrono_core INTERFACE_INCLUDE_DIRECTORIES)
foreach(_dir ${_chrono_inc_dirs})
if(EXISTS "${_dir}/chrono/physics/ChLoadHydrodynamics.h")
set(CHRONO_HAS_LOAD_HYDRODYNAMICS TRUE)
break()
endif()
endforeach()
if(NOT CHRONO_HAS_LOAD_HYDRODYNAMICS)
message(STATUS "ChLoadHydrodynamics not found in Chrono -- using legacy added-mass implementation")
endif()
# Enable Irrlicht support if requested and available
if(HYDROCHRONO_ENABLE_IRRLICHT AND NOT TARGET Chrono::Chrono_irrlicht)
message(FATAL_ERROR "HYDROCHRONO_ENABLE_IRRLICHT is ON but Chrono::Chrono_irrlicht target not found. Ensure Chrono was built with Irrlicht support.")
endif()
# Enable VSG support if requested and available
if(HYDROCHRONO_ENABLE_VSG AND NOT TARGET Chrono::Chrono_vsg)
message(FATAL_ERROR "HYDROCHRONO_ENABLE_VSG is ON but Chrono::Chrono_vsg target not found. Ensure Chrono was built with VSG support.")
endif()
# If on a Windows platform, copy the Chrono DLLs to the binary directory
add_CHRONO_DLLS_copy_command()
# Copy selected Chrono data directories to the HydroChrono data directory
if(EXISTS "${CHRONO_DATA_DIR}")
if(EXISTS "${CHRONO_DATA_DIR}/colormaps")
file(COPY ${CHRONO_DATA_DIR}/colormaps DESTINATION ${HC_BUILD_DATA}/chrono)
endif()
if(EXISTS "${CHRONO_DATA_DIR}/skybox")
file(COPY ${CHRONO_DATA_DIR}/skybox DESTINATION ${HC_BUILD_DATA}/chrono)
endif()
if(EXISTS "${CHRONO_DATA_DIR}/vsg")
file(COPY ${CHRONO_DATA_DIR}/vsg DESTINATION ${HC_BUILD_DATA}/chrono)
endif()
if(EXISTS "${CHRONO_DATA_DIR}/logo_chrono_alpha.png")
file(COPY ${CHRONO_DATA_DIR}/logo_chrono_alpha.png DESTINATION ${HC_BUILD_DATA}/chrono)
endif()
endif()
# -- OpenMP support --
find_package(OpenMP REQUIRED COMPONENTS CXX)
# -- HDF5 Integration --
# Config-mode discovery runs early (before Chrono) to avoid target conflicts
# with the hdf5_tools shims. Fall back to module-mode here if it wasn't found.
if(NOT HDF5_FOUND)
find_package(HDF5 REQUIRED COMPONENTS CXX)
endif()
# -- MoorDyn mooring library (optional) --
if(HYDROCHRONO_ENABLE_MOORDYN)
message(STATUS "\n---- MoorDyn mooring library")
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/extern/MoorDyn/CMakeLists.txt")
message(FATAL_ERROR
"MoorDyn submodule not found at extern/MoorDyn.\n"
"Run: git submodule update --init extern/MoorDyn")
endif()
# MoorDyn's CMakeLists.txt uses CMAKE_SOURCE_DIR (which resolves to
# HydroChrono's root) for its config template and CPack license.
# Copy the files it expects so the configure step succeeds.
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/MoorDynConfig.cmake")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extern/MoorDyn/cmake/MoorDynConfig.cmake"
DESTINATION "${CMAKE_SOURCE_DIR}/cmake/")
endif()
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/LICENSE.txt")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extern/MoorDyn/LICENSE.txt"
DESTINATION "${CMAKE_SOURCE_DIR}/")
endif()
set(EXTERNAL_EIGEN OFF CACHE BOOL "Use MoorDyn bundled Eigen" FORCE)
set(PYTHON_WRAPPER OFF CACHE BOOL "Disable MoorDyn Python wrapper" FORCE)
set(FORTRAN_WRAPPER OFF CACHE BOOL "Disable MoorDyn Fortran wrapper" FORCE)
set(MATLAB_WRAPPER OFF CACHE BOOL "Disable MoorDyn MATLAB wrapper" FORCE)
set(RUST_WRAPPER OFF CACHE BOOL "Disable MoorDyn Rust wrapper" FORCE)
set(BUILD_TESTING_SAVED ${BUILD_TESTING})
set(BUILD_TESTING OFF)
add_subdirectory(extern/MoorDyn)
set(BUILD_TESTING ${BUILD_TESTING_SAVED})
# MoorDyn is a shared library (DLL) -- its internal Eigen usage must not
# leak into HydroChrono's include paths (HydroChrono uses Chrono's Eigen).
set_target_properties(moordyn PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ""
)
message(STATUS "MoorDyn mooring coupling: ENABLED")
message(STATUS "----\n")
endif()
# ===============================================================================
# ----- Create HydroChrono configuration header ---------------------------------
# ===============================================================================
message(STATUS "Generate HydroChrono configuration headers")
set(CH_DATA_DIR "#define CHRONO_DATA_DIR \"${CHRONO_DATA_DIR}\"")
if(HYDROCHRONO_ENABLE_IRRLICHT)
set(HC_HAS_IRRLICHT "#define HYDROCHRONO_HAVE_IRRLICHT")
else()
set(HC_HAS_IRRLICHT "#undef HYDROCHRONO_HAVE_IRRLICHT")
endif()
if(HYDROCHRONO_ENABLE_VSG)
set(HC_HAS_VSG "#define HYDROCHRONO_HAVE_VSG")
else()
set(HC_HAS_VSG "#undef HYDROCHRONO_HAVE_VSG")
endif()
if(HYDROCHRONO_ENABLE_MOORDYN)
set(HC_HAS_MOORDYN "#define HYDROCHRONO_HAVE_MOORDYN")
else()
set(HC_HAS_MOORDYN "#undef HYDROCHRONO_HAVE_MOORDYN")
endif()
# For BUILD tree
set(HC_DATA_DIR "#define HC_DATA_DIR \"${HC_BUILD_DATA}\"")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in
${PROJECT_BINARY_DIR}/hydroc/config.h
@ONLY)
# For INSTALL tree
set(HC_DATA_DIR "#define HC_DATA_DIR \"${CMAKE_INSTALL_PREFIX}/${HC_INSTALL_DATA}\"")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in
${PROJECT_BINARY_DIR}/hydroc/config.h-install
@ONLY)
# ===============================================================================
# ------- Core Library Target ---------------------------------------------------
# ===============================================================================
list(APPEND HC_INCLUDES_BUILD ${PROJECT_SOURCE_DIR}/include)
list(APPEND HC_INCLUDES_BUILD ${PROJECT_BINARY_DIR})
# -- Main HydroChrono Library --
set(HC_SOURCES
# IO module (consolidated under src/hydro/io/)
src/hydro/io/h5_reader.cpp
src/hydro/io/h5_writer.cpp
src/hydro/io/simulation_export.cpp
# Config/YAML module (consolidated under src/hydro/config/)
src/hydro/config/yaml_parser.cpp
src/hydro/config/config_loader.cpp
src/hydro/config/setup_from_yaml.cpp
src/hydro/config/yaml_discovery.cpp
# Core facade and utilities
src/hydro/hydro_system.cpp
src/hydro/utils/helper.cpp
# Hydro modules
src/hydro/waves/wave_base.cpp
src/hydro/waves/wave_utilities.cpp
src/hydro/waves/regular_wave.cpp
src/hydro/waves/irregular_wave.cpp
src/hydro/radiation/radiation_rirf_processing.cpp
src/hydro/radiation/radiation_rirf_convolution.cpp
src/hydro/radiation/radiation_ss_model.cpp
src/hydro/radiation/radiation_ss_fitter.cpp
src/hydro/core/hydro_forces.cpp
# Chrono coupling layer (bridges Chrono physics with Chrono-free core)
src/hydro/chrono/added_mass.cpp
src/hydro/chrono/chrono_state_utils.cpp
src/hydro/chrono/chrono_hydro_coupler.cpp
src/hydro/force_components/hydrostatics_component.cpp
src/hydro/force_components/radiation_component.cpp
src/hydro/force_components/radiation_ss_component.cpp
src/hydro/force_components/excitation_component.cpp
# Logging module (consolidated under src/hydro/logging/)
src/hydro/logging/logger_backend.cpp
src/hydro/logging/logging.cpp
)
# MoorDyn mooring sources (conditionally compiled).
# The wrapper is built as a separate OBJECT library so that MoorDyn's
# bundled Eigen headers stay isolated and don't conflict with the
# system/Chrono Eigen used by HydroChrono.
if(HYDROCHRONO_ENABLE_MOORDYN)
add_library(moordyn_bridge OBJECT
src/hydro/mooring/moordyn_wrapper.cpp
)
target_include_directories(moordyn_bridge PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/extern/MoorDyn/source"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)
target_link_libraries(moordyn_bridge PRIVATE moordyn)
target_compile_features(moordyn_bridge PUBLIC cxx_std_17)
# Pick up HydroChrono's public headers (system_state.h, hydro_types.h)
target_include_directories(moordyn_bridge PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
)
# Chrono headers needed for Eigen (used by hydro_types.h)
target_link_libraries(moordyn_bridge PUBLIC Chrono::Chrono_core)
list(APPEND HC_SOURCES
src/hydro/force_components/mooring_component.cpp
)
endif()
set(HC_HEADERS
${PROJECT_BINARY_DIR}/hydroc/config.h
${PROJECT_BINARY_DIR}/hydroc/version.h
include/hydroc/hydro_system.h
include/hydroc/helper.h
include/hydroc/logging.h
include/hydroc/config/hydro_config.h
include/hydroc/config/moordyn_config.h
include/hydroc/core/force_component.h
include/hydroc/core/hydro_forces.h
include/hydroc/core/hydro_types.h
include/hydroc/core/system_state.h
include/hydroc/coupling/added_mass.h
include/hydroc/coupling/chrono_coupler.h
include/hydroc/io/h5_reader.h
include/hydroc/io/h5_writer.h
include/hydroc/io/simulation_export.h
include/hydroc/radiation/radiation_types.h
include/hydroc/waves/irregular_wave.h
include/hydroc/waves/regular_wave.h
include/hydroc/waves/wave_base.h
)
# Create the library target and configure it
add_library(HydroChrono ${HC_SOURCES} ${HC_HEADERS})
target_compile_features(HydroChrono PUBLIC ${HC_CXX_STANDARD})
target_include_directories(HydroChrono
PUBLIC
"$<BUILD_INTERFACE:${HC_INCLUDES_BUILD}>"
"$<INSTALL_INTERFACE:include>"
)
set_target_properties(HydroChrono PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(HydroChrono PUBLIC Chrono::Chrono_core)
# Add OpenMP
target_link_libraries(HydroChrono PUBLIC OpenMP::OpenMP_CXX)
# Add HDF5 (assume first latest HDF5 version 1.14.6 and prefer static library)
if(TARGET hdf5::hdf5-static)
message(STATUS "Linking static libraries hdf5::hdf5-static")
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5-static)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_cpp-static)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl-static)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl_cpp-static)
if(TARGET hdf5::hdf5_tools-static)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_tools-static)
endif()
elseif(TARGET hdf5::hdf5-shared)
message(STATUS "Linking shared libraries hdf5::hdf5-shared")
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5-shared)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_cpp-shared)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl-shared)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl_cpp-shared)
list(APPEND HDF5_TARGETS hdf5::hdf5-shared)
list(APPEND HDF5_TARGETS hdf5::hdf5_cpp-shared)
list(APPEND HDF5_TARGETS hdf5::hdf5_hl-shared)
list(APPEND HDF5_TARGETS hdf5::hdf5_hl_cpp-shared)
if(TARGET hdf5::hdf5_tools-shared)
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_tools-shared)
list(APPEND HDF5_TARGETS hdf5::hdf5_tools-shared)
endif()
elseif(TARGET HDF5::HDF5)
message(STATUS "Linking HDF5::HDF5")
target_link_libraries(HydroChrono PUBLIC HDF5::HDF5)
list(APPEND HDF5_TARGETS HDF5::HDF5)
else()
message(STATUS "No HDF5 target found")
target_compile_definitions(HydroChrono PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${HDF5_COMPILE_DEFS}>)
target_include_directories(HydroChrono PUBLIC ${HDF5_INCLUDE_DIRS})
target_link_libraries(HydroChrono PUBLIC ${HDF5_CXX_LIBRARIES})
endif()
target_include_directories(HydroChrono
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# Add MoorDyn (optional mooring coupling)
if(HYDROCHRONO_ENABLE_MOORDYN AND TARGET moordyn)
# Link moordyn import lib for DLL binding; moordyn_bridge provides
# the compiled wrapper objects with MoorDyn headers isolated from HC.
target_link_libraries(HydroChrono PRIVATE $<TARGET_LINKER_FILE:moordyn>)
target_sources(HydroChrono PRIVATE $<TARGET_OBJECTS:moordyn_bridge>)
target_compile_definitions(HydroChrono PUBLIC HYDROCHRONO_HAVE_MOORDYN)
endif()
# Library-specific compile definitions
target_compile_definitions(HydroChrono
PUBLIC
"HYDROCHRONO_VERSION=\"${PROJECT_VERSION}\""
"HYDROCHRONO_BUILD_TYPE=\"$<IF:$<CONFIG:Debug>,Debug,$<IF:$<CONFIG:Release>,Release,$<IF:$<CONFIG:RelWithDebInfo>,RelWithDebInfo,$<IF:$<CONFIG:MinSizeRel>,MinSizeRel,Unknown>>>>\""
$<$<NOT:$<BOOL:${CHRONO_HAS_LOAD_HYDRODYNAMICS}>>:HYDROCHRONO_USE_LEGACY_ADDED_MASS>
PRIVATE
$<$<BOOL:${HYDROCHRONO_ENABLE_LOGGING}>:HYDROCHRONO_ENABLE_LOGGING="1">
)
# ===============================================================================
# ------- Visualization library -------------------------------------------------
# ===============================================================================
set(HCGUI_HEADERS
include/hydroc/gui/guihelper.h
src/gui/guihelper_impl.h
)
set(HCGUI_SOURCES
src/gui/guihelper.cpp
)
if(HYDROCHRONO_ENABLE_IRRLICHT)
set(HCGUI_SOURCES ${HCGUI_SOURCES}
src/gui/guihelperIRR.cpp
)
endif()
if(HYDROCHRONO_ENABLE_VSG)
set(HCGUI_SOURCES ${HCGUI_SOURCES}
src/gui/guihelperVSG.cpp
src/gui/vsg_gui_component.cpp
src/gui/vsg_lighting.cpp
src/gui/vsg_materials.cpp
src/gui/vsg_mooring_lines.cpp
src/gui/vsg_water_surface.cpp
src/gui/vsg_radiation_surface.cpp
)
set(HCGUI_HEADERS ${HCGUI_HEADERS}
src/gui/vsg_config.h
src/gui/vsg_gui_component.h
src/gui/vsg_lighting.h
src/gui/vsg_materials.h
src/gui/vsg_mooring_lines.h
src/gui/vsg_water_surface.h
src/gui/vsg_radiation_surface.h
)
endif()
add_library(HydroChronoGUI ${HCGUI_SOURCES} ${HCGUI_HEADERS})
target_compile_features(HydroChronoGUI PUBLIC ${HC_CXX_STANDARD})
target_include_directories(HydroChronoGUI
PUBLIC
"$<BUILD_INTERFACE:${HC_INCLUDES_BUILD}>"
"$<INSTALL_INTERFACE:include>"
)
set_target_properties(HydroChronoGUI PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(HydroChronoGUI
PUBLIC
Chrono::Chrono_core
# Conditionally link Irrlicht and VSG components if enabled
$<$<BOOL:${HYDROCHRONO_ENABLE_IRRLICHT}>:Chrono::Chrono_irrlicht>
$<$<BOOL:${HYDROCHRONO_ENABLE_VSG}>:Chrono::Chrono_vsg>
)
# ===============================================================================
# ------- Auxiliary Targets (app, tests, demos) ---------------------------------
# ===============================================================================
# Helper function to configure test environment (Windows DLL paths, etc.)
function(configure_test_environment)
message(STATUS "Configure test environment")
# HydroChrono DLL paths
set(HC_DLL_DIRS "${CMAKE_BINARY_DIR}/bin/Release;${CMAKE_BINARY_DIR}/bin/RelWithDebInfo;${CMAKE_BINARY_DIR}/bin/MinSizeRel;${CMAKE_BINARY_DIR}/bin/Debug")
message(STATUS " HydroChrono DLL directories: ${HC_DLL_DIRS}")
list(APPEND DLL_DIRS ${HC_DLL_DIRS})
# Chrono DLL paths
get_target_property(CHRONO_CORE_REL_DLL Chrono::Chrono_core IMPORTED_LOCATION_RELEASE)
if(CHRONO_CORE_REL_DLL)
get_filename_component(dir ${CHRONO_CORE_REL_DLL} DIRECTORY)
message(STATUS " Chrono release DLL directory: ${dir}")
list(APPEND DLL_DIRS ${dir})
endif()
get_target_property(CHRONO_CORE_DBG_DLL Chrono::Chrono_core IMPORTED_LOCATION_DEBUG)
if(CHRONO_CORE_DBG_DLL)
get_filename_component(dir ${CHRONO_CORE_DBG_DLL} DIRECTORY)
message(STATUS " Chrono debug DLL directory: ${dir}")
list(APPEND DLL_DIRS ${dir})
endif()
# HDF5 DLL path
if(TARGET hdf5::hdf5-static)
message(STATUS " No HDF5 DLL (hdf5-static)")
elseif(TARGET hdf5::hdf5-shared)
get_target_property(dll hdf5::hdf5-shared IMPORTED_LOCATION_RELEASE)
get_filename_component(dir ${dll} DIRECTORY)
message(STATUS " HDF5 DLL directory (hdf5-shared): ${dir}")
list(APPEND DLL_DIRS ${dir})
elseif(TARGET HDF5::HDF5)
get_target_property(dll HDF5::HFDF5 IMPORTED_LOCATION_RELEASE)
get_filename_component(dir ${dll} DIRECTORY)
message(STATUS " HDF5 DLL directory (HDF5::HDF5): ${dir}")
list(APPEND DLL_DIRS ${dir})
elseif(DEFINED HDF5_ROOT AND EXISTS "${HDF5_ROOT}/bin")
message(STATUS " HDF5 DLL directory (HDF5_ROOT): ${HDF5_ROOT}/bin")
list(APPEND DLL_DIRS ${HDF5_ROOT}/bin)
else()
message(STATUS " Cannot infer HDF5 DLL directory")
endif()
# Irrlicht DLL path
if(HYDROCHRONO_ENABLE_IRRLICHT)
message(STATUS " Irrlicht DLL directory: ${Irrlicht_DLL_DIR}")
list(APPEND DLL_DIRS ${Irrlicht_DLL_DIR})
endif()
# VSG DLL path
if(HYDROCHRONO_ENABLE_VSG)
message(STATUS " VSG DLL directory: ${VSG_DLL_DIR}")
list(APPEND DLL_DIRS ${VSG_DLL_DIR})
endif()
# MoorDyn DLL path
if(HYDROCHRONO_ENABLE_MOORDYN AND TARGET moordyn)
list(APPEND DLL_DIRS "$<TARGET_FILE_DIR:moordyn>")
message(STATUS " MoorDyn DLL directory: (via target)")
endif()
set(TEST_ENVIRONMENT "PATH=${DLL_DIRS};$ENV{PATH}" PARENT_SCOPE)
endfunction()
# YAML-driven CLI app
if(HYDROCHRONO_ENABLE_YAML_RUNNER)
add_subdirectory(app)
else()
message(STATUS "YAML runner disabled - not creating run_hydrochrono target")
endif()
# Demos
if(HYDROCHRONO_ENABLE_DEMOS)
add_subdirectory(demos)
endif()
# Tests
if(HYDROCHRONO_ENABLE_TESTS)
# Use environment variable to override default data directory
if(DEFINED ENV{HYDROCHRONO_DATA_DIR})
set(HYDROCHRONO_DATA_DIR $ENV{HYDROCHRONO_DATA_DIR})
else()
set(HYDROCHRONO_DATA_DIR "${PROJECT_SOURCE_DIR}/demos")
endif()
enable_testing()
# Configure test environment with DLL paths
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
configure_test_environment()
endif()
add_subdirectory(tests/regression)
add_subdirectory(tests/verification)
add_subdirectory(tests/unit)
endif()
# ===============================================================================
# ------ Installation -----------------------------------------------------------
# ===============================================================================
include(GNUInstallDirs)
option(HC_INSTALL_DEV_KIT "Install CMake dev package (headers/libs)" OFF)
if(HC_INSTALL_DEV_KIT)
# Export HydroChrono as an importable target for other CMake projects
install(TARGETS HydroChrono
EXPORT HydroChronoTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT HydroChronoTargets
FILE HydroChronoTargets.cmake
DESTINATION "${CMAKE_INSTALL_DATADIR}/HydroChrono/cmake"
NAMESPACE HydroChrono::
)
# Install public headers
install(DIRECTORY include/hydroc
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
# Install config.h header
install(FILES ${PROJECT_BINARY_DIR}/hydroc/config.h-install
RENAME "config.h"
DESTINATION include/hydroc)
# Install version.h header
install(FILES ${PROJECT_BINARY_DIR}/hydroc/version.h
DESTINATION include/hydroc)
# Generate and install package config files for find_package() support
include(CMakePackageConfigHelpers)
configure_package_config_file(
cmake/HydroChronoConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/cmake/HydroChronoConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/HydroChrono/cmake"
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/HydroChronoConfig.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}/HydroChrono/cmake"
)
endif()
if(HC_INSTALL_DEV_KIT)
# Export targets for build tree usage (without installation)
export(EXPORT HydroChronoTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/HydroChronoTargets.cmake"
NAMESPACE HydroChrono::
)
endif()
if(MSVC)
# Windows: Enable debug symbols in Release builds with MSVC
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /O2")
else()
# Non-MSVC (Linux, macOS): Use -g for debug symbols
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O2")
endif()
# ------------------------------------------------------------------------------
# Runtime installer and ZIP packaging for releases
# ------------------------------------------------------------------------------
# Flat install tree for public distribution
option(HC_INSTALL_DEV_DEMOS "Install developer demo executables" OFF)
# Install main CLI and project shared libraries (if built)
if(TARGET run_hydrochrono)
install(TARGETS run_hydrochrono CONFIGURATIONS Release DESTINATION bin COMPONENT runtime)
endif()
if(TARGET HydroChrono)
install(TARGETS HydroChrono CONFIGURATIONS Release RUNTIME DESTINATION bin COMPONENT runtime)
endif()
if(TARGET HydroChronoGUI)
install(TARGETS HydroChronoGUI CONFIGURATIONS Release RUNTIME DESTINATION bin COMPONENT runtime)
endif()
# On Windows, install DLLs
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
message(STATUS "Set DLLs for installation")
# Chrono DLLs — glob ALL DLLs from the Chrono bin directory to catch
# transitive dependencies (e.g., Chrono_fsitdpf_vsg, yaml-cpp) that may
# not be listed in CHRONO_TARGETS.
get_target_property(_chrono_core_dll Chrono::Chrono_core IMPORTED_LOCATION_RELEASE)
if(_chrono_core_dll)
get_filename_component(_chrono_dll_dir "${_chrono_core_dll}" DIRECTORY)
file(GLOB _chrono_dlls "${_chrono_dll_dir}/*.dll")
foreach(_dll ${_chrono_dlls})
message(STATUS " Chrono DLL ${_dll}")
install(FILES "${_dll}" DESTINATION bin COMPONENT runtime)
endforeach()
endif()
# HDF5 DLLs
foreach(tgt ${HDF5_TARGETS})
get_target_property(tgt_DLL ${tgt} IMPORTED_LOCATION_RELEASE)
if(EXISTS ${tgt_DLL})
message(STATUS " HDF5 DLL ${tgt_DLL}")
install(FILES ${tgt_DLL} DESTINATION bin COMPONENT runtime)
endif()
endforeach()
# Irrlicht DLL
if(HYDROCHRONO_ENABLE_IRRLICHT AND EXISTS ${Irrlicht_DLL_DIR})
set(_irr_dll "${Irrlicht_DLL_DIR}/Irrlicht.dll")
if(EXISTS "${_irr_dll}")
message(STATUS " Irrlicht DLL ${_irr_dll}")
install(FILES "${_irr_dll}" DESTINATION bin COMPONENT runtime)
endif()
endif()
# VSG DLLs
if(HYDROCHRONO_ENABLE_VSG AND EXISTS "${VSG_DLL_DIR}")
file(GLOB _vsg_dlls "${VSG_DLL_DIR}/*.dll")
if(_vsg_dlls)
message(STATUS " VSG DLLs ${_vsg_dlls}")
install(FILES ${_vsg_dlls} DESTINATION bin COMPONENT runtime)
endif()
endif()
# VSG DLLs (vsg, vsgImGui, vsgXchange, draco, etc.)
if(HYDROCHRONO_ENABLE_VSG)
# VSG_DLL_DIR is set by Chrono's find_package when VSG is found
# Fall back to deriving from vsg_DIR if VSG_DLL_DIR is not set
if(NOT DEFINED VSG_DLL_DIR OR VSG_DLL_DIR STREQUAL "")
if(DEFINED vsg_DIR)
# vsg_DIR points to lib/cmake/vsg, go up 3 levels to root then into bin
get_filename_component(_vsg_root "${vsg_DIR}" DIRECTORY) # lib/cmake
get_filename_component(_vsg_root "${_vsg_root}" DIRECTORY) # lib
get_filename_component(_vsg_root "${_vsg_root}" DIRECTORY) # root
set(VSG_DLL_DIR "${_vsg_root}/bin")
endif()
endif()
if(DEFINED VSG_DLL_DIR AND EXISTS "${VSG_DLL_DIR}")
file(GLOB _vsg_dlls "${VSG_DLL_DIR}/*.dll")
if(_vsg_dlls)
message(STATUS "Installing VSG DLLs from: ${VSG_DLL_DIR}")
install(FILES ${_vsg_dlls} DESTINATION bin COMPONENT runtime)
endif()
else()
message(WARNING "HYDROCHRONO_ENABLE_VSG is ON but VSG_DLL_DIR not found. VSG DLLs will not be packaged.")
endif()
endif()
# Python DLLs, if Chrono::Parsers depends on it.
# Derive the DLL path from the already-found interpreter rather than calling
# find_package(Python3 ... Development), which can stall on Windows/conda.
if(CHRONO_PARSERS_PYTHON AND Python3_EXECUTABLE)
get_filename_component(_py_bin_dir "${Python3_EXECUTABLE}" DIRECTORY)
file(GLOB _py_dlls "${_py_bin_dir}/python3*.dll")
foreach(_py_dll ${_py_dlls})
message(STATUS " Python DLL ${_py_dll}")
install(FILES "${_py_dll}" DESTINATION bin COMPONENT runtime)
endforeach()
endif()
# MoorDyn DLL
if(HYDROCHRONO_ENABLE_MOORDYN AND TARGET moordyn)
install(TARGETS moordyn
CONFIGURATIONS Release
RUNTIME DESTINATION bin COMPONENT runtime)
message(STATUS " MoorDyn DLL (via target)")
endif()
endif()
# MoorDyn license bundling
if(HYDROCHRONO_ENABLE_MOORDYN)
install(FILES "${CMAKE_SOURCE_DIR}/extern/MoorDyn/LICENSE.txt"
RENAME MoorDyn_LICENSE.txt
DESTINATION licenses COMPONENT runtime)
endif()
# Public, user-facing regression test suite only
install(DIRECTORY ${PROJECT_SOURCE_DIR}/tests/regression/run_hydrochrono
DESTINATION tests COMPONENT python-tests
PATTERN "__pycache__" EXCLUDE
PATTERN "*.pyc" EXCLUDE)
# Install test input data (YAML configs, hydro data, geometry) into tests/run_hydrochrono
# The Python scripts expect test case folders (iea_sphere/, oswec/, rm3/, f3of/) to be siblings
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/demos/run_hydrochrono/
DESTINATION tests/run_hydrochrono COMPONENT python-tests
PATTERN "__pycache__" EXCLUDE
PATTERN "*.pyc" EXCLUDE)
# Simple runner script to execute tests from the installed tree
install(PROGRAMS ${PROJECT_SOURCE_DIR}/scripts/RUN-TESTS.ps1
DESTINATION tests COMPONENT python-tests)
# MSVC runtime DLLs and ZIP packaging via CPack
# InstallRequiredSystemLibraries handles msvcp/vcruntime/ucrt, but not vcomp (OpenMP).
# Append the OpenMP runtime so it's included in the package.
if(MSVC AND OpenMP_CXX_FOUND)
get_filename_component(_msvc_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
find_file(_vcomp_dll "vcomp140.dll"
PATHS "${_msvc_dir}" "${_msvc_dir}/../../../redist/x64" "C:/Windows/System32"
NO_DEFAULT_PATH)
if(_vcomp_dll)
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${_vcomp_dll}")
message(STATUS " OpenMP DLL ${_vcomp_dll}")
else()
message(WARNING "vcomp140.dll not found — OpenMP runtime will be missing from package")
endif()
endif()
include(InstallRequiredSystemLibraries)
# Third-party license notices
if(EXISTS "${CMAKE_SOURCE_DIR}/THIRD_PARTY_NOTICES.txt")
install(FILES "${CMAKE_SOURCE_DIR}/THIRD_PARTY_NOTICES.txt"
DESTINATION . COMPONENT runtime)
endif()
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_NAME "HydroChrono")
set(CPACK_COMPONENTS_ALL runtime python-tests dev-demos)
include(CPack)