MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0014057 | CMake | CMake | public | 2013-04-02 10:56 | 2016-06-10 14:31 |
| Reporter | szx | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Summary | 0014057: Add GROUP_SOURCES property for targets | ||||
| Description | It would be nice if there was a property that automatically grouped target's soruce files on directory basis, similar to what source_group() does. set_target_properties(foo PROPERTIES GROUP_SOURCES ON) | ||||
| Steps To Reproduce | |||||
| Additional Information | At the moment this can be achieved with e.g. a macro like this: function(group_target_sources target) get_target_property(sources ${target} SOURCES) foreach(file ${sources}) get_filename_component(path "${file}" ABSOLUTE) get_filename_component(path "${path}" PATH) if(file MATCHES "${PROJECT_BINARY_DIR}") file(RELATIVE_PATH path ${PROJECT_BINARY_DIR} "${path}") else() file(RELATIVE_PATH path ${PROJECT_SOURCE_DIR} "${path}") endif() string(REGEX REPLACE "/" "\\\\" win_path "${path}") source_group("${win_path}" REGULAR_EXPRESSION "${path}/[^/\\]+\\..*") endforeach() endfunction() (in fact this is what I use in personal projects) | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2013-04-02 10:56 | szx | New Issue | |||
| 2016-06-10 14:28 | Kitware Robot | Note Added: 0042260 | |||
| 2016-06-10 14:28 | Kitware Robot | Status | new => resolved | ||
| 2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot | ||
| 2016-06-10 14:31 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||