(Whoops, accidentally sent this via private email before.)

My question was about this part of the example:

add_executable(consumer_with consumer_with.cpp)
target_link_libraries(consumer_with foo)
set_property(TARGET consumer_with CXX_STANDARD 11)

add_executable(consumer_no consumer_no.cpp)
target_link_libraries(consumer_no foo)

The question is: how do I detect whether CXX_STANDARD 11 is available before 
running the "set_property(TARGET consumer_with CXX_STANDARD 11)" line?
--
Daniel


-----Original Message-----
From: Robert Maynard [mailto:robert.mayn...@kitware.com] 
Sent: Wednesday, October 29, 2014 10:43 AM
To: Daniel Schepler
Cc: CMake MailingList
Subject: Re: [CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!

You can find the known compile features that can be detected at:
http://www.cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html

At the end of the compile-features manual page ( 
http://www.cmake.org/cmake/help/v3.1/manual/cmake-compile-features.7.html
) there is a section on how to mark a library as having conditional support on 
C++11 features.


On Wed, Oct 29, 2014 at 12:58 PM, Daniel Schepler 
<dschep...@scalable-networks.com> wrote:
> Where would I find the list of available C++ language features?  For 
> instance, I would suppose there's one for "auto", one for move 
> constructors/assignment operators, and one for "= delete" of default 
> constructors/destructors et al.  These are probably the ones we'd be most 
> interested in here, for the moment.  (Though with our requirements to support 
> older C++ compilers, we might not actually be able to use auto, as the 
> fallback would need the full type anyway.)  Also, is there a portability 
> macro provided for the "= delete" feature?
>
> Also, how would I mark a target so that it activates C++11 features if 
> available, but falls back to old C++ if not?  I do see the section on 
> detecting compiler features, but it's not clear to me how exactly how I'd 
> make the target use CXX_STANDARD 11 only if available.
> --
> Daniel
>
> --
>
> 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://public.kitware.com/mailman/listinfo/cmake

-- 

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://public.kitware.com/mailman/listinfo/cmake

Reply via email to