The compiler feature "cxx_decltype" is not known to CXX compiler
I Like to compile a project on windows 7 using:
- cmake 3.13.4
- MinGW.org GCC-6.3..0-1
- Qt 5.9.1
This is the minimum CMakelist.txt that triggers the issue:
cmake_minimum_required(VERSION 3.5)
project(Rest)
set(CMAKE_CXX_STANDARD 14)
#Find the Qt5Core Library
find_package(Qt5 REQUIRED COMPONENTS Core)
set(QT_LIBRARIES Qt5::Core)
set(SOURCE_FILES
main.cpp
)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
Qt defines in Qt5CodeConfigExtras.cmake
set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)
If I comment this line, the project is successfully configured. Otherwise it fails with:
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error in CMakeLists.txt:
The compiler feature "cxx_decltype" is not known to CXX compiler
"GNU"
version 6.3.0.
What went wrong? Is there a way to debug the probing for cxx_decltype?
I have only found this related Qt bug: https://bugreports.qt.io/browse/QTBUG-57886?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true