From ed158952210f79dab7365e325d3c180fea26631e Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 27 Aug 2017 14:39:50 +0100 Subject: cmake: look for Qt5 from Homebrew on macOS When Qt5 is installed using Homebrew on macOS, Qt5 is not available in the default prefix. Remove the hack from macos-setup-brew.sh and adjust the search path instead. Note that is needed for development, "brew install" has already set this option in the environment. See https://github.com/Homebrew/homebrew-core/issues/8392 Change-Id: I57ea09b649a94c9a4cb18b1b2d334808e47ec27e Reviewed-on: https://code.wireshark.org/review/23232 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f165c0138..5cac0b9129 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,6 +287,13 @@ if( NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND set( DUMPCAP_INSTALL_OPTION ) endif() +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") +endif() + # Always enable position-independent code when compiling, even for # executables, so you can build position-independent executables. # -pie is added below for non-MSVC. -- cgit v1.2.3