forked from fblumenthal/buildem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qt4.cmake
111 lines (98 loc) · 3.98 KB
/
qt4.cmake
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#
# Install qt4 libraries from source
#
if (NOT qt4_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
#include (PatchSupport)
include(zlib)
include(libpng)
include(libjpeg)
include(libtiff)
include(freetype2)
external_git_repo(qt4
4.8 #682ed9df439481e1f8e8651c4aa06f1b455a2080
https://github.com/qtproject/qt)
message ("Installing ${qt4_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (EXTRA_QT4_CONFIG_FLAGS
-cocoa
-L/usr/X11/lib
-I/usr/X11/include )
else()
set (EXTRA_QT4_CONFIG_FLAGS "")
endif()
#
# This build script builds a SUBSET of QT.
# We intentionally avoid building a lot of non-UI stuff, just to minimize our build time and minimize the odds of build system failures.
# (This builds everything that ilastik needs.)
ExternalProject_Add(${qt4_NAME}
DEPENDS ${freetype2_NAME} ${zlib_NAME} ${libpng_NAME} ${libjpeg_NAME} ${libtiff_NAME}
PREFIX ${BUILDEM_DIR}
GIT_REPOSITORY ${qt4_URL}
GIT_TAG 4.8
UPDATE_COMMAND ""
PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE}
# This patch fixes ilastik crashes on OSX due to an ill-shaped ellipse
${qt4_SRC_DIR}/src/gui/painting/qpaintengine_mac.cpp ${PATCH_DIR}/qt4-osx-draw-ellipse.patch
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} env CXXFLAGS=${BUILDEM_ADDITIONAL_CXX_FLAGS} echo "yes" | ${qt4_SRC_DIR}/configure # pipe "yes" to stdin to accept the license.
--prefix=${BUILDEM_DIR}
-opensource
-arch x86_64
-optimized-qmake
#-no-framework # Intentionally omitted.
# On Mac, Qt is built as a "framework" by default. It would be nice if we could build it as a non-framework,
# since other cross-platform packages (e.g. qimage2ndarray) usually assume a non-framework directory tree.
# Unfortunately, we must build as a framework.
# Normally when OSX finds two versions of the same .dylib on the system, it loads only one of them and ignores the other.
# However, OSX doesn't seem to recognize that two dylibs with the SAME NAME shouldn't be loaded simultaneously if one of them is part of a framework and the other isn't.
# This means that if the user already has a QT framework installation on his system somewhere, then installing a non-framework build on his system will lead to weirdness.
# If we just build QT as a framework, then OSX knows not to load both sets of dylibs.
-nomake examples
-nomake demos
-nomake docs
-nomake translations
-no-multimedia
-no-webkit # Apparently clang segfaults when building webkit...
-no-audio-backend
-no-phonon
-no-phonon-backend
-no-sql-sqlite
-no-sql-sqlite2
-no-sql-psql
-no-sql-db2
-no-sql-ibase
-no-sql-mysql
-no-sql-oci
-no-sql-odbc
-no-sql-sqlite_symbian
-no-sql-tds
-no-pch
-no-dbus
-no-cups
-no-nis
-no-accessibility # accessibility causes PyQt build issues on Ubuntu and Mavericks, but PySide can't build without it.
-release
-shared
-fontconfig
-system-zlib
-system-libpng
-system-libjpeg
-system-libtiff
-I${BUILDEM_DIR}/include
-L${BUILDEM_DIR}/lib
${EXTRA_QT4_CONFIG_FLAGS}
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ExternalProject_Add_Step(${qt4_NAME} ${qt4_NAME}-create-symlinks
COMMAND bash ${PATCH_DIR}/qt4-create-symlinks.sh ${BUILDEM_DIR}
DEPENDEES install
)
endif()
set_target_properties(${qt4_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT qt4_NAME)