Skip to content

Commit

Permalink
fix: cmake samuraiConfig bug (#255)
Browse files Browse the repository at this point in the history
<!-- Thank you for your contribution to samurai! -->

<!-- Please check the following before submitting your PR -->
- [ x] I have installed [pre-commit](https://pre-commit.com/) locally
and use it to validate my commits.
- [ x] The PR title follows the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) convention.
Available tags: 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf',
'refactor', 'revert', 'style', 'test'
- [ x] This new PR is documented.
- [ x] This new PR is tested.

## Description
Fix the right variable names into samuraiConfig.cmake.in.
Fix also typo in CMakeLists.txt for Field container list (while not yet
encountering issue with these lines).

## Related issue
Before that fix, cmake was complaining "string no output variable
specified" pointing to samuraiConfig.cmake line 81.

## How has this been tested?
<!-- Give the list of files used to test this new implementation. -->

## Code of Conduct
By submitting this PR, you agree to follow our [Code of
Conduct](https://github.com/hpc-maths/samurai/blob/master/docs/CODE_OF_CONDUCT.md)
- [x ] I agree to follow this project's Code of Conduct

Co-authored-by: Nicolas Grenier <nicolas.grenier@lisn.upsaclay.fr>
  • Loading branch information
Grenier and Grenier authored Jan 13, 2025
1 parent b894b8a commit 265ee64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ if(SAMURAI_CONTAINER_LAYOUT_COL_MAJOR)
endif()

if(NOT SAMURAI_FIELD_CONTAINER IN_LIST FIELD_CONTAINER_LIST)
message(FATAL_ERROR "SAMURAI_FIELD_CONTAINER must be one of: ${FLUX_CONTAINER_LIST}")
message(FATAL_ERROR "SAMURAI_FIELD_CONTAINER must be one of: ${FIELD_CONTAINER_LIST}")
else()
string(TOUPPER ${SAMURAI_FIELD_CONTAINER} SAMURAI_FIELD_CONTAINER)
target_compile_definitions(samurai INTERFACE SAMURAI_FIELD_CONTAINER_${SAMURAI_FIELD_CONTAINER})
Expand Down
4 changes: 2 additions & 2 deletions cmake/samuraiConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ set_property(CACHE SAMURAI_FLUX_CONTAINER PROPERTY STRINGS ${FLUX_CONTAINER_LIST
if(NOT SAMURAI_FLUX_CONTAINER IN_LIST FLUX_CONTAINER_LIST)
message(FATAL_ERROR "SAMURAI_FLUX_CONTAINER must be one of: ${FLUX_CONTAINER_LIST}")
else()
string(TOUPPER ${FLUX_CONTAINER} FLUX_CONTAINER)
target_compile_definitions(samurai::samurai INTERFACE FLUX_CONTAINER_${FLUX_CONTAINER})
string(TOUPPER ${SAMURAI_FLUX_CONTAINER} SAMURAI_FLUX_CONTAINER)
target_compile_definitions(samurai::samurai INTERFACE SAMURAI_FLUX_CONTAINER_${SAMURAI_FLUX_CONTAINER})
endif()

0 comments on commit 265ee64

Please sign in to comment.