Re: [CMake] Check whether C++ headers are self-sufficient

2015-03-14 Thread Ryan Pavlik
I also have this implemented - in my case, the headers are fine to include in a .cpp with just a do-nothing main function and build into an executable, testing linking too. https://github.com/rpavlik/util-headers/blob/master/tests/cleanbuild/CMakeLists.txt Ryan On Sat, Mar 14, 2015 at 8:56 AM Ro

Re: [CMake] List all binaries associated with a target.

2015-03-14 Thread Roman Bolshakov
Here's an example function which addresses 1. It creates a string of generator expressions for direct and indirect dependencies of a target recursively. When all recursive invocations are done, it spits -deps file in the CURRENT_BINARY_DIR which contains full paths of the dependencies: function(st

Re: [CMake] ARGV processing in cmake -P

2015-03-14 Thread David Cole via CMake
Works for me with CMake 3.2.1 on Windows. What version of CMake are you using? C:\dev\dcole> type args.cmake foreach(n RANGE ${ARGC}) message(STATUS "${n} ${CMAKE_ARGV${n}}") endforeach() message(STATUS "${CMAKE_ARGV0}") message(STATUS "${CMAKE_ARGV1}") message(STATUS "${CMAKE_ARGV2}") C:\dev\

Re: [CMake] Check whether C++ headers are self-sufficient

2015-03-14 Thread Robert Maynard
I have worked on projects where we do something fairly similar. The significant difference is that we create only a single executable per directory. All told is it a fairly simple and looks something like: # Builds a source file and an executable that does nothing other than # compile the given he

Re: [CMake] Check whether C++ headers are self-sufficient

2015-03-14 Thread Andreas Naumann
Why do you want to use one library per header? I think, it would be sufficient to have one cc-file per header and one library per folder. The library would simply contain all files. Why do you worry about large build directories? Regards, Andreas Am 14.03.2015 um 13:19 schrieb Christoph GrĂ¼nin

[CMake] Check whether C++ headers are self-sufficient

2015-03-14 Thread Christoph GrĂ¼ninger
Dear CMakers, I want to have all my C++ headers self-sufficient (self-contained), i.e., a header can be included without additional includes. This is not only handy but also part of Google's C++ styleguide [2]. It would be great to have a make target (let's call it headercheck), that can check for