<div dir="ltr">I think your question about CXX_STANDARD is answered in the CXX_STANDARD docs:<div><a href="http://www.cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD.html">http://www.cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD.html</a><br></div><div><br></div><div>If you MUST have it, you can set this property to ON:</div><div><a href="http://www.cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD_REQUIRED.html">http://www.cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD_REQUIRED.html</a><br></div><div><br></div><div>(Although I've not used it myself -- not sure what happens if the compiler does not support the standard. Hopefully, an error at CMake time... try it and let us know if it works for you.)</div><div><br></div><div><br></div><div>HTH,</div><div>David C.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 2:15 PM, Daniel Schepler <span dir="ltr"><<a href="mailto:dschepler@scalable-networks.com" target="_blank">dschepler@scalable-networks.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(Whoops, accidentally sent this via private email before.)<br>
<br>
My question was about this part of the example:<br>
<br>
add_executable(consumer_with consumer_with.cpp)<br>
target_link_libraries(consumer_with foo)<br>
set_property(TARGET consumer_with CXX_STANDARD 11)<br>
<br>
add_executable(consumer_no consumer_no.cpp)<br>
target_link_libraries(consumer_no foo)<br>
<br>
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?<br>
--<br>
Daniel<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
-----Original Message-----<br>
From: Robert Maynard [mailto:<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>]<br>
Sent: Wednesday, October 29, 2014 10:43 AM<br>
To: Daniel Schepler<br>
Cc: CMake MailingList<br>
Subject: Re: [CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!<br>
<br>
You can find the known compile features that can be detected at:<br>
<a href="http://www.cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html" target="_blank">http://www.cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html</a><br>
<br>
At the end of the compile-features manual page ( <a href="http://www.cmake.org/cmake/help/v3.1/manual/cmake-compile-features.7.html" target="_blank">http://www.cmake.org/cmake/help/v3.1/manual/cmake-compile-features.7.html</a><br>
) there is a section on how to mark a library as having conditional support on C++11 features.<br>
<br>
<br>
On Wed, Oct 29, 2014 at 12:58 PM, Daniel Schepler <<a href="mailto:dschepler@scalable-networks.com">dschepler@scalable-networks.com</a>> wrote:<br>
> 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?<br>
><br>
> 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.<br>
> --<br>
> Daniel<br>
><br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">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" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">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" target="_blank">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" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">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" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>