[CMake] Bug? Broken header files in Visual C++ 2008 project

BRM bm_witness at yahoo.com
Thu Aug 28 13:16:48 EDT 2008


My objection is to do thing following (taken from John's example):

ADD_EXECUTABLE( CropDICOMImages ${UPMC_CROP_SRCS}
${UPMC_CROP_MOC_SRCS} ${UPMC_CROP_HDRS}
${UPMC_CROP_MOC_HDR} ${UPMC_CROP_RC_SRCS} ${UPMC_CROP_UI_HDRS}
)

I would rather having something like this instead:

ADD_HEADER( CropDICOMImages  ${UPMC_CROP_HDRS}
${UPMC_CROP_MOC_HDR} ${UPMC_CROP_UI_HDRS}
)
ADD_EXECUTABLE( CropDICOMImages ${UPMC_CROP_SRCS}
${UPMC_CROP_MOC_SRCS} ${UPMC_CROP_RC_SRCS}
)



The
first tells me all that stuff goes into compiling the project; but it
ends up making things confusing as it ends up calling the headers
"source".

The second tells me that the *_SRCS actually make up
the executable, and the *_HDRS are just headers and NOT part of the
source but something else.

When working with projects I tend to
put headers into different areas based on their use - are they solely
for that project (okay, #include "<header>" and its in the same
directory), or are they shared (okay, #include <header>, and its
in a common include directory).  In some respects, it would be nice to
be able to even differentiate them in the IDE - common headers vs.
project headers - but that could probably be done using the filters,
etc. (no biggie); _BUT_ I can't get them to even come up unless I treat
them as SOURCE, which they are not - they're just definitions of what
is in the source for shared usage.

This is probably what has kept me from using KDevelop3 as much too - I tend towards using CMake to generate Makefiles under Linux b/c it's easier to get to things than trying to find a source file with
the header in KDevelop3 since I can't (by CMake's functionality) add
headers to the project.  It's the same with Visual Studios,
though I have tended to use VS more for other reasons. (I haven't
decided on an IDE under Linux, and have historically just used
Vi+virtual consoles/konsole to do development; where as all my Windows
development has typically been under Visual Studios.)

Any
how...I think the differentiation (clarity) provided by the
ADD_HEADER() proposed above would be good and helpful to a lot of
others than just myself.

Ben

P.S. John - sorry for the double post to you; meant to send it to the list initially.


----- Original Message ----
From: John Drescher <drescherjm at gmail.com>
To: BRM <bm_witness at yahoo.com>; CMake Mailinglist <cmake at cmake.org>
Sent: Thursday, August 28, 2008 10:16:18 AM
Subject: Re: [CMake] Bug? Broken header files in Visual C++ 2008 project

> What about those of us that do not want the header files compiled (no
> pre-compiled headers, etc.), but still want the folders to show up in Visual
> Studio (or any other IDE)?
>
That is how it works in my example.

John



More information about the CMake mailing list