From e0404cc4aa4e735df074b221e165b637f3a5096d Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Tue, 3 Dec 2024 13:27:15 -0600 Subject: [PATCH 1/3] localize git submodule stuff to only when BUILD_UWUW --- CMakeLists.txt | 16 ---------------- src/CMakeLists.txt | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3959566dda..cd6c24fcfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,22 +30,6 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") endif() option(GIT_SUBMODULE "Check submodules during build" ON) - if(GIT_SUBMODULE) - message(STATUS "Submodule update") - execute_process(COMMAND ${GIT_EXECUTABLE} "submodule" "update" "--init" "--recursive" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) - if(NOT GIT_SUBMOD_RESULT EQUAL 0) - message(FATAL_ERROR "git submodule update --init --recursive failed with \ - ${GIT_SUBMOD_RESULT}, please checkout submodules") - endif() - endif() -endif() - -# Check to see if submodules exist (by checking one) -if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/pyne/pyne/readme.rst") - message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \ - turned off or failed. Please update submodules and try again.") endif() # Make the scripts in the "cmake" directory available to CMake diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11fe95e9d5..239dc7a94f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,6 +15,23 @@ if (BUILD_MCNP5 OR BUILD_MCNP6 OR BUILD_GEANT4 OR BUILD_FLUKA OR BUILD_CI_TESTS) endif () if (BUILD_UWUW) add_subdirectory(uwuw) + + if(GIT_SUBMODULE) + message(STATUS "Submodule update") + execute_process(COMMAND ${GIT_EXECUTABLE} "submodule" "update" "--init" "--recursive" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMOD_RESULT) + if(NOT GIT_SUBMOD_RESULT EQUAL 0) + message(FATAL_ERROR "git submodule update --init --recursive failed with \ + ${GIT_SUBMOD_RESULT}, please checkout submodules") + endif() + endif() + + # Check to see if submodules exist (by checking one) + if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/pyne/pyne/readme.rst") + message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \ + turned off or failed. Please update submodules and try again.") + endif() add_subdirectory(pyne) endif () From 1db2d07bf3e9586172d4c170dd7640046c7223d9 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Tue, 3 Dec 2024 13:36:59 -0600 Subject: [PATCH 2/3] update changelog --- doc/CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGELOG.rst b/doc/CHANGELOG.rst index 572b4646d5..71e4daae4d 100644 --- a/doc/CHANGELOG.rst +++ b/doc/CHANGELOG.rst @@ -25,6 +25,7 @@ v3.2.4 * CMake error message update (#960) * Updated documentation to build dependencies (#963) * Pause support for Windows (#966) + * Localize invocation of git submodule for PyNE (#968) v3.2.3 ==================== From 08b56c5bcd70b716d0bda179f58abc9b97f8de6c Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Tue, 3 Dec 2024 13:40:05 -0600 Subject: [PATCH 3/3] fix path checked for submodule --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 239dc7a94f..e9a2df0848 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,7 @@ if (BUILD_UWUW) endif() # Check to see if submodules exist (by checking one) - if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/pyne/pyne/readme.rst") + if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/pyne/pyne/readme.rst") message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \ turned off or failed. Please update submodules and try again.") endif()