View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0012265 | CMake | CMake | public | 2011-06-10 17:52 | 2012-01-02 15:56 | ||||
Reporter | Stephen Kelly | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake-2-8 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0012265: ${CMAKE_CURRENT_LIST_DIR} called from a macro or function does not refer to the current directory | ||||||||
Description | This might be fully intentional, but I noticed that inside and macro or function the ${CMAKE_CURRENT_LIST_DIR} refers to the caller. I found a workaround by setting a variable in the top level. Is this a bug or is there another variable I should use? | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() | ||||||||
Relationships | |
Relationships |
Notes | |
(0026845) Alex Neundorf (developer) 2011-06-13 04:48 edited on: 2011-06-13 05:08 |
It behaves the same way as ${CMAKE_CURRENT_LIST_FILE}, so this behaviour is intentional. I can remember there were discussion(s) about this on the cmake or cmake-developers mailing list, and this was the outcome. Can't remember the details though. Alex |
(0027127) Brad King (manager) 2011-07-29 18:19 |
The behavior is as intended. The workaround you propose is already in common usage. Typically if I'm writing a module "MyModule.cmake" then I will put code at the top like get_filename_component(_MyModule_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) which is the pre-2.8.3 equivalent to set(_MyModule_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}) so I can refer to the module location inside functions or macros later. |
(0028116) David Cole (manager) 2012-01-02 15:56 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-06-10 17:52 | Stephen Kelly | New Issue | |
2011-06-10 17:52 | Stephen Kelly | File Added: cmakelistdir.tar.gz | |
2011-06-13 04:48 | Alex Neundorf | Note Added: 0026845 | |
2011-06-13 05:08 | Alex Neundorf | Note Edited: 0026845 | |
2011-07-29 18:19 | Brad King | Note Added: 0027127 | |
2011-07-29 18:19 | Brad King | Status | new => resolved |
2011-07-29 18:19 | Brad King | Resolution | open => no change required |
2011-07-29 18:19 | Brad King | Assigned To | => Brad King |
2012-01-02 15:56 | David Cole | Note Added: 0028116 | |
2012-01-02 15:56 | David Cole | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |