View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0014008 | CMake | CMake | public | 2013-03-13 05:37 | 2014-05-26 17:09 | ||||
Reporter | Magnus | ||||||||
Assigned To | Alex Neundorf | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | AMD64 | OS | Linux | OS Version | ArchLinux | ||||
Product Version | CMake 2.8.10.2 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0014008: Eclipse generator - grouping header files with non-standard suffix in the 'Header Files' folder | ||||||||
Description | The Eclipse project generator creates a number of (virtual) folders created for each target. The targets C/C++ files are put into 'Source Files' and header files with standard suffixes, e.g. .h, are put into 'Header Files'. This works as expected. It's not uncommon in the wild to use different suffixes for automatically generated files, e.g. in a project I work on all auto-generated headers have a .inc suffix. These files do not get added to the 'Header Files' folder, instead they end up on the target's top level. | ||||||||
Steps To Reproduce | Create a CMakeLists.txt with the following contents: cmake_minimum_required(VERSION 2.8) project( test ) enable_language( C ) add_executable( silly silly.c silly.h non-standard.inc ) Generate an Eclipse project and load it. You'll see something like what's shown in the attached picture. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | non-standard-header.png [^] (33,748 bytes) 2013-03-13 05:37
| ||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0032948) Alex Neundorf (developer) 2013-04-28 09:29 |
The Eclipse generator uses the cmake source-groups feature to create those subfolders. Did you try playing around with the source_group() command to achieve a grouping you like ? The "Header Files" group is created automatically using the name "Header Files" and the regex "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$". I'm not sure whether it is possible to override/redefine the regex for a built-in source group. If that does not work, you can create a new group, e.g. something like source_group("Generated files" REGULAR_EXPRESSION "....") |
(0033278) Magnus (reporter) 2013-06-12 07:14 edited on: 2013-06-12 07:19 |
I modified the CMakeLists.txt file to look like this: cmake_minimum_required(VERSION 2.8) project( test ) enable_language( C ) source_group("Generated headers" REGULAR_EXPRESSION ".*\\.inc$") add_executable( silly silly.c silly.h non-standard.inc ) The *.inc file is still not in a group, and there is not even a group called "Generated headers". |
(0035934) Alex Neundorf (developer) 2014-05-26 17:09 |
I tested this here with cmake 3.0.0 rc2 and Eclipse Kepler, and using the source_group() command this works without problems for me. This is my CMakeLists.txt: cmake_minimum_required(VERSION 2.8) source_group("Header Files" REGULAR_EXPRESSION "\\. (h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl|blub)$") add_executable(hello main.c foo.h bar.blub) Both foo.h as well as bar.blub show up in the folder "Header Files" under the target "hello". So I'm closing this ticket. If I missed something, fell free to reopen it. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2013-03-13 05:37 | Magnus | New Issue | |
2013-03-13 05:37 | Magnus | File Added: non-standard-header.png | |
2013-03-13 17:35 | Alex Neundorf | Assigned To | => Alex Neundorf |
2013-03-13 17:35 | Alex Neundorf | Status | new => assigned |
2013-04-28 09:29 | Alex Neundorf | Note Added: 0032948 | |
2013-06-12 07:14 | Magnus | Note Added: 0033278 | |
2013-06-12 07:19 | Magnus | Note Edited: 0033278 | |
2013-06-30 15:12 | Alex Neundorf | Relationship added | related to 0014261 |
2014-05-26 17:09 | Alex Neundorf | Note Added: 0035934 | |
2014-05-26 17:09 | Alex Neundorf | Status | assigned => closed |
2014-05-26 17:09 | Alex Neundorf | Resolution | open => no change required |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |