diff --git a/.github/workflows/linux_build_test.yml b/.github/workflows/linux_build_test.yml index 694636ba2..98202fe83 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 9fd0893e5..a9e7ea5e9 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 af6cf93de..2fbc05161 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 15e5a9a47..1ba6f4b4b 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() +