summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2011-02-19 22:30:02 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2011-02-19 22:30:02 (GMT)
commit4167be052f3f68e637bb491a0b725f476bc3d46b (patch)
treef703259fc5ac9961a13dad6cfff4456a3ae3448e /Modules/FindQt4.cmake
parent9e81dddc4f1a85345fac95d30edc07d954166123 (diff)
downloadCMake-4167be052f3f68e637bb491a0b725f476bc3d46b.zip
CMake-4167be052f3f68e637bb491a0b725f476bc3d46b.tar.gz
CMake-4167be052f3f68e637bb491a0b725f476bc3d46b.tar.bz2
Fix issues with find_path() for QtCore include dir on Mac. Fixes 11868.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake25
1 files changed, 21 insertions, 4 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 79a3d51..5e14903 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -607,14 +607,25 @@ IF (QT4_QMAKE_FOUND)
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
HINTS ${QT_LIBRARY_DIR_TMP}
- NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
+ NO_DEFAULT_PATH
)
FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
HINTS ${QT_LIBRARY_DIR_TMP}
- NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
+ NO_DEFAULT_PATH
)
+ IF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+ NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
+ HINTS ${QT_LIBRARY_DIR_TMP}
+ )
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+ NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
+ HINTS ${QT_LIBRARY_DIR_TMP}
+ )
+ ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+
# try dropping a hint if trying to use Visual Studio with Qt built by mingw
IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
@@ -644,10 +655,13 @@ IF (QT4_QMAKE_FOUND)
ENDIF()
IF (APPLE)
+ SET(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
+ SET(CMAKE_FIND_FRAMEWORK FIRST)
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
+ SET(CMAKE_FIND_FRAMEWORK LAST)
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
ENDIF (APPLE)
@@ -663,8 +677,7 @@ IF (QT4_QMAKE_FOUND)
_qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
- HINTS ${qt_headers}
- ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+ HINTS ${qt_headers} ${QT_LIBRARY_DIR}
PATH_SUFFIXES QtCore
)
@@ -682,6 +695,10 @@ IF (QT4_QMAKE_FOUND)
ENDIF()
ENDIF()
+ IF(APPLE)
+ SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
+ ENDIF(APPLE)
+
# Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
IF(QT_HEADERS_DIR)
IF(QT_USE_FRAMEWORKS)