FindQt4: set QT_VERSION_* variables sooner.
Set QT_VERSION_* variables sooner so they can be set before Qt4ConfigDependentSettings.cmake uses them.
This commit is contained in:
parent
c7550d5ef1
commit
4b9ec00d0e
|
@ -538,6 +538,11 @@ endif ()
|
||||||
|
|
||||||
if (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
if (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||||
|
|
||||||
|
# set version variables
|
||||||
|
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
|
||||||
|
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
|
||||||
|
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
|
||||||
|
|
||||||
# ask qmake for the mkspecs directory
|
# ask qmake for the mkspecs directory
|
||||||
# we do this first because QT_LIBINFIX might be set
|
# we do this first because QT_LIBINFIX might be set
|
||||||
if (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
|
if (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
|
||||||
|
@ -1174,11 +1179,6 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
|
||||||
|
|
||||||
include("${_qt4_current_dir}/Qt4Macros.cmake")
|
include("${_qt4_current_dir}/Qt4Macros.cmake")
|
||||||
|
|
||||||
# set version variables
|
|
||||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
|
|
||||||
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
|
|
||||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
|
#support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
|
||||||
|
|
Loading…
Reference in New Issue