summaryrefslogtreecommitdiffstats
path: root/build/qmake/mkspecs/features/functions.prf
blob: 0f65c77aea0a1a888717b9ad601b9b22dc8e3590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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(findMocables) {
  input = $$1
  for (file, input): \
      infiles += $$absolute_path($$file, $$_PRO_FILE_PWD_)
  mocables = $$system("$$QTWEBENGINE_ROOT/build/scripts/find-mocables $$infiles")
  mocables = $$replace(mocables, $$_PRO_FILE_PWD_$${QMAKE_DIR_SEP}, '')
  return($$mocables)
}

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)
}