【发布时间】:2010-01-13 23:17:23
【问题描述】:
假设我有一个项目,我已经在 .build 目录中运行了 CMake:
project/
.build/
.src
目前我必须这样做才能运行构建:
cd .build
make
我希望能够从我的项目的根目录运行 make,也许可以使用
make -f ./build/Makefile
但它不起作用。我收到这样的错误
make[1]: CMakeFiles/Makefile2: No such file or directory
make[1]: *** No rule to make target `CMakeFiles/Makefile2'. Stop.
make: *** [all] Error 2
这是因为 CMake 生成的 Makefile 假定其工作目录与其所在的位置相同 (.build)。
是否可以让 CMake 生成一个 makefile,以便 makefile 将工作目录更改为它所在的位置?
【问题讨论】:
标签: cmake