MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013523 | CMake | CMake | public | 2012-09-06 20:20 | 2013-03-04 08:38 |
Reporter | szx | ||||
Assigned To | |||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | Any | OS | OS Version | ||
Product Version | CMake 2.8.9 | ||||
Target Version | Fixed in Version | ||||
Summary | 0013523: Function defined in a subdiretory can't see its global variables when called from outside | ||||
Description | Usually functions can read global variables that are set in the same directory. But this doesn't work when a function that is defined in a subdirectory is called from its parent directory. | ||||
Steps To Reproduce | 1. Create CMakeLists.txt with the following text: cmake_minimum_required(VERSION 2.8) set(FOO "bar") function(test) message("test(): FOO=${FOO}") endfunction() test() add_subdirectory(sub) sub_test() 2. Create a subdirectory called "sub" and another CMakeLists.txt in it: set(SUB_FOO "sub_bar") function(sub_test) message("sub_test(): SUB_FOO=${SUB_FOO}") endfunction() 3. Run cmake against the root directory Exptected output: test(): FOO=bar sub_test(): SUB_FOO=sub_bar Actual result: test(): FOO=bar sub_test(): SUB_FOO= | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | test.zip (805) 2012-09-06 20:20 https://public.kitware.com/Bug/file/4458/test.zip | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-09-06 20:20 | szx | New Issue | |||
2012-09-06 20:20 | szx | File Added: test.zip | |||
2012-09-07 04:07 | Rolf Eike Beer | Note Added: 0030952 | |||
2012-09-07 04:07 | Rolf Eike Beer | Status | new => resolved | ||
2012-09-07 04:07 | Rolf Eike Beer | Resolution | open => no change required | ||
2013-03-04 08:38 | Robert Maynard | Note Added: 0032441 | |||
2013-03-04 08:38 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|