summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake30
1 files changed, 25 insertions, 5 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 31fa43c..2c3ba6e 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -448,7 +448,10 @@ MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
ENDMACRO (_QT4_ADJUST_LIB_VARS)
function(_QT4_QUERY_QMAKE VAR RESULT)
- exec_program(${QT_QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
+ execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR}
+ RESULT_VARIABLE return_code
+ OUTPUT_VARIABLE output ERROR_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
if(NOT return_code)
file(TO_CMAKE_PATH "${output}" output)
set(${RESULT} ${output} PARENT_SCOPE)
@@ -539,14 +542,25 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
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)
@@ -576,10 +590,13 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
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)
@@ -595,8 +612,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
_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
)
@@ -614,6 +630,10 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
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)