diff options
author | Brad King <brad.king@kitware.com> | 2011-02-22 19:33:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-02-22 19:33:00 (GMT) |
commit | 59cfdd5c77c8589068963a6c0bc5caadbf86666b (patch) | |
tree | b07cfd66eff36fc31d4146e495aab927c1e77b97 | |
parent | cbc5e31f86b95cf502c77808d185cd0e2624cdb2 (diff) | |
parent | 4167be052f3f68e637bb491a0b725f476bc3d46b (diff) | |
download | CMake-59cfdd5c77c8589068963a6c0bc5caadbf86666b.zip CMake-59cfdd5c77c8589068963a6c0bc5caadbf86666b.tar.gz CMake-59cfdd5c77c8589068963a6c0bc5caadbf86666b.tar.bz2 |
Merge topic 'qt4-macfind'
4167be0 Fix issues with find_path() for QtCore include dir on Mac. Fixes 11868.
-rw-r--r-- | Modules/FindQt4.cmake | 25 |
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) |