View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014194CMakeCMakepublic2013-06-04 05:462013-11-04 09:33
ReporterYichao Yu 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSArch LinuxOS Version
Product VersionCMake 2.8.11 
Target VersionCMake 2.8.12Fixed in VersionCMake 2.8.12 
Summary0014194: CMAKE_PARENT_LIST_FILE is not clearly documented
DescriptionIn the documentation of the variable it says,
    this variable will always be set to the listfile that included or somehow invoked the one currently being processed.

since AFAIK include and add_subdirectory are the most common ways to "include or somehow invoke" a list file, add_subdirectory should be included in "somehow invoked".

However, in a CMakeLists.txt that is "included or somehow invoked" by add_subdirectory, CMAKE_PARENT_LIST_FILE is always the same with CMAKE_CURRENT_LIST_FILE. I'm not sure if this is a bug in cmake or the document, but I think either the variable should be set to the list file that `add_subdirectory` the current list file, or it should be more clear in the documentation that the variable is the same with CMAKE_CURRENT_LIST_FILE for CMakeLists.txt's that are add_subdirectory'd.
Steps To Reproduceif(CMAKE_CURRENT_LIST_FILE STREQUAL CMAKE_PARENT_LIST_FILE)
  message("CMAKE_CURRENT_LIST_FILE == CMAKE_PARENT_LIST_FILE")
else()
  message("CMAKE_CURRENT_LIST_FILE != CMAKE_PARENT_LIST_FILE")
endif()

for files that are include'd it always prints != (well unless it is a self include.....) for files that are add_subdirectory'd it always prints == ....
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0033223)
Brad King (manager)
2013-06-04 08:25

Documentation clarified:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b62d440e [^]
(0034361)
Robert Maynard (manager)
2013-11-04 09:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-06-04 05:46 Yichao Yu New Issue
2013-06-04 08:25 Brad King Note Added: 0033223
2013-06-04 08:25 Brad King Assigned To => Brad King
2013-06-04 08:25 Brad King Status new => resolved
2013-06-04 08:25 Brad King Resolution open => fixed
2013-06-04 08:25 Brad King Fixed in Version => CMake 2.8.12
2013-06-04 08:25 Brad King Target Version => CMake 2.8.12
2013-06-04 08:25 Brad King Summary CMAKE_PARENT_LIST_FILE has wrong value. => CMAKE_PARENT_LIST_FILE is not clearly documented
2013-11-04 09:33 Robert Maynard Note Added: 0034361
2013-11-04 09:33 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team