MantisBT - CMake
View Issue Details
0007757CMakeCMakepublic2008-09-30 11:522008-10-01 14:15
James Bigler 
Bill Hoffman 
normalfeaturealways
closedfixed 
CMake-2-6 
 
0007757: Need mechanism to discover actual path of file on disc
CMAKE_CURRENT_SOURCE_DIR only reports the location of where CMake is processing a script. If a scrip is included via the include or find_package command CMAKE_CURRENT_SOURCE_DIR reports the location of where those calls were make and not where the included scripts live on disc.

I think it would be useful to be able to get access to the location of included scripts via a new variable CMAKE_CURRENT_DISC_DIR or something. The included scripts could be parsed while being included and replaced the CMAKE_CURRENT_DISC_DIR with the path of the file.

The reason I want this, is so I could use a library of additional CMake scripts that make use of other scripts and files used for the configure_file (which needs full paths). Currently, I have to put the library in the exact same place relative to my project so that CMAKE_CURRENT_SOURCE_DIR remains consistent within my CMake script library.
No tags attached.
Issue History
2008-09-30 11:53James BiglerNew Issue
2008-10-01 09:10Bill HoffmanNote Added: 0013628
2008-10-01 09:10Bill HoffmanStatusnew => assigned
2008-10-01 09:10Bill HoffmanAssigned To => Bill Hoffman
2008-10-01 13:58James BiglerNote Added: 0013658
2008-10-01 14:15Bill HoffmanStatusassigned => closed
2008-10-01 14:15Bill HoffmanResolutionopen => fixed

Notes
(0013628)
Bill Hoffman   
2008-10-01 09:10   
There is CMAKE_CURRENT_LIST_FILE, and you can get the path out of that?
(0013658)
James Bigler   
2008-10-01 13:58   
That was just what I needed. Thanks.