From 3e63734123944cd270cc7eb289967d38de9838d5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 16 May 2019 13:50:23 -0700 Subject: [PATCH] more correct QT_VERSION detection for MacOS --- cmake/macros/SetupQt.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 18b4f5aecc..b6ebaf6239 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -21,7 +21,11 @@ function(calculate_qt5_version result _QT_DIR) # .../include/QtCore/5.12.3/QtCore/private # Sometimes we need to include these private headers for debug hackery. # Hence we find one of these directories and pick apart its path to determine the actual QT_VERSION. - set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore") + if (APPLE) + set(_QT_CORE_DIR "${_QT_DIR}/lib/QtCore.framework/Versions/5/Headers") + else() + set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore") + endif() if(NOT EXISTS "${_QT_CORE_DIR}") message(FATAL_ERROR "Could not find 'include/QtCore' in '${_QT_DIR}'") endif() @@ -74,7 +78,9 @@ macro(setup_qt) message(FATAL_ERROR "Unable to locate Qt5CoreConfig.cmake in '${QT_CMAKE_PREFIX_PATH}'") endif() - message(STATUS "Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") + message("adebug") + message("adebug Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") + message("adebug") # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON)