<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jan 24, 2014, at 12:49 PM, Stephen Kelly <<a href="mailto:steveire@gmail.com">steveire@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Roger Leigh wrote:<br><br><blockquote type="cite">On Thu, Jan 23, 2014 at 10:40:54AM +0100, Stephen Kelly wrote:<br><blockquote type="cite">Andreas Schuh wrote:<br><br><blockquote type="cite">On a side note, just today a co-worker asked me why the compiler cannot<br>find the header files when they were provided as additional arguments<br>to the add_executable command. Indeed this was a reasonable assumption,<br>I think. Why the need for an additional include_directories when I<br>already specified where the header files are located ? This is not<br>something BASIS is taking care of yet either, but would certainly be<br>one of the things I would consider adding.<br></blockquote><br>This is the kind of concrete feedback *about cmake* that I'm looking for<br>in this discussion. It's self contained, refers to existing cmake<br>functionality, it's easy to imagine the 'user story' and what the user<br>code would look like etc.<br><br>I don't have any comment about the viability of adding such functionality<br>to cmake add_* commands though.<br></blockquote><br>I'm not sure this can ever be viable because it makes assumptions that are<br>guaranteed to break for different use cases.<br><br>If I add a header, cmake can have no knowledge of how the sources use the<br>header.  Is it an absolute or relative include?  Does the relative include<br>also include a path?<br></blockquote><br>Exactly.<br></div></blockquote><div><br></div>That sounds all viable to me for having the separate mechanisms. But does CMake not already parse the C++ module files in order to determine the dependencies on header files ? I was in the believe that you do not actually need to specify the header files when calling add_executable because it would find out which are included by each specified .cpp file and add the appropriate file dependencies. If so, it would actually be able to determine the correct paths to add to the include search path. But I also see one problem left here. That for some projects the location of header files can differ between source/build tree and installation. I still would assume that in most cases the correct relative path can be deduced from the build configuration and dependency analysis of .cpp modules.</div><div><br></div><div>See also <a href="http://cmake.3232098.n2.nabble.com/Query-regarding-header-files-in-CMakeLists-txt-td7581689.html">http://cmake.3232098.n2.nabble.com/Query-regarding-header-files-in-CMakeLists-txt-td7581689.html</a></div><div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">I think the general sentiment that having add_executable remove a<br>redundant<br>include_directories statement is a good one.  I'm just unconvinced that<br>this is doable in practice.<br></blockquote><br>My thoughts exactly.<br><br>Thanks,<br><br>Steve.<br><br><br>--<span class="Apple-converted-space"> </span><br><br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br><br>Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br><br>CMake Support: <a href="http://cmake.org/cmake/help/support.html">http://cmake.org/cmake/help/support.html</a><br>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/training.html</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></div></blockquote></div><br></body></html>