-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #409 from GEOS-ESM/develop
GitFlow: Merge develop into main for release
- Loading branch information
Showing
5 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function(esma_capture_mepo_status) | ||
|
||
# Step 1: Set the path to the .mepo directory | ||
set(MEPO_DIR "${CMAKE_SOURCE_DIR}/.mepo") | ||
set(OUTPUT_FILE_NAME "MEPO_STATUS.rc") | ||
set(OUTPUT_FILE "${CMAKE_BINARY_DIR}/${OUTPUT_FILE_NAME}") | ||
|
||
if(EXISTS "${MEPO_DIR}") | ||
message(DEBUG ".mepo directory found") | ||
|
||
# Step 2: Check for the `mepo` command | ||
find_program(MEPO_COMMAND mepo) | ||
|
||
if(MEPO_COMMAND) | ||
message(DEBUG "Found mepo command at ${MEPO_COMMAND}") | ||
|
||
# Step 3: Run `mepo status --hashes` and capture the output | ||
execute_process( | ||
COMMAND ${MEPO_COMMAND} status --hashes | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_FILE "${OUTPUT_FILE}" | ||
RESULT_VARIABLE MEPO_STATUS_RESULT | ||
) | ||
|
||
if(NOT MEPO_STATUS_RESULT EQUAL 0) | ||
message(WARNING "mepo state and command were found but failed to run mepo status --hashes. This is odd.") | ||
else() | ||
message(STATUS "mepo status output captured in ${OUTPUT_FILE_NAME}") | ||
|
||
# Step 4: Install the output file in the etc directory | ||
install( | ||
FILES "${OUTPUT_FILE}" | ||
DESTINATION etc | ||
) | ||
endif() | ||
else() | ||
message(DEBUG "mepo command not found, skipping mepo status") | ||
endif() | ||
else() | ||
message(DEBUG ".mepo directory not found, skipping mepo status check") | ||
endif() | ||
|
||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters