Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong CMAKE_BINARY_DIR?

Tags:

cmake

freebsd

I have the following trivial CMakeLists.txt (FreeBSD 9.1, CMake 2.8.11.2):

project(temp_proj CXX)
message(${CMAKE_BINARY_DIR})
message(${CMAKE_SOURCE_DIR})

This file is located in /root/trunk/temp. Since I want to perform an out-of-source build, I create a sibling directory temp2 and invoke cmake from there:

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

How comes CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR are the same? What am I doing wrong?

like image 327
Igor R. Avatar asked Jan 21 '26 16:01

Igor R.


1 Answers

As @Fraser suggested, the issue occurred because of CMakeCache.txt file, which was left in /root/trunk/temp.

like image 165
Igor R. Avatar answered Jan 24 '26 07:01

Igor R.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!