Skip to content

Commit cb0c664

Browse files
author
Allen Winter
committed
cmake/ECM/modules - sync to upstream
1 parent 39329b7 commit cb0c664

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

cmake/ECM/modules/ECMGenerateHeaders.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ Example usage (with ``PREFIX``):
118118
Since pre-1.0.0.
119119
#]=======================================================================]
120120

121-
include(CMakeParseArguments)
122-
123121
function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
124122
set(options)
125123
set(oneValueArgs ORIGINAL HEADER_EXTENSION OUTPUT_DIR PREFIX REQUIRED_HEADERS COMMON_HEADER RELATIVE)

cmake/ECM/modules/ECMSetupVersion.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function(ecm_setup_version _version)
142142
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.0*([0-9]+).*" "\\1" _patch "${_version}")
143143
endif()
144144

145-
if(NOT ESV_SOVERSION)
145+
if(NOT DEFINED ESV_SOVERSION) # use DEFINED, so "0" as valid SO version is not evaluated to FALSE
146146
set(ESV_SOVERSION ${_major})
147147
endif()
148148

cmake/ECM/modules/QtVersionOption.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ that is, if the major Qt version has not yet been determined otherwise
1212
This module is typically included by other modules requiring knowledge
1313
about the major Qt version.
1414
15+
If the ECM version passed to find_package was at least 5.240.0 Qt6 is picked by default.
16+
Otherwise Qt5 is picked.
17+
1518
``QT_MAJOR_VERSION`` is defined to either be "5" or "6".
1619
1720
Since 5.82.0.
@@ -26,7 +29,11 @@ if (TARGET Qt5::Core)
2629
elseif (TARGET Qt6::Core)
2730
set(QT_MAJOR_VERSION 6)
2831
else()
29-
option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
32+
if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 5.240)
33+
option(BUILD_WITH_QT6 "Build against Qt 6" ON)
34+
else()
35+
option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
36+
endif()
3037

3138
if (BUILD_WITH_QT6)
3239
set(QT_MAJOR_VERSION 6)

0 commit comments

Comments
 (0)