KSpam wrote:
I attached a small example with the problem. The problem is actually a bit more complicated than my original explanation. I have a macro in my top-level CMakeLists.txt file:

macro (getScriptDir _scriptDir)
    get_filename_component(${_scriptDir} ${CMAKE_CURRENT_LIST_FILE} PATH)
endmacro (getScriptDir)

When I simply call get_filename_component from my included script, I get the right value, but when I call the macro I do not get the right value.

Thanks for the example.  There were two bugs canceling each other out for this
use case.  One was fixed in 2.6.3 which exposed the other.  I've committed a fix
and a test (the full commit log explains everything).

I'll schedule this for 2.6.4.

-Brad

BUG: Fix CMAKE_CURRENT_LIST_FILE in macros
/cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.cxx,v  <--  
Source/cmCommandArgumentParserHelper.cxx
new revision: 1.23; previous revision: 1.22
/cvsroot/CMake/CMake/Tests/MacroTest/CMakeLists.txt,v  <--  
Tests/MacroTest/CMakeLists.txt
new revision: 1.8; previous revision: 1.7
/cvsroot/CMake/CMake/Tests/MacroTest/context.cmake,v  <--  
Tests/MacroTest/context.cmake
initial revision: 1.1

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to