Skip to content

Conversation

@benoitdudu
Copy link

Hi,

I made this pull request to resolve issue #419.

The drawback of the solution I found is that it requires cmake 3.18 because it rely on cmake_language(EVAL CODE) (https://cmake.org/cmake/help/latest/command/cmake_language.html).

I tried other things, but I never managed to get the error message when I test:
module(use "")

The solution comes from this blog https://crascit.com/2019/01/29/forwarding-command-arguments-in-cmake/

I ran the following commands to check:
make test
make testinstall

Best regards,
Benoît

@xdelaruelle
Copy link
Collaborator

Many thanks for your help on this topic.

Looking at CMake availability in various distribution (https://repology.org/project/cmake/versions), it seems ok to require CMake >= 3.18 for newer releases of Modules. Such requirement is met for instance on EL >= 8, Debian >= 11 or Ubuntu >= 22.04.

@benoitdudu benoitdudu force-pushed the cmake_function_forward_arguments branch from 86e8e3d to d894760 Compare October 20, 2025 04:20
@xdelaruelle xdelaruelle force-pushed the cmake_function_forward_arguments branch from d894760 to 736e2f6 Compare October 27, 2025 05:57
@xdelaruelle xdelaruelle added this to the 5.7.0 milestone Oct 27, 2025
benoitdudu and others added 3 commits October 27, 2025 07:01
…unction

Use cmake 'EVAL CODE' to handle any number of arguments. This change
mandates use of cmake >= 3.18.

The solution comes from the following blog post:
https://crascit.com/2019/01/29/forwarding-command-arguments-in-cmake/

Fixes envmodules#419

Signed-off-by: Benoit Dumas <[email protected]>
@xdelaruelle xdelaruelle force-pushed the cmake_function_forward_arguments branch from 736e2f6 to 02b5f18 Compare October 27, 2025 06:01
Apply same kind of code in init script than used on autoinit.

Signed-off-by: Xavier Delaruelle <[email protected]>
@xdelaruelle
Copy link
Collaborator

Many thanks again for this contribution. I have added commits to also apply this cmake code change to the init script and to the test utility.

Everything is ready. I will merge this pull request when the development for next feature release (5.7) will start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants