Yes, sadly. I have this code: if (NOT CMAKE_VERSION VERSION_LESS 3.1) set_property(TARGET osmium_convert PROPERTY CXX_STANDARD 11) target_compile_definitions(osmium_convert PRIVATE $<$<COMPILE_FEATURES:cxx_decltype_incomplete_return_types>:BOOST_RESULT_OF_USE_DECLTYPE>) endif()
So, in theory, this will set the definition if the compiler supports decltype, and just don't set it if not. And it works fine for g++. The problem is when it comes to MSVC: There is no MSVC version that supports this feature properly, so there is no variable for this compiler defined. Or just think of $FooBarC++, where noone cared to report the supported features. No variable either. For these compilers the above expression fails, because this is no recorded feature of the compiler. I would have expected it to just not set the definition, but not error out. So for now my code is: if (NOT CMAKE_VERSION VERSION_LESS 3.1 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ... Greetings, Eike
signature.asc
Description: This is a digitally signed message part.
-- 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-developers