Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svgscene: fix build when QT_VERSION_MAJOR=6 is specified at top level and Qt5 libraries are present #157

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion external/svgscene/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
cmake_minimum_required(VERSION 3.10)
project(svgscene)

set(QT_VERSION_MAJOR "auto" CACHE STRING "Qt major version to use. 5|6|auto")

if (NOT "${QT_VERSION_MAJOR}" MATCHES "5|6|auto")
message(FATAL_ERROR "Invalid value for QT_VERSION_MAJOR: ${QT_VERSION_MAJOR} (expected 5, 6 or auto)")
endif ()

if ("${QT_VERSION_MAJOR}" STREQUAL "auto")
find_package(QT NAMES Qt5 Qt6 COMPONENTS Core REQUIRED)
endif ()

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
# Normally, we would use variable Qt5 or Qt6 to reference the Qt library. Here we do that through
# this variable based on detected version major of Qt.
set(QtLib "Qt${QT_VERSION_MAJOR}")
Expand Down
Loading