Feature: Reintroduce FetchContent#2303
Conversation
This reverts commit 9c31d89.
9b6430f to
762093d
Compare
970b2cf to
254c5d5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2303 +/- ##
=======================================
Coverage 79.42% 79.42%
=======================================
Files 115 115
Lines 19285 19285
=======================================
Hits 15318 15318
Misses 3967 3967 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
benegee
left a comment
There was a problem hiding this comment.
Awesome!
From what I can tell, this looks good so far!
| @@ -1,3 +1,12 @@ | |||
| # Updated dependencies | |||
|
|
|||
| We have switched from a submodules approach to a FetchContent approach for our dependencies towards p4est and sc. If you don't have already installed p4est and sc, calling cmake will install the right branch from their github. If you have p4est and sc installed already and want to use that version no further code will be downloaded. If your current configuration is to the internal p4est and sc installation you don't need to update your workflow. The submodules of p4est and sc should be removed with this update. Instead they will be downloaded and installed in the _deps folder in your build folder. | |||
There was a problem hiding this comment.
[...] dependencies on p4est [...]?
If you have already installed p4est [...]?
If you current configuration is to use the internal [...] ?
| - name: Get sc commit hash and url from thirdparty.json | ||
| run: | | ||
| hash=$(jq -r '.thirdparty[] | select(.name=="SC") .source.ref' cmake/thirdparty.json) | ||
| echo sc_commit=$hash >> $GITHUB_ENV |
There was a problem hiding this comment.
lower case GITHUB_ENV vars vs. upper case above.
Is this ok?
| MAKEFLAGS: ${{ matrix.MAKEFLAGS }} | ||
| IGNORE_CACHE: false # Use this to force a new installation of sc and p4est for this specific workflow run | ||
| CACHE_COUNTER: 0 # Increase this number to force a new installation of sc and p4est and to update the cache once | ||
| CACHE_COUNTER: 8 # Increase this number to force a new installation of sc and p4est and to update the cache once |
| # If the named option variable does not exist in the CMake cache, warn and proceed. | ||
| if(NOT DEFINED ${DEP_CMAKE_OPTION}) | ||
| message(FATAL_ERROR "Loading thirdparty library ${DEP_NAME} at index ${INDEX} references unknown CMake option '${DEP_CMAKE_OPTION}'. Aborting.") |
There was a problem hiding this comment.
FATAL_ERROR will abort, I think.
|
|
||
| message(STATUS "Configuring thirdparty library: ${DEP_NAME} (Type: ${DEP_TYPE}, SHALLOW: ${DEP_SHALLOW})") | ||
|
|
||
| #If Dep_SHALLOW is not a valid boolean, set it to FALSE and print a warning. |
There was a problem hiding this comment.
| #If Dep_SHALLOW is not a valid boolean, set it to FALSE and print a warning. | |
| # If Dep_SHALLOW is not a valid boolean, set it to FALSE and print a warning. |
|
|
||
| #If Dep_SHALLOW is not a valid boolean, set it to FALSE and print a warning. | ||
| if(NOT DEP_SHALLOW STREQUAL "TRUE" AND NOT DEP_SHALLOW STREQUAL "FALSE") | ||
| message(STATUS "Invalid value for 'shallow' in thirdparty library ${DEP_NAME}: '${DEP_SHALLOW}'. Expected 'true' or 'false'. Defaulting to 'false'.") |
There was a problem hiding this comment.
| message(STATUS "Invalid value for 'shallow' in thirdparty library ${DEP_NAME}: '${DEP_SHALLOW}'. Expected 'true' or 'false'. Defaulting to 'false'.") | |
| message(STATUS "Invalid value for 'shallow' in thirdparty library ${DEP_NAME}: '${DEP_SHALLOW}'. Expected 'TRUE' or 'FALSE'. Defaulting to 'FALSE'.") |
Or do you want to allow lower case values as well? (In this case TOLOWER has be used before the STREQUAL, I think)
| ############################################ ThirdParty ############################################ | ||
|
|
||
| # Set some variables for the thirdparty libraries | ||
| set(gtest_force_shared_crt ON CACHE INTERNAL "" FORCE) |
There was a problem hiding this comment.
| set(gtest_force_shared_crt ON CACHE INTERNAL "" FORCE) | |
| set( gtest_force_shared_crt ON CACHE INTERNAL "" FORCE ) |
| endif() | ||
|
|
||
| mark_as_advanced( FORCE gtest_disable_mpi) | ||
| # Capture the list of variables before adding the thirdparty libraries to mark the added ones as advanced. |
There was a problem hiding this comment.
Will this include the FETCHCONTENT variables, which are already marked in thirdparty.cmake?
Closes #2304
Describe your changes here:
Reintroduces FetchContent after its removal in #2289
Improvements in this PR:
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
scripts/internal/find_all_source_files.shto check the indentation of these files.License
doc/(or already has one).