我制作了以下文件/目录:
.
`-- project
|-- build
`-- CMakeLists.txt
使用 CMakeLists.txt 内容:
PROJECT(TEST)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
然后我进入 ./project/build 文件夹并运行cmake ..
[~/project/build] cmake ..
-- The C compiler identification is Intel 13.1.0.20130313
-- The CXX compiler identification is Intel 13.1.0.20130313
-- Check for working C compiler: /usr/local/bin/icc
-- Check for working C compiler: /usr/local/bin/icc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/icpc
-- Check for working CXX compiler: /usr/local/bin/icpc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: ~/project/build
所有生成的文件都在./project/build
文件夹中。
尝试打开您的 CMakeCache.txt 文件(它应该在您运行 CMake 的目录中生成)并检查 TEST_BINARY_DIR 和 CMAKE_CACHEFILE_DIR 等变量。例如,它们应该设置为您的构建目录。