Allow building hecl-gui with Qt5

Checks arm64 vs x86_64 path for macOS homebrew
This commit is contained in:
Luke Street 2021-02-21 13:25:52 -05:00
parent b2f7046c5f
commit 2bad858362
2 changed files with 16 additions and 4 deletions

View File

@ -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()

@ -1 +1 @@
Subproject commit ab0d15f73988175bce5b5bf1aa80a2c4faa12c9f
Subproject commit 3c36a1fdc2ec684f304acd64e4d8a5226ec5a214