[CMake] Working directory issue with CMake 2.8.0

Yannick Mortier mvmortier at googlemail.com
Wed Nov 18 09:41:12 EST 2009


Hello!

We just tried out CMake 2.8.0 today and we found that our old CMake build
scripts don't work anymore.

One particular error was related to the handling of the current working
directory of the function
get_filename_component(FULLPATH ${SUBDIRECTORY} REALPATH)

I used this function in a small macro to get the full path of a subdirectory
in a certain CMakeLists.txt.

The behaviour of CMake 2.6.4 was to use the path of the CMakeLists.txt as
the working dir.
So for example calling this function on ../subdir in
c:\foo\bar\projectpart\CMakeLists.txt would have returned C:/foo/bar/subdir
Now the result of this function seems to depent from the working dir from
which cmake was called.
So if I have opened up my console window in c:\my\build\tree the same call
of this function returns c:/my/build/subdir

After calling this function I add the subdirectory using
add_subdirectory(${SUBDIRECTORY} PROJECTNAME) which works in both cases
regardless of what the working directory of the console window was.

I just checked the list of changes and I didn't find this listed there
officially. Was this an intentional change or is it a bug?

Greetings

Yannick Mortier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091118/36d664b0/attachment.htm>


More information about the CMake mailing list