summaryrefslogtreecommitdiff
path: root/config/qt5_core.mpb
blob: 288ab1aa9814c60c3d320e7ebc3280a83cde77f2 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
project {
  expand(QT5_INCDIR) {
    $QT5_INCDIR
    $(QTDIR)/include
  }
  expand(QT5_BINDIR) {
    $QT5_BINDIR
    $(QTDIR)/bin
  }
  expand(QT5_LIBDIR) {
    $QT5_LIBDIR
    $(QTDIR)/lib
  }
  // On some linux systems with both Qt4 and Qt5 installed, the uic and moc
  // executables for Qt5 need to be run as "uic-qt5"
  // Expand the variable here to avoid the "undefined" warning from msvc.
  expand(QT5_SUFFIX) {
    $QT5_SUFFIX
    ""
  }

  requires += qt5
  includes += $(QT5_INCDIR)
  libpaths += $(QT5_LIBDIR)

  // Use lit_libs instead of libs for qt5's libraries.
  // When generating -static projects of a type that uses lib_modifier,
  // the lib_modifier will have an "s" in it (s for Release, sd for Debug).
  // However, the libraries produced by the Qt project never have an "s" suffix.
  // When MPC generates -static projects, the Qt being used may or may not be
  // static (it doesn't matter for project generation).
  // Since the Qt projects do use a "d" suffix for Debug whether or not the
  // libs are static, we need to account for that with $(QT5_LIBSUFFIX).
  lit_libs += Qt5Core$(QT5_LIBSUFFIX)

  // On Linux at least, Qt5 by default requires position independent code
  specific (gnuace) {
    compile_flags += $(if $(PIC),$(PIC),-fPIC)
  }

  specific (prop:microsoft) {
    // On Windows it's possible for Qt to include winsock.h through windows.h
    // which will conflict with winsock2.h. This makes windows.h not include
    // winsock.h
    macros += WIN32_LEAN_AND_MEAN
    Debug::QT5_LIBSUFFIX = d
  }

  Define_Custom(UIC) {
    command          = $(QT5_BINDIR)/uic$(QT5_SUFFIX)
    output_option    = -o
    inputext         = .ui
    pre_filename     = ui_
    header_outputext = .h
  }

  Define_Custom(MOC) {
    automatic_in     = 0
    automatic_out    = 0
    command          = $(QT5_BINDIR)/moc$(QT5_SUFFIX)
    output_option    = -o
    pch_postrule     = 1
    inputext         = .h
    pre_extension    = _moc
    source_outputext = .cpp
  }

  Define_Custom(QRC) {
    command          = $(QT5_BINDIR)/rcc$(QT5_SUFFIX)
    output_option    = -o
    commandflags     = -name <%input_noext%>
    pch_postrule     = 1
    inputext         = .qrc
    pre_extension    = _qrc
    source_outputext = .cpp
  }
}