qt.cmake 3.2 KB
Newer Older
1 2
set (qt_depends)
set (qt_options)
3
set (patch_command)
4 5 6 7 8 9
if (NOT APPLE AND UNIX)
  list (APPEND qt_depends freetype fontconfig png)
  list (APPEND qt_options
               -system-libpng
               -I <INSTALL_DIR>/include/freetype2
               -I <INSTALL_DIR>/include/fontconfig)
10
elseif (APPLE)
11 12 13 14 15
  #set the platform to be clang if on apple and not gcc
  if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    list (APPEND qt_options -platform unsupported/macx-clang)
  endif()

16 17
  list (APPEND qt_options
              -sdk ${CMAKE_OSX_SYSROOT}
18
              -arch ${CMAKE_OSX_ARCHITECTURES}
19
              -qt-libpng)
20
endif()
21 22 23
set(qt_EXTRA_CONFIGURATION_OPTIONS ""
    CACHE STRING "Extra arguments to be passed to Qt when configuring.")

24
add_external_project_or_use_system(
25
    qt
26
    DEPENDS zlib ${qt_depends}
27
    ${patch_command}
28 29 30 31 32 33 34 35 36 37
    CONFIGURE_COMMAND <SOURCE_DIR>/configure
      -prefix <INSTALL_DIR>
      -confirm-license
      -release
      -no-audio-backend
      -no-dbus
      -nomake demos
      -nomake examples
      -no-multimedia
      -no-openssl
Ben Boeckel's avatar
Ben Boeckel committed
38
      -no-webkit
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
      -no-phonon
      -no-xinerama
      -no-scripttools
      -no-svg
      -no-declarative-debug
      -no-xvideo
      -opensource
      -qt-libjpeg
      -qt-libtiff
      -system-zlib
      -xmlpatterns
      -I <INSTALL_DIR>/include
      -L <INSTALL_DIR>/lib
      ${qt_options}
      ${qt_EXTRA_CONFIGURATION_OPTIONS}
54
)
55 56 57 58 59 60 61 62 63 64 65 66

if ((NOT 64bit_build) AND UNIX AND (NOT APPLE))
  # on 32-bit builds, we are incorrectly ending with QT_POINTER_SIZE chosen as
  # 8 (instead of 4) with GCC4.1 toolchain on old debians. This patch overcomes
  # that.
  add_external_project_step(qt-patch-configure
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
                              ${SuperBuild_PROJECTS_DIR}/patches/qt.configure
			      <SOURCE_DIR>/configure
    DEPENDEES patch
    DEPENDERS configure)
endif()
67

Robert Maynard's avatar
Robert Maynard committed
68 69 70 71
if (APPLE)
  # corewlan .pro file needs to be patched to find
  add_external_project_step(qt-patch-corewlan
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
72 73 74 75
                              ${SuperBuild_PROJECTS_DIR}/patches/qt.src.plugins.bearer.corewlan.corewlan.pro
            <SOURCE_DIR>/src/plugins/bearer/corewlan/corewlan.pro
    DEPENDEES configure
    DEPENDERS build)
76 77 78 79 80 81 82 83 84

  # Patch for modal dialog errors on 10.9 and up
  # See https://bugreports.qt-project.org/browse/QTBUG-37699?focusedCommentId=251106#comment-251106
  add_external_project_step(qt-patch-modal-dialogs
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
                              ${SuperBuild_PROJECTS_DIR}/patches/qt.src.gui.kernel.qeventdispatcher_mac.mm
                              <SOURCE_DIR>/src/gui/kernel/qeventdispatcher_mac.mm
    DEPENDEES configure
    DEPENDERS build)
85 86 87 88 89 90 91 92 93

  # Patch for build failures on 10.10
  # See http://fink.9193.n7.nabble.com/qt4-base-mac-4-8-6-2-compile-failure-on-OS-X-10-10-Public-Beta-3-td46612.html
  add_external_project_step(qt-patch-cocoa-build-fail
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
                              ${SuperBuild_PROJECTS_DIR}/patches/qt.src.gui.kernel.qcocoaapplicationdelegate_mac.mm
                              <SOURCE_DIR>/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
    DEPENDEES configure
    DEPENDERS build)
Robert Maynard's avatar
Robert Maynard committed
94
endif()