Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake list does not append to lists in the parent scope #20

Closed
kidder opened this issue May 25, 2017 · 2 comments
Closed

cmake list does not append to lists in the parent scope #20

kidder opened this issue May 25, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@kidder
Copy link
Member

kidder commented May 25, 2017

The cmake command

list(APPEND A_LIST STUFF_TO_APPEND)

will only append to A_LIST in the current scope.

We need to fix this in multiple locations for adding external libraries.
The proposed fix is to define a new cmake function

append_to_list(...)

which uses the cmake function set which can modify a variable in the PARENT_SCOPE

@kidder kidder added the bug label May 26, 2017
@kidder kidder added this to the Version 0.0.1 milestone May 26, 2017
@nilsdeppe
Copy link
Member

We might be able to just use set(SPECTRE_TESTS "${SPECTRE_TESTS};${UTILITIES_TESTS}" PARENT_SCOPE), for example.

@kidder
Copy link
Member Author

kidder commented Jun 16, 2017

This is actually not an issue for external libraries as the Setup*.cmake files are included into the top-level CMakeLists.txt and therefore the lists are in the global scope.

@kidder kidder closed this as completed Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants