Skip to content

Commit

Permalink
Merge pull request #387 from GEOS-ESM/update_add_fortran_submodules
Browse files Browse the repository at this point in the history
Update the file esma_add_fortran_submodules.cmake
  • Loading branch information
mathomp4 authored Jul 11, 2024
2 parents e9479dd + 9940461 commit 3e06a91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [4.2.0] - 2024-07-11

### Fixed

- Add more features to the file `esma_add_fortran_submodules.cmake` so that the function `esma_add_fortran_submodules` can handle several level of subdirectories.

## [4.1.0] - 2024-06-21

### Added
Expand Down
8 changes: 7 additions & 1 deletion esma_support/esma_add_fortran_submodules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ function(esma_add_fortran_submodules)

set(input ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_SUBDIRECTORY}/${file})
set(output ${CMAKE_CURRENT_BINARY_DIR}/${ARG_SUBDIRECTORY}_${file})
set(esma_internal "esma_internal_${ARG_SUBDIRECTORY}_${file}")

add_custom_command(
OUTPUT ${output}
COMMAND ${CMAKE_COMMAND} -E copy ${input} ${output}
DEPENDS ${input}
)
set_property(SOURCE ${output} PROPERTY GENERATED 1)
add_custom_target(${esma_internal} DEPENDS ${output})

set_property(SOURCE ${output} TARGET_DIRECTORY ${ARG_TARGET} PROPERTY GENERATED 1)
add_dependencies(${ARG_TARGET} ${esma_internal})
target_sources(${ARG_TARGET} PRIVATE ${output})

endforeach()

endfunction()

0 comments on commit 3e06a91

Please sign in to comment.