错误的CMAKE\u二进制\u目录?

错误的CMAKE\u二进制\u目录?,cmake,freebsd,Cmake,Freebsd,我有以下琐碎的CMakeLists.txt(FreeBSD 9.1,CMake 2.8.11.2): 此文件位于/root/trunk/temp中。因为我想执行源代码外构建,所以我创建了一个同级目录temp2,并从那里调用cmake: root@:/root/trunk # mkdir temp2 root@:/root/trunk # cd temp2 root@:/root/trunk/temp2 # cmake ../temp /root/trunk/temp /root/trunk/te

我有以下琐碎的CMakeLists.txt(FreeBSD 9.1,CMake 2.8.11.2):

此文件位于
/root/trunk/temp
中。因为我想执行源代码外构建,所以我创建了一个同级目录
temp2
,并从那里调用
cmake

root@:/root/trunk # mkdir temp2
root@:/root/trunk # cd temp2
root@:/root/trunk/temp2 # cmake ../temp
/root/trunk/temp
/root/trunk/temp
-- Configuring done
-- Generating done
-- Build files have been written to: /root/trunk/temp
为什么
CMAKE\u BINARY\u DIR
CMAKE\u SOURCE\u DIR
是相同的?
我做错了什么?

正如@Fraser所建议的,问题是由于
cmakcache.txt
文件引起的,该文件留在
/root/trunk/temp

这是您的完整CMakeLists.txt?如果是,您应该尝试查看如果在上添加
cmake\u-minimum\u-required(版本2.8)
cmake\u-minimum\u-required(版本2.6)
top@Antonio是的,它是完整的文件-只是为了测试目的。IUUC,
cmake\u所需的最小值
不是强制性的,但无论如何,它的存在并不能解决上述问题。您是否在
/root/trunk/temp
中留下了一个CMakeCache.txt,这是以前尝试从
temp
而不是
temp2
中运行cmake时留下的!现在出于某种原因,CMake查找
/temp2/CMakeFiles/2.8.11.2/cmakecxcompiler.CMake
,但这已经是另一个问题:)。如果复制此文件,结果是正确的。@IgorR。也许你可以用弗雷泽的建议自己回答这个问题,这是一个有趣的问题!
root@:/root/trunk # mkdir temp2
root@:/root/trunk # cd temp2
root@:/root/trunk/temp2 # cmake ../temp
/root/trunk/temp
/root/trunk/temp
-- Configuring done
-- Generating done
-- Build files have been written to: /root/trunk/temp