@@ -169,8 +169,7 @@ endif()
169169
170170find_package (Chrono
171171 CONFIG REQUIRED
172- COMPONENTS Parsers
173- OPTIONAL_COMPONENTS Irrlicht VSG )
172+ COMPONENTS Parsers )
174173
175174message (STATUS "----\n " )
176175
@@ -419,6 +418,19 @@ endif()
419418if (HYDROCHRONO_ENABLE_VSG)
420419 set (HCGUI_SOURCES ${HCGUI_SOURCES}
421420 src/gui/guihelperVSG.cpp
421+ src/gui/vsg_gui_component.cpp
422+ src/gui/vsg_lighting.cpp
423+ src/gui/vsg_materials.cpp
424+ src/gui/vsg_water_surface.cpp
425+ src/gui/vsg_radiation_surface.cpp
426+ )
427+ set (HCGUI_HEADERS ${HCGUI_HEADERS}
428+ src/gui/vsg_config.h
429+ src/gui/vsg_gui_component.h
430+ src/gui/vsg_lighting.h
431+ src/gui/vsg_materials.h
432+ src/gui/vsg_water_surface.h
433+ src/gui/vsg_radiation_surface.h
422434 )
423435endif ()
424436
@@ -431,11 +443,6 @@ target_include_directories(HydroChronoGUI
431443 "$<INSTALL_INTERFACE :include >"
432444)
433445
434- if (MSVC )
435- target_compile_options (HydroChronoGUI PRIVATE $<$<COMPILE_LANGUAGE :CXX >:/wd4996 >) # deprecated function or class member
436- target_compile_options (HydroChronoGUI PRIVATE $<$<COMPILE_LANGUAGE :CXX >:/wd4458 >) # declaration hides class member
437- endif ()
438-
439446set_target_properties (HydroChronoGUI PROPERTIES POSITION_INDEPENDENT_CODE ON )
440447target_link_libraries (HydroChronoGUI
441448 PUBLIC
@@ -536,6 +543,7 @@ if(HYDROCHRONO_ENABLE_TESTS)
536543 endif ()
537544
538545 add_subdirectory (tests/regression )
546+ add_subdirectory (tests/unit )
539547endif ()
540548
541549# ===============================================================================
@@ -611,27 +619,33 @@ endif()
611619# Flat install tree for public distribution
612620option (HC_INSTALL_DEV_DEMOS "Install developer demo executables" OFF )
613621
614- # Install main CLI only (if built)
622+ # Install main CLI and project shared libraries (if built)
615623if (TARGET run_hydrochrono)
616624 install (TARGETS run_hydrochrono CONFIGURATIONS Release DESTINATION bin COMPONENT runtime )
617625endif ()
626+ if (TARGET HydroChrono)
627+ install (TARGETS HydroChrono CONFIGURATIONS Release RUNTIME DESTINATION bin COMPONENT runtime )
628+ endif ()
629+ if (TARGET HydroChronoGUI)
630+ install (TARGETS HydroChronoGUI CONFIGURATIONS Release RUNTIME DESTINATION bin COMPONENT runtime )
631+ endif ()
618632
619633# On Windows, install DLLs
620634if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
621635 message (STATUS "Set DLLs for installation" )
622636
623- # Chrono DLLs
624- foreach (tgt ${CHRONO_TARGETS} )
625- get_target_property ( tgt_DLL ${tgt} IMPORTED_LOCATION_RELEASE )
626- get_target_property (tgt_DLL_d ${tgt} IMPORTED_LOCATION_DEBUG )
627- if (EXISTS ${tgt_DLL} )
628- message ( STATUS " Chrono DLL ${tgt_DLL} " )
629- install ( FILES ${tgt_DLL} DESTINATION bin COMPONENT runtime )
630- endif ( )
631- if ( EXISTS ${tgt_DLL_d} )
632- install (FILES ${tgt_DLL_d} DESTINATION bin COMPONENT runtime )
633- endif ()
634- endforeach ()
637+ # Chrono DLLs — glob ALL DLLs from the Chrono bin directory to catch
638+ # transitive dependencies (e.g., Chrono_fsitdpf_vsg, yaml-cpp) that may
639+ # not be listed in CHRONO_TARGETS.
640+ get_target_property (_chrono_core_dll Chrono::Chrono_core IMPORTED_LOCATION_RELEASE )
641+ if (_chrono_core_dll )
642+ get_filename_component ( _chrono_dll_dir " ${_chrono_core_dll} " DIRECTORY )
643+ file ( GLOB _chrono_dlls " ${_chrono_dll_dir} /*.dll" )
644+ foreach (_dll ${_chrono_dlls} )
645+ message ( STATUS " Chrono DLL ${_dll} " )
646+ install (FILES " ${_dll} " DESTINATION bin COMPONENT runtime )
647+ endforeach ()
648+ endif ()
635649
636650 # HDF5 DLLs
637651 foreach (tgt ${HDF5_TARGETS} )
@@ -660,24 +674,42 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
660674 endif ()
661675 endif ()
662676
663- # Python DLLs, if Chrono::Parsers depends on it
664- if (CHRONO_PARSERS_PYTHON)
665- find_package (Python3 QUIET COMPONENTS Interpreter Development )
666- if (Python3_Interpreter_FOUND AND Python3_Development_FOUND)
667- #message(STATUS "Found Python and dependencies")
668- #message(STATUS " Python3_Interpreter_FOUND: ${Python3_Interpreter_FOUND}")
669- #message(STATUS " Python3_Development_FOUND: ${Python3_Development_FOUND}")
670- get_target_property (tgt_DLL Python3::Python IMPORTED_LOCATION_RELEASE )
671- get_target_property (tgt_DLL_d Python3::Python IMPORTED_LOCATION_DEBUG )
672- if (EXISTS ${tgt_DLL} )
673- message (STATUS " Python DLL ${tgt_DLL} " )
674- install (FILES ${tgt_DLL} DESTINATION bin COMPONENT runtime )
677+ # VSG DLLs (vsg, vsgImGui, vsgXchange, draco, etc.)
678+ if (HYDROCHRONO_ENABLE_VSG)
679+ # VSG_DLL_DIR is set by Chrono's find_package when VSG is found
680+ # Fall back to deriving from vsg_DIR if VSG_DLL_DIR is not set
681+ if (NOT DEFINED VSG_DLL_DIR OR VSG_DLL_DIR STREQUAL "" )
682+ if (DEFINED vsg_DIR)
683+ # vsg_DIR points to lib/cmake/vsg, go up 3 levels to root then into bin
684+ get_filename_component (_vsg_root "${vsg_DIR} " DIRECTORY ) # lib/cmake
685+ get_filename_component (_vsg_root "${_vsg_root} " DIRECTORY ) # lib
686+ get_filename_component (_vsg_root "${_vsg_root} " DIRECTORY ) # root
687+ set (VSG_DLL_DIR "${_vsg_root} /bin" )
675688 endif ()
676- if (EXISTS ${tgt_DLL_d} )
677- install (FILES ${tgt_DLL_d} DESTINATION bin COMPONENT runtime )
689+ endif ()
690+
691+ if (DEFINED VSG_DLL_DIR AND EXISTS "${VSG_DLL_DIR} " )
692+ file (GLOB _vsg_dlls "${VSG_DLL_DIR} /*.dll" )
693+ if (_vsg_dlls)
694+ message (STATUS "Installing VSG DLLs from: ${VSG_DLL_DIR} " )
695+ install (FILES ${_vsg_dlls} DESTINATION bin COMPONENT runtime )
678696 endif ()
697+ else ()
698+ message (WARNING "HYDROCHRONO_ENABLE_VSG is ON but VSG_DLL_DIR not found. VSG DLLs will not be packaged." )
679699 endif ()
680700 endif ()
701+
702+ # Python DLLs, if Chrono::Parsers depends on it.
703+ # Derive the DLL path from the already-found interpreter rather than calling
704+ # find_package(Python3 ... Development), which can stall on Windows/conda.
705+ if (CHRONO_PARSERS_PYTHON AND Python3_EXECUTABLE)
706+ get_filename_component (_py_bin_dir "${Python3_EXECUTABLE} " DIRECTORY )
707+ file (GLOB _py_dlls "${_py_bin_dir} /python3*.dll" )
708+ foreach (_py_dll ${_py_dlls} )
709+ message (STATUS " Python DLL ${_py_dll} " )
710+ install (FILES "${_py_dll} " DESTINATION bin COMPONENT runtime )
711+ endforeach ()
712+ endif ()
681713
682714endif ()
683715
@@ -699,6 +731,20 @@ install(PROGRAMS ${PROJECT_SOURCE_DIR}/scripts/RUN-TESTS.ps1
699731 DESTINATION tests COMPONENT python-tests)
700732
701733# MSVC runtime DLLs and ZIP packaging via CPack
734+ # InstallRequiredSystemLibraries handles msvcp/vcruntime/ucrt, but not vcomp (OpenMP).
735+ # Append the OpenMP runtime so it's included in the package.
736+ if (MSVC AND OpenMP_CXX_FOUND)
737+ get_filename_component (_msvc_dir "${CMAKE_CXX_COMPILER} " DIRECTORY )
738+ find_file (_vcomp_dll "vcomp140.dll"
739+ PATHS "${_msvc_dir} " "${_msvc_dir} /../../../redist/x64" "C:/Windows/System32"
740+ NO_DEFAULT_PATH )
741+ if (_vcomp_dll)
742+ list (APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${_vcomp_dll} " )
743+ message (STATUS " OpenMP DLL ${_vcomp_dll} " )
744+ else ()
745+ message (WARNING "vcomp140.dll not found — OpenMP runtime will be missing from package" )
746+ endif ()
747+ endif ()
702748include (InstallRequiredSystemLibraries )
703749set (CPACK_GENERATOR "ZIP" )
704750set (CPACK_PACKAGE_NAME "HydroChrono" )
0 commit comments