Skip to content

Commit

Permalink
Use c++17 when using Qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinDelille committed Jul 5, 2022
1 parent 561146e commit 9826af8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions QXlsx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOMOC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(GNUInstallDirs)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui REQUIRED)

if (QT_MAJOR_VERSION EQUAL 6)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)

if(NOT DEFINED ${QXLSX_PARENTPATH})
Expand Down

0 comments on commit 9826af8

Please sign in to comment.