Am Donnerstag, 15. August 2013, 14:37:42 schrieb Stephen Kelly: > Stephen Kelly wrote: > > Stephen Kelly wrote: > >> I still think you should revisit my review mail on point 2 too. > > > > Something that becomes possible when thinking about the above and target > > properties is interface requirements. > > I've implemented a prototype which has better API than your module. > > In my concept: > > * Applying the -std=c++11 flag is the responsibility of CMake, not the user. > > * CMake determines the -std= flag to use (GCC 4.9 has -std=c++1y by now). It > won't add '-std=c++11 -std=c++14', but just '-std=c++14' > > * Required compiler features are scoped to targets.
Can I get this globally? So I define once that all targets in my project get this? [Reading further] I assume I can set a global or directory property that will then propagate to all targets below. > * Target properties are set, exported and transitively evaluated track the > compiler features required. > > * Compiler requirements can be optional, in which case -D defines are > generated in the (PUBLIC) COMPILE_DEFINITIONS > > * The -D defines are for scoping or replacement, depending on what the > feature calls for. > > * Required compiler features are listed in the INTERFACE of exported > targets. CMake evaluates whether the compiler is capable of using the > IMPORTED targets it is supposed to use transitively, in a similar way to the > POSITION_INDEPENDENT_CODE feature. > > * A new command target_compiler_feature is introduced with two signatures: > > target_compiler_feature(<target> <PUBLIC|PRIVATE> > REQUIRED <feature1> [<feature2> ...]) > target_compiler_feature(<target> <PUBLIC|PRIVATE> > OPTIONAL <feature> DEFINE <define_name>) > > * Another non-target-scoped command could be introduced, similar to > target_compile_options -> add_compile_options. > > This is better in many noteworthy ways to the cxx11 topic in the stage. It solves an entirely different problem. My topic makes CMake detect which C++ features the compiler supports. Your topic is about how to get this to the targets and propagate it to the targets that use them. Eike
signature.asc
Description: This is a digitally signed message part.
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers