From eb1dc90dd2afd54b7589efaa7498934b701ccf8f Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Mon, 11 Nov 2024 10:38:20 +0100 Subject: [PATCH 1/5] moab not fetchable --- CMakeLists.txt | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ab2034a1..748809094 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(DAGMC) -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) enable_language(CXX) # Set DAGMC version @@ -59,7 +59,26 @@ if(BUILD_MCNP5 OR BUILD_MCNP6) enable_language(Fortran) endif() -find_package(MOAB REQUIRED) +include(FetchContent) + +# Try to find MOAB +# find_package(MOAB QUIET) + +if (NOT MOAB_FOUND) + message(STATUS "MOAB not found. Fetching MOAB...") + FetchContent_Declare( + moab + GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git + GIT BRANCH master + # GIT_TAG 5.5.1 + ) + FetchContent_MakeAvailable(moab) + add_subdirectory(${moab_SOURCE_DIR} ${moab_BINARY_DIR}) # MOAB repository is not properly configured for a FetchContent build + # Set MOAB_DIR to the fetched content + set(MOAB_DIR ${moab_SOURCE_DIR}) + find_package(MOAB REQUIRED) +endif() + find_package(OpenMP) dagmc_setup_flags() From f7212f5b1c91d351dcd663c9635c0c1d83170bf2 Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Mon, 11 Nov 2024 10:45:03 +0100 Subject: [PATCH 2/5] reduce diff --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 748809094..ec0f2c986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,12 +59,12 @@ if(BUILD_MCNP5 OR BUILD_MCNP6) enable_language(Fortran) endif() -include(FetchContent) # Try to find MOAB # find_package(MOAB QUIET) if (NOT MOAB_FOUND) + include(FetchContent) message(STATUS "MOAB not found. Fetching MOAB...") FetchContent_Declare( moab From 8c24276486eaa6a129451c8a8ed864bef7c0662f Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Mon, 11 Nov 2024 10:45:32 +0100 Subject: [PATCH 3/5] reduce diff --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec0f2c986..ebe8ed74c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,9 +59,7 @@ if(BUILD_MCNP5 OR BUILD_MCNP6) enable_language(Fortran) endif() - -# Try to find MOAB -# find_package(MOAB QUIET) +# find_package(MOAB REQUIRED) if (NOT MOAB_FOUND) include(FetchContent) From 86e36b59c1a6977a3c82e0c22cb340711a368e23 Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Mon, 11 Nov 2024 21:37:48 +0100 Subject: [PATCH 4/5] added _ --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebe8ed74c..a76e01597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ if (NOT MOAB_FOUND) FetchContent_Declare( moab GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git - GIT BRANCH master + GIT_BRANCH master # GIT_TAG 5.5.1 ) FetchContent_MakeAvailable(moab) From 7373741573e7c8a25df08a04fe76099d1101a5bb Mon Sep 17 00:00:00 2001 From: Jon Shimwell Date: Thu, 14 Nov 2024 16:21:28 +0100 Subject: [PATCH 5/5] making use of moab fork with changes --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a76e01597..a1a1347df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,14 +66,19 @@ if (NOT MOAB_FOUND) message(STATUS "MOAB not found. Fetching MOAB...") FetchContent_Declare( moab - GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git - GIT_BRANCH master + # making use of branch on fork as it has a one line change that help this fetch command work + # GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git + # GIT_BRANCH master # GIT_TAG 5.5.1 + GIT_REPOSITORY https://bitbucket.org/moab-fork/moab.git + GIT_TAG Jonathan-Shimwell/adding-current-to-dir + GIT_SHALLOW TRUE ) + FetchContent_MakeAvailable(moab) - add_subdirectory(${moab_SOURCE_DIR} ${moab_BINARY_DIR}) # MOAB repository is not properly configured for a FetchContent build + add_subdirectory(${moab_SOURCE_DIR} ${moab_BINARY_DIR}/moab-build) # Set MOAB_DIR to the fetched content - set(MOAB_DIR ${moab_SOURCE_DIR}) + set(MOAB_DIR ${moab_BINARY_DIR}/moab-build) find_package(MOAB REQUIRED) endif()