-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect c++ standard if already defined
- Loading branch information
1 parent
d92ae5a
commit 1cd3798
Showing
4 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
commit e53efc535340dc74120c53b83b6462ae9144e39d | ||
Author: Martin Delille <[email protected]> | ||
Date: Tue Jul 5 10:33:47 2022 +0200 | ||
|
||
Use c++17 when using Qt 6 | ||
|
||
diff --git a/QXlsx/CMakeLists.txt b/QXlsx/CMakeLists.txt | ||
index d82b479..527866c 100644 | ||
--- a/QXlsx/CMakeLists.txt | ||
+++ b/QXlsx/CMakeLists.txt | ||
@@ -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}) |
25 changes: 25 additions & 0 deletions
25
recipes/qxlsx/all/patches/0004-defined-cpp-standard-only-if-need.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
commit 9072fc1b7160fd67123a39cf9590db5133de51ec | ||
Author: Martin Delille <[email protected]> | ||
Date: Fri Jul 22 10:21:54 2022 +0200 | ||
|
||
Define cpp standard only if not defined | ||
|
||
diff --git a/QXlsx/CMakeLists.txt b/QXlsx/CMakeLists.txt | ||
index 527866c..7e59cc5 100644 | ||
--- a/QXlsx/CMakeLists.txt | ||
+++ b/QXlsx/CMakeLists.txt | ||
@@ -16,10 +16,12 @@ 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) | ||
+if(NOT CMAKE_CXX_STANDARD) | ||
+ if (QT_MAJOR_VERSION EQUAL 6) | ||
set(CMAKE_CXX_STANDARD 17) | ||
-else() | ||
+ else() | ||
set(CMAKE_CXX_STANDARD 11) | ||
+ endif() | ||
endif() | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|