View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011736CMakeCMakepublic2011-01-20 14:582011-06-17 18:23
ReporterAlex Neundorf 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.4 
Target VersionCMake 2.8.5Fixed in VersionCMake 2.8.5 
Summary0011736: SOURCES for add_custom_target() are not added to CodeBlocks, Eclipse and KDevelop projects
DescriptionFrom the mailing list:

On Thu, Jan 20, 2011 at 7:27 PM, Alexander Neundorf
> On Thursday 20 January 2011, Dimitri Kaparis wrote:
>> Greetings,
>>
>> the Code Blocks generator is not adding to the project the sources,
>> specified in the command.
>> In order to add a group of header files to my project tree, I'm trying
>> to implement the solution posted here:
>> http://www.cmake.org/pipermail/cmake/2010-November/040537.html [^]
>> The target itself is added to the Code Blocks project, however the
>> source files are not.
>> Should I file a bug report? Are there any other workarounds for that
>> use case, besides adding the headers to some other existing executable
>> or library target?
>>
>> This is under linux, with CMake release 2.8.3.
>
> add_custom_target() does not have a list of source files. Which behaviour do
> you expect ?
> Can you post a small example CMakeLists.txt and explain what you would
> expect ?
>

From the documentation at
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_custom_target [^]
:
"The SOURCES option specifies additional source files to be included
in the custom target. Specified source files will be added to IDE
project files for convenience in editing even if they have not build
rules."

What I'm trying to do is explained in the thread I linked to above. I
have a directory with some utility header files used by several
targets in my project. I want these headers to appear in the list of
sources in Code Block's generated project. So I add a custom target,
listing them as sources:

set(SRCS point.hpp
         box.hpp)
add_custom_target(GeometryHeaders SOURCES ${SRCS})

In Code Blocks, however, the header files do not appear in the project
source tree.
I just tried with the MSVC10 generator, and there this adds a project
with the sources listed.

Thanks,
Dimitri
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0025422)
Alex Neundorf (developer)
2011-02-13 17:01

For Eclipse nothing has to be done, files are not listed there, only directories.
For the KDevelop3 generator it's also not a big issue, since KDevelop3 will ask anyway whether it should add the unknown file to the project (... and KDevelop3 is not developed anymore).

Fixed it for the CodeBlocks generator, and pushed to the stage.
Should be in 2.8.4 or 2.8.5.

Alex

 Issue History
Date Modified Username Field Change
2011-01-20 14:58 Alex Neundorf New Issue
2011-01-20 14:58 Alex Neundorf Status new => assigned
2011-01-20 14:58 Alex Neundorf Assigned To => Alex Neundorf
2011-02-13 17:01 Alex Neundorf Note Added: 0025422
2011-02-13 17:01 Alex Neundorf Status assigned => closed
2011-02-13 17:01 Alex Neundorf Resolution open => fixed
2011-06-17 18:23 David Cole Fixed in Version => CMake 2.8.5
2011-06-17 18:23 David Cole Target Version => CMake 2.8.5


Copyright © 2000 - 2018 MantisBT Team