View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002797CMakeCMakepublic2006-01-30 16:482006-01-31 10:47
ReporterAlex Neundorf 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002797: GET_FILENAME_PROPERTY(... ABSOLUTE) works only from CMAKE_SOURCE_DIR
DescriptionHi,

GET_FILENAME_COMPONENT(absPath main.c ABSOLUTE)
always assumes that the filename given is relative to CMAKE_SOURCE_DIR, not relative to CMAKE_CURRENT_SOURCE_DIR. This means that with the following dir structure:

~/src/CMakeLists.txt
~/src/sub/CMakeLists.txt
~/src/sub/main.c

if src/sub/CMakeLists.txt contains
GET_FILENAME_COMPONENT(absPath main.c ABSOLUTE)
it "returns" src/main.c instead of src/sub/main.c .
Attached you can find a simple testcase.

Alex
TagsNo tags attached.
Attached Filesgz file icon cmake_abs_path.tar.gz [^] (340 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0003627)
Brad King (manager)
2006-01-31 09:52

I'm assigning this bug to myself.
(0003642)
Brad King (manager)
2006-01-31 10:47

I've put in a fix:

/cvsroot/CMake/CMake/Source/cmGetFilenameComponentCommand.cxx,v <-- cmGetFilenameComponentCommand.cxx
new revision: 1.14; previous revision: 1.13

Please reopen the bug if it doesn't work.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team