qt.pro 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Create the super cache so modules will add themselves to it.
  2. cache(, super)
  3. # Suppress the license check on subsequent "visits". The first
  4. # visit will skip it anyway due to not having a compiler set up
  5. # yet. This cannot be added to the super cache, because that is
  6. # read before spec_pre.prf, which flushes CONFIG. This does not
  7. # affect submodules, as they come with a .qmake.conf. But that
  8. # one sets the flag via qt_build_config.prf anyway.
  9. !QTDIR_build: cache(CONFIG, add, $$list(QTDIR_build))
  10. TEMPLATE = subdirs
  11. CONFIG += prepare_docs qt_docs_targets
  12. # Extract submodules from .gitmodules.
  13. lines = $$cat(.gitmodules, lines)
  14. for (line, lines) {
  15. mod = $$replace(line, "^\\[submodule \"([^\"]+)\"\\]$", \\1)
  16. !equals(mod, $$line) {
  17. module = $$mod
  18. modules += $$mod
  19. } else {
  20. prop = $$replace(line, "^$$escape_expand(\\t)([^ =]+) *=.*$", \\1)
  21. !equals(prop, $$line) {
  22. val = $$replace(line, "^[^=]+= *", )
  23. module.$${module}.$$prop = $$split(val)
  24. } else {
  25. error("Malformed line in .gitmodules: $$line")
  26. }
  27. }
  28. }
  29. QMAKE_INTERNAL_INCLUDED_FILES += $$PWD/.gitmodules
  30. QT_SKIP_MODULES =
  31. # This is a bit hacky, but a proper implementation is not worth it.
  32. args = $$QMAKE_EXTRA_ARGS
  33. contains(args, -redo): \
  34. args += $$cat($$OUT_PWD/config.opt, lines)
  35. for (ever) {
  36. isEmpty(args): break()
  37. a = $$take_first(args)
  38. equals(a, -skip) {
  39. isEmpty(args): break()
  40. m = $$take_first(args)
  41. contains(m, -.*): next()
  42. m ~= s/^(qt)?/qt/
  43. !contains(modules, $$m): \
  44. error("-skip command line argument used with non-existent module '$$m'.")
  45. QT_SKIP_MODULES += $$m
  46. }
  47. }
  48. modules = $$sort_depends(modules, module., .depends .recommends .serialize)
  49. modules = $$reverse(modules)
  50. for (mod, modules) {
  51. project = $$eval(module.$${mod}.project)
  52. equals(project, -): \
  53. next()
  54. deps = $$eval(module.$${mod}.depends)
  55. recs = $$eval(module.$${mod}.recommends) $$eval(module.$${mod}.serialize)
  56. for (d, $$list($$deps $$recs)): \
  57. !contains(modules, $$d): \
  58. error("'$$mod' depends on undeclared '$$d'.")
  59. contains(QT_SKIP_MODULES, $$mod): \
  60. next()
  61. !isEmpty(QT_BUILD_MODULES):!contains(QT_BUILD_MODULES, $$mod): \
  62. next()
  63. isEmpty(project) {
  64. !exists($$mod/$${mod}.pro): \
  65. next()
  66. $${mod}.subdir = $$mod
  67. } else {
  68. !exists($$mod/$$project): \
  69. next()
  70. $${mod}.file = $$mod/$$project
  71. $${mod}.makefile = Makefile
  72. }
  73. $${mod}.target = module-$$mod
  74. for (d, deps) {
  75. !contains(SUBDIRS, $$d) {
  76. $${mod}.target =
  77. break()
  78. }
  79. $${mod}.depends += $$d
  80. }
  81. isEmpty($${mod}.target): \
  82. next()
  83. for (d, recs) {
  84. contains(SUBDIRS, $$d): \
  85. $${mod}.depends += $$d
  86. }
  87. SUBDIRS += $$mod
  88. }
  89. load(qt_configure)