summaryrefslogtreecommitdiffstats
path: root/tools/qmake/mkspecs/features/functions.prf
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-11-19 17:55:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-28 16:15:59 +0100
commitfd61d752e313bf91a09c85020b3fb50067c610c8 (patch)
tree5aeff0a1039acc3e7bf7ced21870cac42d491f9e /tools/qmake/mkspecs/features/functions.prf
parent84a400e80d7e40aba2853411fdfb22f244c3e728 (diff)
Moving sources to src part 1: Move files.
This only move files without adjusting any paths. This moves: - lib/quick -> src/webengine/api (API files) lib/quick -> src/webengine (other files) This contains the main QtWebEngine module library since <ec7b2ee70a8b2db7fb87f50671a001ddd54697b0>. - lib/widgets -> src/webenginewidgets Also rename this directory to match its module name and rename Api to api. - lib -> src/core - process -> src/process - resources -> src/core/resources - tools/* -> tools/scripts/ The build directory is spread as follow: - build/build.pro -> src/core/gyp_run.pro - build/qmake_extras/* -> src/core/ (for the host and target .pro files) - build/qmake -> tools/qmake - Build related scripts -> tools/buildscripts Change-Id: I0cded1de772c99c0c1da6536c9afea353236b4a1 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'tools/qmake/mkspecs/features/functions.prf')
-rw-r--r--tools/qmake/mkspecs/features/functions.prf109
1 files changed, 109 insertions, 0 deletions
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
new file mode 100644
index 000000000..9d90d67bd
--- /dev/null
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -0,0 +1,109 @@
+# Map to the correct target type for gyp
+defineReplace(toGypTargetType) {
+ equals(TEMPLATE, "app"):return("executable")
+ equals(TEMPLATE, "lib") {
+ CONFIG(static): return("static_library")
+ return("shared_library")
+ }
+ return("none")
+}
+
+defineReplace(getOutDir) {
+ # FIXME: rely on env variable in here and in the gyp_qtwebengine script, à la WEBKITOUTPUTDIR
+ return("$$QTWEBENGINE_ROOT/out")
+}
+
+defineReplace(getConfigDir) {
+ CONFIG(release, debug|release):return("Release")
+ return("Debug")
+}
+
+defineReplace(extractCFlag) {
+ OPTION = $$find(QMAKE_CFLAGS, $$1)
+ OPTION = $$split(OPTION, =)
+ return ($$member(OPTION, 1))
+}
+
+defineReplace(findMocables) {
+ input = $$1
+ for (file, input): \
+ infiles += $$absolute_path($$file, $$_PRO_FILE_PWD_)
+ mocables = $$system("python $$QTWEBENGINE_ROOT/build/scripts/find-mocables $$infiles")
+ mocables = $$replace(mocables, $$_PRO_FILE_PWD_$${QMAKE_DIR_SEP}, '')
+ return($$mocables)
+}
+
+defineReplace(findIncludedMocFiles) {
+ input = $$1
+ for (file, input): \
+ infiles += $$absolute_path($$file, $$_PRO_FILE_PWD_)
+ return($$system("python $$QTWEBENGINE_ROOT/build/scripts/find-included-moc-files $$infiles"))
+}
+
+defineReplace(mocOutput) {
+ out = $$1
+ # The order is important, since the output of the second replace would end up accidentaly transformed by the first one
+ out = $$replace(out, ^(.*)($$join(QMAKE_EXT_CPP,|)), $${QMAKE_CPP_MOD_MOC}\\1$${QMAKE_EXT_CPP_MOC})
+ out = $$replace(out, ^(.*)($$join(QMAKE_EXT_H,|)), $${QMAKE_H_MOD_MOC}\\1$${first(QMAKE_EXT_CPP)})
+ return($$out)
+}
+
+defineReplace(rccOutput) {
+ out = $$1
+ out = $$replace(out, .qrc, .cpp)
+ out = $$join(out, qrc_, qrc_)
+ return($$out)
+}
+
+defineReplace(rccExternFunc) {
+ out = $$1
+ out = $$replace(out, .qrc, )
+ return($$out)
+}
+
+defineReplace(which) {
+ out = $$1
+ win32 {
+ command = $$split(out, " ")
+ executable = $$first(command)
+ # Return the first match only
+ out = $$system("((for /f \"usebackq delims=\" %i in (`where $$executable 2^> NUL`) do @if not defined _endwhich (@echo %i & set _endwhich=true)) & set _endwhich=)")
+ isEmpty(out) {
+ message($$executable not found)
+ out = $$executable
+ }
+ for(arg, command): !equals(arg, $$executable): out += $$arg
+ } else:unix {
+ command = $$split(out, " ")
+ executable = $$first(command)
+ out = $$system("which $$executable 2>/dev/null")
+ isEmpty(out) {
+ message($$executable not found)
+ out = $$executable
+ }
+ for(arg, command): !equals(arg, $$executable): out += $$arg
+ }
+ return($$out)
+}
+
+defineReplace(findOrBuildNinja) {
+ !isEmpty(CACHED_NINJA_EXECUTABLE):exists($$CACHED_NINJA_EXECUTABLE): return($$CACHED_NINJA_EXECUTABLE)
+ out = $$which(ninja)
+ # Try to be smart about it if we know where the chromium sources are located
+ !exists($$out) {
+ git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir")
+ # Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used)
+ isEmpty(git_chromium_src_dir): git_chromium_src_dir = "3rdparty/chromium"
+ win32: out = $$system_path($$absolute_path("$$QTWEBENGINE_ROOT/$$git_chromium_src_dir/../ninja/ninja.exe"))
+ else: out = $$absolute_path("$$QTWEBENGINE_ROOT/$$git_chromium_src_dir/../ninja/ninja")
+ # If we still did not find ninja, then we bootstrap it.
+ !exists($$out) {
+ message("bootstrapping ninja...")
+ ninjadir = $$dirname(out)
+ system("python $$ninjadir/bootstrap.py")
+ }
+ }
+ message("using $$out")
+ cache(CACHED_NINJA_EXECUTABLE, set, out)
+ return($$out)
+}