From a70afc9782aea663c4fe696487cd69a3ae2888a9 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 6 Dec 2024 06:56:49 +0100 Subject: [PATCH] add MOAB deps to all lib build within dagnmc --- .github/workflows/linux_build_test.yml | 5 +---- cmake/DAGMC_macros.cmake | 5 +++++ src/dagmc/CMakeLists.txt | 5 ----- src/pyne/CMakeLists.txt | 5 +---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linux_build_test.yml b/.github/workflows/linux_build_test.yml index 694636ba26..98202fe83f 100644 --- a/.github/workflows/linux_build_test.yml +++ b/.github/workflows/linux_build_test.yml @@ -96,13 +96,10 @@ jobs: git config --global --add safe.directory ${GITHUB_WORKSPACE} mkdir -p build cd build - echo ${hdf5_install_dir} - echo ${geant4_install_dir} cmake ../ \ -DMOAB_DIR=${moab_install_dir} \ -DBUILD_GEANT4=$([ "${{ matrix.geant4_version }}" != "off" ] && echo "ON" || echo "OFF") \ - -DDDL_INSTALL_DEPS=$([ "${{ matrix.ddl_deps }}" != "on" ] && echo "OFF" || echo "ON ") \ - -DHDF5_ROOT=${hdf5_install_dir} \ + -DDDL_INSTALL_DEPS=$([ "${{ matrix.ddl_deps }}" != "on" ] && echo "OFF" || echo "ON -DHDF5_ROOT=${hdf5_install_dir}") \ -DGEANT4_DIR=${geant4_install_dir} \ -DBUILD_CI_TESTS=ON \ -DBUILD_MW_REG_TESTS=OFF \ diff --git a/cmake/DAGMC_macros.cmake b/cmake/DAGMC_macros.cmake index 9fd0893e56..a9e7ea5e9e 100644 --- a/cmake/DAGMC_macros.cmake +++ b/cmake/DAGMC_macros.cmake @@ -251,6 +251,11 @@ macro (dagmc_install_library lib_name) EXPORT DAGMCTargets LIBRARY DESTINATION ${INSTALL_LIB_DIR} PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR}) + # Required to ensure that MOAB is built before DAGMC and to properly link against MOAB + if(DDL_INSTALL_DEPS) + add_dependencies(${lib_name}-shared MOAB) + target_link_libraries(${lib_name}-shared PUBLIC ${MOAB_INSTALL_PREFIX}/lib64/libMOAB.so) + endif() endif () if (BUILD_STATIC_LIBS) diff --git a/src/dagmc/CMakeLists.txt b/src/dagmc/CMakeLists.txt index af6cf93dee..2fbc05161a 100644 --- a/src/dagmc/CMakeLists.txt +++ b/src/dagmc/CMakeLists.txt @@ -14,11 +14,6 @@ include_directories(${CMAKE_BINARY_DIR}/src/dagmc) dagmc_install_library(dagmc) -# Required to ensure that MOAB is built before DAGMC and to properly link against MOAB -if(DDL_INSTALL_DEPS) - add_dependencies(dagmc-shared MOAB) - target_link_libraries(dagmc-shared PUBLIC ${MOAB_INSTALL_PREFIX}/lib64/libMOAB.so) -endif() add_subdirectory(tools) if (BUILD_TESTS) diff --git a/src/pyne/CMakeLists.txt b/src/pyne/CMakeLists.txt index 15e5a9a474..1ba6f4b4b3 100644 --- a/src/pyne/CMakeLists.txt +++ b/src/pyne/CMakeLists.txt @@ -34,7 +34,4 @@ if(NOT (${HDF5_VERSION} VERSION_LESS 1.12.0)) endif() dagmc_install_library(pyne_dagmc) -# Required to ensure that MOAB is built before pyne_dagmc -if(DDL_INSTALL_DEPS) - add_dependencies(pyne_dagmc-shared MOAB) -endif() +