Skip to content

Commit

Permalink
cmake/ECM/modules - sync to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Winter committed Dec 22, 2023
1 parent 39329b7 commit cb0c664
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cmake/ECM/modules/ECMGenerateHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ Example usage (with ``PREFIX``):
Since pre-1.0.0.
#]=======================================================================]

include(CMakeParseArguments)

function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
set(options)
set(oneValueArgs ORIGINAL HEADER_EXTENSION OUTPUT_DIR PREFIX REQUIRED_HEADERS COMMON_HEADER RELATIVE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/ECM/modules/ECMSetupVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function(ecm_setup_version _version)
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.0*([0-9]+).*" "\\1" _patch "${_version}")
endif()

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

Expand Down
9 changes: 8 additions & 1 deletion cmake/ECM/modules/QtVersionOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ that is, if the major Qt version has not yet been determined otherwise
This module is typically included by other modules requiring knowledge
about the major Qt version.
If the ECM version passed to find_package was at least 5.240.0 Qt6 is picked by default.
Otherwise Qt5 is picked.
``QT_MAJOR_VERSION`` is defined to either be "5" or "6".
Since 5.82.0.
Expand All @@ -26,7 +29,11 @@ if (TARGET Qt5::Core)
elseif (TARGET Qt6::Core)
set(QT_MAJOR_VERSION 6)
else()
option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 5.240)
option(BUILD_WITH_QT6 "Build against Qt 6" ON)
else()
option(BUILD_WITH_QT6 "Build against Qt 6" OFF)
endif()

if (BUILD_WITH_QT6)
set(QT_MAJOR_VERSION 6)
Expand Down

0 comments on commit cb0c664

Please sign in to comment.