FILE(REMOVE) and FILE(APPEND) don't resolve relative filenames the same way

David Faure faure at kde.org
Fri Mar 6 14:54:32 CET 2009


Testcase:

macro(mymacro)
FILE(REMOVE out)
FILE(APPEND out "hello\n")
endmacro(mymacro)
add_subdirectory(subdir)

and in subdir/CMakeLists.txt:
mymacro()
mymacro()

Expected result: only one line "hello" in the file "subdir/out".
Actual result: two lines "hello" in the file "subdir/out".

It looks like FILE(REMOVE out) uses the "current dir of the macro" (i.e. the toplevel)
while FILE(APPEND out) uses the real "current dir" (subdir/).

Is this a bug, or is it expected behavior? I'll play with the commands to get
absolute paths in order to fix this for now...

-- 
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kde-buildsystem mailing list