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

Document usage of CMake cache variables VERSION_OUT_DIR and VERSION_SOURCE_DIR #5

Open
BojanSof opened this issue Jan 14, 2024 · 0 comments

Comments

@BojanSof
Copy link

BojanSof commented Jan 14, 2024

I think it is a good idea to document CMake cache variables VERSION_OUT_DIR and VERSION_SOURCE_DIR in README, for projects where CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR can't be used as their values.
One example is incorporating external library which uses Version.cmake into project based on Zephyr RTOS, using their tool west.
As CMake is invoked in the Zephyr RTOS project, CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR refer to the zephyr project and git commands are invoked on incorrect project.

This can be circumvented, for example, if VERSION_OUT_DIR and VERSION_SOURCE_DIR are set to CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR respectively, before invoking find_package(Version.cmake) in the external library CMakeLists.txt.

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

No branches or pull requests

1 participant