[CMake] Tweak CMake project to include non-buildable files in the CodeBlocks project file

Andreas Pakulat apaku at gmx.de
Mon Jan 12 07:47:42 EST 2015


Hi Nils,

On Mon, Jan 12, 2015 at 11:50 AM, Nils Gladitz <nilsgladitz at gmail.com>
wrote:

> On 01/12/2015 11:40 AM, Andreas Pakulat wrote:
>
>> Ah, that works. Its a little ugly in the CMake files but I guess I can
>> live with that. Ideally I was hoping to simply have a 'complete' list
>> including actual sources and sources for other platforms and hand that
>> to a special function - without passing the source-for-other-platform to
>> the actual target. Oh well, I have to stop dreaming :)
>>
>
> You can also use add_custom_target(my_new_target SOURCES src1.cpp
> src2.cpp).
>
> That will list the given sources in the IDE without adding build semantics
> to them.
>
> Since this lists the sources as part of a new target rather than an
> existing target this will be visually distinct from the other approach in
> some IDEs but should afaik make no difference in QtCreator.
>

Thanks for that idea, having a dedicated target wouldn't be so bad even if
its visible. With a bit of restructuring of the cmakelists.txt this may
actually make the file quite a bit more 'declarative' and less convoluted.

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150112/2eb74031/attachment.html>


More information about the CMake mailing list