Skip to content

Make sure that cmake generate build files in current dir #194

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

meowtec
Copy link
Contributor

@meowtec meowtec commented Nov 22, 2023

This should fix the Error: could not load cache BUG.

If there are already generated build files in the project directory, then if you execute the command cmake path/project in $OUT_DIR/build, cmake will not generate new build files in the $OUT_DIR/build directory.

So -B . is needed. https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-B

Example:

cd /path/to/project
cmake .         
# output `Build files have been written to: /path/to/project`
cd /path/to/build && cmake /path/to/project
# we expect the build files will be generated at current dir (/path/to/build)
# but unfortunately get `Build files have been written to: /path/to/project`
cd /path/to/build && cmake /path/to/project -B .  
# output `Build files have been written to: /path/to/build`, that is right!

Infomation:

cmake --version
cmake version 3.27.7

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@tgross35 tgross35 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants