summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-07-20 16:48:12 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-07-20 16:48:12 (GMT)
commit380f8f6b4b6bd1d775d17a8fbeb1205fc300ce92 (patch)
tree80656cc8c55f40405c8ec766cba30b9b299780fa /Modules
parent712e64ebb302d3332fb8c0770f71bcae30a24a8a (diff)
downloadCMake-380f8f6b4b6bd1d775d17a8fbeb1205fc300ce92.zip
CMake-380f8f6b4b6bd1d775d17a8fbeb1205fc300ce92.tar.gz
CMake-380f8f6b4b6bd1d775d17a8fbeb1205fc300ce92.tar.bz2
ENH: make sure qmake is on the machine before running it
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindQt.cmake11
-rw-r--r--Modules/FindQt4.cmake52
2 files changed, 38 insertions, 25 deletions
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 1c5dbaa..cb4bd67 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -23,6 +23,7 @@ IF(NOT QT_FOUND)
ENDIF(NOT QT_FOUND)
# if a project needs Qt it has to call FoundQt.cmake and NOT FoundQt3.cmake, FoundQt4.cmake etc. This gets checked in FoundQt4.cmake etc.
SET(FOUNDQT_CALLED "YES")
+FIND_PROGRAM(QT_QMAKE qmake)
# compatibility to CMakeList.txt files for Qt3 projects
IF(NOT QT_MAX_VERSION)
@@ -39,10 +40,12 @@ ENDIF(NOT QT_MIN_VERSION)
# QT_GLOBAL_H_FILE
#
#######################################
-IF( NOT QT_QGLOBAL_H_FILE)
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_HEADERS"
- OUTPUT_VARIABLE qt_headers )
+IF( NOT QT_QGLOBAL_H_FILE)
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_HEADERS"
+ OUTPUT_VARIABLE qt_headers )
+ ENDIF(QT_QMAKE)
# Qt4-like search paths
FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 1f0da7b..fa8b69a 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -85,7 +85,6 @@
IF(NOT FOUNDQT_CALLED)
MESSAGE( FATAL_ERROR "Never call FoundQt4.cmake directly. Use FoundQt.cmake.")
ENDIF(NOT FOUNDQT_CALLED)
-
########################################
#
# Setting the INCLUDE-Variables
@@ -93,9 +92,11 @@ ENDIF(NOT FOUNDQT_CALLED)
########################################
# Set QT_QT_INCLUDE_DIR by searching for qglobal.h
IF(NOT QT_QT_INCLUDE_DIR)
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_HEADERS"
- OUTPUT_VARIABLE qt_headers )
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_HEADERS"
+ OUTPUT_VARIABLE qt_headers )
+ ENDIF(QT_QMAKE)
FIND_PATH( QT_QT_INCLUDE_DIR qglobal.h
${qt_headers}/Qt
$ENV{QTDIR}/include/Qt
@@ -270,10 +271,12 @@ SET( QT_INCLUDES
# Setting the LIBRARY-Variables
#
########################################
-IF(NOT QT_QTCORE_LIBRARY)
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_LIBS"
- OUTPUT_VARIABLE qt_libs )
+IF(NOT QT_QTCORE_LIBRARY)
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_LIBS"
+ OUTPUT_VARIABLE qt_libs )
+ ENDIF(QT_QMAKE)
# Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename
FIND_LIBRARY( QT_QTCORE_LIBRARY
NAMES QtCore
@@ -291,9 +294,11 @@ ENDIF(NOT QT_QTCORE_LIBRARY)
# Set QT_QTCORE_LIBRARY_DEBUG by searching for a lib with "QtCore_debug" as part of the filename
IF(NOT QT_QTCORE_LIBRARY_DEBUG)
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_LIBS"
- OUTPUT_VARIABLE qt_libs )
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_LIBS"
+ OUTPUT_VARIABLE qt_libs )
+ ENDIF(QT_QMAKE)
FIND_LIBRARY( QT_QTCORE_LIBRARY_DEBUG
NAMES QtCore_debug
PATHS
@@ -648,10 +653,11 @@ ENDIF(NOT QT_LIBRARIES_TRYDEBUG)
#
#######################################
IF(NOT QT_MOC_EXECUTABLE)
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_BINS"
- OUTPUT_VARIABLE qt_bins )
-
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_BINS"
+ OUTPUT_VARIABLE qt_bins )
+ ENDIF(QT_QMAKE)
FIND_PROGRAM(QT_MOC_EXECUTABLE
NAMES moc
PATHS
@@ -673,9 +679,11 @@ ELSE(QT_MOC_EXECUTABLE)
ENDIF(QT_MOC_EXECUTABLE)
IF(NOT QT_UIC_EXECUTABLE )
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_BINS"
- OUTPUT_VARIABLE qt_bins )
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_BINS"
+ OUTPUT_VARIABLE qt_bins )
+ ENDIF(QT_QMAKE)
FIND_PROGRAM(QT_UIC_EXECUTABLE
NAMES uic
PATHS
@@ -697,9 +705,11 @@ ELSE(QT_UIC_EXECUTABLE)
ENDIF(QT_UIC_EXECUTABLE)
IF(NOT QT_RCC_EXECUTABLE)
- EXEC_PROGRAM( qmake
- ARGS "-query QT_INSTALL_BINS"
- OUTPUT_VARIABLE qt_bins )
+ IF(QT_QMAKE)
+ EXEC_PROGRAM( qmake
+ ARGS "-query QT_INSTALL_BINS"
+ OUTPUT_VARIABLE qt_bins )
+ ENDIF(QT_QMAKE)
FIND_PROGRAM(QT_RCC_EXECUTABLE
NAMES rcc
PATHS