From 2bad858362313b7062f68d4c2797480123977cd0 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 21 Feb 2021 13:25:52 -0500 Subject: [PATCH] Allow building hecl-gui with Qt5 Checks arm64 vs x86_64 path for macOS homebrew --- CMakeLists.txt | 18 +++++++++++++++--- hecl-gui | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59accb257..d7411e28e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,12 +364,24 @@ add_subdirectory(visigen) add_dependencies(hecl visigen) if (NOT WINDOWS_STORE AND NOT NX) - find_package(Qt6Widgets PATHS /usr/local/opt/qt) - if (Qt5Widgets_FOUND) + if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64) + set(QT_HOMEBREW_PATH /usr/local/opt/qt) + elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) + set(QT_HOMEBREW_PATH /opt/homebrew/opt/qt) + else() + set(QT_HOMEBREW_PATH "") + endif() + + find_package(Qt6Widgets QUIET PATHS ${QT_HOMEBREW_PATH}) + find_package(Qt5Widgets QUIET PATHS ${QT_HOMEBREW_PATH}) + if (Qt6Widgets_FOUND) message(STATUS "Qt6 found, hecl-gui will be built") add_subdirectory(hecl-gui) + elseif(Qt5Widgets_FOUND) + message(STATUS "Qt5 found, hecl-gui will be built") + add_subdirectory(hecl-gui) else() - message(STATUS "Qt6 not found, hecl-gui will not be built") + message(STATUS "Qt5-6 not found, hecl-gui will not be built") endif() endif() diff --git a/hecl-gui b/hecl-gui index ab0d15f73..3c36a1fdc 160000 --- a/hecl-gui +++ b/hecl-gui @@ -1 +1 @@ -Subproject commit ab0d15f73988175bce5b5bf1aa80a2c4faa12c9f +Subproject commit 3c36a1fdc2ec684f304acd64e4d8a5226ec5a214