Skip to content

Commit

Permalink
qmake: fix ios project display in qtcreator
Browse files Browse the repository at this point in the history
qtc validates projects first. if error occurs, visual items after error
can not be displayed in qtc
ios MAKEFILE_GENERATOR is XCODE(why) which not supported by configure.prf
and error() is called, so qtc displayed nothing
  • Loading branch information
wang-bin committed Feb 20, 2015
1 parent af16aae commit a59e6ee
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
11 changes: 9 additions & 2 deletions QtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
SUBDIRS += examples
examples.depends += libqtav
}
!android:!no-tests {
!cross_compile:!no-tests {
SUBDIRS += tests
tests.depends += libqtav libqtavwidgets
}
Expand All @@ -42,7 +42,14 @@ OptionalDepends = \
avresample \
avdevice
# QtOpenGL module. In Qt5 we can disable it and still have opengl support
!no-gl:!no-widgets: OptionalDepends *= gl
!no-gl:!no-widgets {
greaterThan(QT_MAJOR_VERSION, 4):qtHaveModule(opengl):!config_gl {
GL=config_gl done_config_gl
cache(CONFIG, add, GL)
} else {
OptionalDepends *= gl #ios require code sign
}
}
!no-avfilter: OptionalDepends *= avfilter
## sse2 sse4_1 may be defined in Qt5 qmodule.pri but is not included. Qt4 defines sse and sse2
!no-sse4_1:!sse4_1: OptionalDepends *= sse4_1
Expand Down
11 changes: 8 additions & 3 deletions configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_QT4_)/config.log
QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests

lessThan(QT_MAJOR_VERSION, 5) {
defineTest(cache) {
!isEmpty(4): error("cache(var, [set|add|sub] [transient] [super], [srcvar]) requires one to three arguments.")
!exists($$_QMAKE_CACHE_QT4_) {
Expand Down Expand Up @@ -54,8 +55,11 @@ defineTest(cache) {
}
write_file($$_QMAKE_CACHE_QT4_, varstr, append)
}

equals(MAKEFILE_GENERATOR, UNIX) {
} #Qt4
QMAKE_MAKE = $$(MAKE)
!isEmpty(QMAKE_MAKE) {
# We were called recursively. Use the right make, as MAKEFLAGS may be set as well.
} equals(MAKEFILE_GENERATOR, UNIX) {
QMAKE_MAKE = make
} else:equals(MAKEFILE_GENERATOR, MINGW) {
!equals(QMAKE_HOST.os, Windows): \
Expand All @@ -65,7 +69,8 @@ equals(MAKEFILE_GENERATOR, UNIX) {
} else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) {
QMAKE_MAKE = nmake
} else {
error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.")
# error: the reset qmake will not work and displays nothing in qtc
warning("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.")
}

defineTest(qtRunLoggedCommand) {
Expand Down
9 changes: 8 additions & 1 deletion root.pri
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ message("BUILD_DIR=$$BUILD_DIR")
greaterThan(QT_MAJOR_VERSION, 4) {
mkspecs_build = $$[QMAKE_SPEC]
#recheck:write_file($$BUILD_DIR/.qmake.cache) #FIXME: empty_file result in no qtCompileTest result in cache
load(configure)
#load(configure) # why MAKEFILE_GENERATOR is detected as XCODE in qtc before running qmake?
} else {
mkspecs_build = $$[QMAKE_MKSPECS]
_QMAKE_CACHE_QT4_ = $$_QMAKE_CACHE_
Expand All @@ -24,6 +24,13 @@ greaterThan(QT_MAJOR_VERSION, 4) {
_QMAKE_CACHE_QT4_=$$BUILD_DIR/.qmake.cache
}
include(common.pri)
}
SUPPORTED_MAKEFILE_GENERATOR = UNIX MINGW MSVC.NET MSBUILD
message(MAKEFILE_GENERATOR=$$MAKEFILE_GENERATOR)
greaterThan(QT_MAJOR_VERSION, 4):contains(SUPPORTED_MAKEFILE_GENERATOR, $$MAKEFILE_GENERATOR) {
#configure.prf error if makefile generator is not supported and no display in qtcreator
load(configure)
} else {
#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
Expand Down

0 comments on commit a59e6ee

Please sign in to comment.