View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0010086 | CMake | CMake | public | 2009-12-30 00:58 | 2011-04-04 12:00 | ||||
Reporter | Uli M | ||||||||
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 | 0010086: SET_SOURCE_FILES_PROPERTIES faulty with sub dirs (still) | ||||||||
Description | See also bug 0002859 (I can't append notes to that so here's a new bug) Source file properties are not saved accross subdirs (at least not COMPILE_FLAGS). If this is intentional I have no idea how you could build a single lib from multiple subdirs without putting all the set_..._prop together in one cmake file.I've been using one static lib per dir before but now I'm generating shared libraries and that doesn't seem to go well with static libs. | ||||||||
Additional Information | Using cmake 2.8.0 you can reproduce it like this: -- CMakeLists.txt PROJECT(bla) set_source_files_properties( ${CMAKE_SOURCE_DIR}/test.c PROPERTIES COMPILE_FLAGS "-DSOMETHING") get_source_file_property(PROPS ${CMAKE_SOURCE_DIR}/test.c COMPILE_FLAGS) message("${PROPS}") add_subdirectory(sub) -- sub/CMakeLists.txt get_source_file_property(PROPS ${CMAKE_SOURCE_DIR}/test.c COMPILE_FLAGS) message("${PROPS}") The result being: ... -- Detecting CXX compiler ABI info - done -DSOMETHING NOTFOUND ... | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0023927) Brad King (manager) 2010-12-13 13:16 |
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:set_source_files_properties [^] "Source file properties are visible only to targets added in the same directory" http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:set_property [^] "Note that source file properties are visible only to targets added in the same directory" Yes, all the calls to set_source_file_properties need to occur in one directory, but that does not mean all the code has to be in one file. You can use include() to bring in a file from each subdirectory instead of using add_subdirectory(). BTW, I suggest using the COMPILE_DEFINITIONS property instead of -DFOO with COMPILE_FLAGS. |
(0026037) David Cole (manager) 2011-04-04 12:00 |
Closing resolved issues that have not been updated in more than 3 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2009-12-30 00:58 | Uli M | New Issue | |
2010-12-11 10:03 | Kovarththanan Rajaratnam | Relationship added | related to 0002859 |
2010-12-13 13:05 | Bill Hoffman | Assigned To | => Brad King |
2010-12-13 13:05 | Bill Hoffman | Status | new => assigned |
2010-12-13 13:16 | Brad King | Note Added: 0023927 | |
2010-12-13 13:17 | Brad King | Status | assigned => resolved |
2010-12-13 13:17 | Brad King | Resolution | open => no change required |
2011-04-04 12:00 | David Cole | Note Added: 0026037 | |
2011-04-04 12:00 | David Cole | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |