On Thu, Jan 23, 2014 at 10:40:54AM +0100, Stephen Kelly wrote:
> Andreas Schuh wrote:
> 
> > On a side note, just today a co-worker asked me why the compiler cannot
> > find the header files when they were provided as additional arguments to
> > the add_executable command. Indeed this was a reasonable assumption, I
> > think. Why the need for an additional include_directories when I already
> > specified where the header files are located ? This is not something BASIS
> > is taking care of yet either, but would certainly be one of the things I
> > would consider adding.
> 
> This is the kind of concrete feedback *about cmake* that I'm looking for in 
> this discussion. It's self contained, refers to existing cmake 
> functionality, it's easy to imagine the 'user story' and what the user code 
> would look like etc.
> 
> I don't have any comment about the viability of adding such functionality to 
> cmake add_* commands though.

I'm not sure this can ever be viable because it makes assumptions that are
guaranteed to break for different use cases.

If I add a header, cmake can have no knowledge of how the sources use the
header.  Is it an absolute or relative include?  Does the relative include
also include a path?

In my projects, I have both static and generated headers.  All the sources
use absolute includes i.e <foo/bar/baz.h> and the CMakeLists.txt are located
at multiple levels inside the structure.  Other projects have the sources
and headers located separately and may not have any code generation (the
generated sources here are passed as absolute paths to add_executable).
Some projects have a mixture of public and private headers which use
absolute and relative paths.

I think the general sentiment that having add_executable remove a redundant
include_directories statement is a good one.  I'm just unconvinced that this
is doable in practice.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to