[CMake] CMAKE_CURRENT_LIST_FILE in CMake 2.6.3

Brad King brad.king at kitware.com
Wed Mar 25 10:38:41 EDT 2009


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



More information about the CMake mailing list