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 variables are not translated to parent scope with add_subdirectory #1

Closed
ClausKlein opened this issue May 5, 2022 · 5 comments · Fixed by #5
Closed

Cmake variables are not translated to parent scope with add_subdirectory #1

ClausKlein opened this issue May 5, 2022 · 5 comments · Fixed by #5
Labels
bug Something isn't working question Further information is requested

Comments

@ClausKlein
Copy link
Contributor

ClausKlein commented May 5, 2022

Some of the used CMake variable are not exported to parent scope.

It is not clear to me how this works, if it works right?
The exported packages are not checked so the result is undefined!

see https://github.com/ClausKlein/cpp_cmake_project/runs/6308595865?check_suite_focus=true#step:6:81
and ClausKlein/cpp_cmake_project@5085bd4

@aminya aminya added the question Further information is requested label May 5, 2022
@aminya
Copy link
Owner

aminya commented May 5, 2022

These are local variables. They are not exported.

@aminya aminya closed this as completed May 5, 2022
@ClausKlein
Copy link
Contributor Author

but they are use at package_project() and not defined at this scope!

@ClausKlein
Copy link
Contributor Author

@ClausKlein
Copy link
Contributor Author

IMHO some of the CMake settings are magic (or obscure)
see https://github.com/ClausKlein/cpp_cmake_project/pull/1/files

@aminya aminya changed the title The cmake configuration is not correct or obscure? Cmake variables are not translated to parent scope with add_subdirectory May 5, 2022
@aminya aminya added the bug Something isn't working label May 5, 2022
@aminya aminya reopened this May 5, 2022
@aminya
Copy link
Owner

aminya commented May 5, 2022

I was wrong about add_subdirectory. The variables are not passed to the parent scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants