chore: Improve finding Homebrew's Qt5 on macOS (#4291)

This commit is contained in:
Raphael Coeffic
2023-12-13 20:28:54 +10:00
committed by GitHub
parent 2ffd0c514c
commit b66e8220c3
+3 -5
View File
@@ -1,8 +1,6 @@
if(APPLE AND EXISTS /usr/local/opt/qt5)
# Homebrew installs Qt5 (up to at least 5.9.1) in
# /usr/local/qt5, ensure it can be found by CMake since
# it is not in the default /usr/local prefix.
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
if(APPLE AND DEFINED ENV{HOMEBREW_PREFIX} AND EXISTS $ENV{HOMEBREW_PREFIX}/opt/qt@5)
# If Homebrew is used, HOMEBREW_PREFIX should be defined
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOMEBREW_PREFIX}/opt/qt@5")
endif()
set(CMAKE_AUTOMOC ON)