Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
qmake: correct Qt version detection. do not empty cache if recheck
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 23, 2013
1 parent 466009b commit 9a7c9ae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions QtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ OTHER_FILES += \
#OTHER_FILES += config.test/mktest.sh

#cache mkspecs. compare mkspec with cached one. if not equal, remove old cache to run new compile tests
#TODO: Qt5 does not have QMAKE_MKSPECS, use QMAKE_SPEC, QMAKE_XSPEC
mkspecs_build = $$[QMAKE_MKSPECS]
mkspecs_build ~= s,\\\\,/,g #avoid warning for '\'. qmake knows how to deal with '/'
!isEmpty(mkspecs_cached) {
!isEqual(mkspecs_cached, $$mkspecs_build):new_compile_tests = 1
!isEqual(mkspecs_cached, $$mkspecs_build):CONFIG += recheck
} else {
new_compile_tests = 1
CONFIG += recheck
}

##TODO: BUILD_DIR=>BUILD_ROOT
Expand All @@ -32,8 +33,8 @@ SOURCE_ROOT ~= s,\\\\,/,g #avoid warning for '\'. qmake knows how to deal with '
isEmpty(BUILD_DIR):BUILD_DIR=$$out_dir
message("BUILD_DIR=$$BUILD_DIR")

greaterThan(QT_MAJOR_VERSION, 5) {
!isEmpty(new_compile_tests):write_file($$BUILD_DIR/.qmake.cache)
greaterThan(QT_MAJOR_VERSION, 4) {
#recheck:write_file($$BUILD_DIR/.qmake.cache) #FIXME: empty_file result in no qtCompileTest result in cache
load(configure)
} else {
_QMAKE_CACHE_QT4_ = $$_QMAKE_CACHE_
Expand All @@ -44,7 +45,7 @@ greaterThan(QT_MAJOR_VERSION, 5) {
}
message("_QMAKE_CACHE_QT4_: $$_QMAKE_CACHE_QT4_")
include(common.pri)
!isEmpty(new_compile_tests):write_file($$BUILD_DIR/.qmake.cache)
#recheck:write_file($$BUILD_DIR/.qmake.cache) #FIXME: empty_file result in no qtCompileTest result in cache
#use the following lines when building as a sub-project, write cache to this project src dir.
#if build this project alone and do not have sub-project depends on this lib, those lines are not necessary
####ASSUME compile tests and .qmake.cache is in project out root dir
Expand Down

0 comments on commit 9a7c9ae

Please sign in to comment.