File: CMakeLists.txt

package info (click to toggle)
plplot 5.14.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 30,424 kB
  • sloc: ansic: 79,613; xml: 28,583; cpp: 20,037; ada: 19,456; tcl: 12,081; f90: 11,423; ml: 7,276; java: 6,863; python: 6,792; sh: 3,185; perl: 828; lisp: 75; makefile: 48; sed: 33; fortran: 5
file content (207 lines) | stat: -rw-r--r-- 7,626 bytes parent folder | download | duplicates (4)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# qt4_lite/CMakeLists.txt

# Configure the build of qt4_lite.

# N.B. this file is generated so if you edit it you will lose all your
# changes the next time it is generated (typically by running
# either/both the update_added_packages.sh or update_pango_packages.sh
# scripts).  If those scripts do not provide good results, then
# consider changing their source files (e.g., by editing the files
# used in those scripts) or add a patch to be run by those scripts.

# Copyright (C) 2013 Alan W. Irwin

# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with this file; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

# Many of the details of this epa_build configuration were derived from
# <http://www.linuxfromscratch.org/blfs/view/svn/x/qt4.html>.

set(PACKAGE qt4_lite)

# List of dependencies (most of which are build tools) which should be
# ignored.
set(ignored_dependencies_LIST ${extra_ignored_dependencies_list})

# The assumption here is that for Windows platforms Qt4 is self-contained
# and therefore does not rely on external libraries (at least if you configure
# the in-house version of those).  For Linux platforms the dependencies will
# just have to be resolved by system versions rather than building a lot
# of additional packages.
set(dependencies_LIST)

# Do boilerplate tasks that must be done for each different project
# that is configured as part of epa_build.
epa_boilerplate(
  ignored_dependencies_LIST
  PACKAGE
  dependencies_LIST
  dependencies_targets
  EPA_PATH
  source_PATH
  )

set(CFLAGS "$ENV{CFLAGS}")
set(CXXFLAGS "$ENV{CXXFLAGS}")

# Drop -fvisibility=hidden since that option may not work for Qt4.
# (May test this later if I get everything to work.)
string(REGEX REPLACE "-fvisibility=hidden" "" CFLAGS "${CFLAGS}")
string(REGEX REPLACE "-fvisibility=hidden" "" CXXFLAGS "${CXXFLAGS}")

# Data that is related to downloads.
set(URL http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz)
# Temporary to save download bandwidth/time while debugging this.
#set(URL /home/software/build_qt4/qt-everywhere-opensource-src-4.8.5.tar.gz)
set(DOWNLOAD_HASH_TYPE MD5)
set(DOWNLOAD_HASH 1864987bdbb2f58f8ae8b350dfdbe133)

# Many of these are recommended by BLFS, but I have tried to use
# a consistent install prefix and I have also turned off as
# much as possible for this "lite" version.
set(config_arguments

  # Installation options:
  -sysconfdir ${EPA_CMAKE_INSTALL_PREFIX}/etc/xdg

  # Configure options:
  -release
  -confirm-license
  -opensource
  # Need to be consistent with system versions of PyQt4/QtGui.so which need
  # a libQtGui.so library which contains QWidget::accessibleName() const
  # and QWidget::accessibleDescription() const.
  -accessibility

  # Try to get rid of everything to do with sql by eliminating all possible
  # drivers.
  -no-sql-db2
  -no-sql-ibase
  -no-sql-mysql
  -no-sql-oci
  -no-sql-odbc
  -no-sql-psql
  -no-sql-sqlite
  -no-sql-sqlite2
  -no-sql-sqlite_symbian
  -no-sql-symsql
  -no-sql-tds

  -no-qt3support
  -no-xmlpatterns
  -no-multimedia
  -no-audio-backend
  -no-phonon
  -no-phonon-backend

  # Need svg
   -svg

  -no-webkit
  -no-javascript-jit
  -no-script
  -no-scripttools
  -no-declarative
  -no-declarative-debug
  # Third party libraries (drop if possible but if needed by PLplot, use
  # in-house Qt4 versions of these to reduce dependencies):
  -qt-zlib
  -no-gif
  -qt-libtiff
  -qt-libpng
  -no-libmng
  -qt-libjpeg
  -no-openssl
  # Additional options:

  # Drop all components other than libs
  -nomake tools
  -nomake examples
  -nomake demos
  -nomake docs
  -nomake translations

  -optimized-qmake

  # Need gui which happens by default (there is no -gui option)
  # if you do not specify -no-gui

  -no-nis
  -no-cups
  -no-iconv
  -no-dbus

  # Qt/X11 only: (leave everything default)
  )

# Note QTDIR= below.  Setting that environment variable is recommended by method 2 of BLFS.

ExternalProject_Add(
  build_qt4_lite
  DEPENDS ${dependencies_targets}
  URL ${URL}
  URL_HASH ${DOWNLOAD_HASH_TYPE}=${DOWNLOAD_HASH}
  CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} QTDIR=${EPA_CMAKE_INSTALL_PREFIX} "CFLAGS=${CFLAGS}" "CXXFLAGS=${CXXFLAGS}" ${source_PATH}/${EPA_CONFIGURE_COMMAND} ${config_arguments}
  BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} QTDIR=${EPA_CMAKE_INSTALL_PREFIX} ${EPA_PARALLEL_MAKE_COMMAND}
  BUILD_IN_SOURCE 0
  INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} QTDIR=${EPA_CMAKE_INSTALL_PREFIX} ${EPA_PARALLEL_MAKE_COMMAND} install
  #STEP_TARGETS update configure build install test
  )

add_custom_command(
  OUTPUT
  ${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-update
  COMMAND ${CMAKE_COMMAND} -E echo "make two code fixups recommended by BLFS."
  COMMAND ${SED_EXECUTABLE} -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" ${EPA_BASE}/Source/build_${PACKAGE}/config.tests/unix/libmng/libmng.cpp
  COMMAND ${SED_EXECUTABLE} -i "/CONFIG -/ a\\isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../.." ${EPA_BASE}/Source/build_${PACKAGE}/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro
  APPEND
  )

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install_png.sh
"install -v -Dm644 ${EPA_BASE}/Source/build_${PACKAGE}/src/gui/dialogs/images/qtlogo-64.png ${EPA_CMAKE_INSTALL_PREFIX}/usr/share/pixmaps/qt4logo.png
install -v -Dm644 ${EPA_BASE}/Source/build_${PACKAGE}/tools/assistant/tools/assistant/images/assistant-128.png ${EPA_CMAKE_INSTALL_PREFIX}/usr/share/pixmaps/assistant-qt4.png
install -v -Dm644 ${EPA_BASE}/Source/build_${PACKAGE}/tools/designer/src/designer/images/designer.png ${EPA_CMAKE_INSTALL_PREFIX}/usr/share/pixmaps/designer-qt4.png
install -v -Dm644 ${EPA_BASE}/Source/build_${PACKAGE}/tools/linguist/linguist/images/icons/linguist-128-32.png ${EPA_CMAKE_INSTALL_PREFIX}/usr/share/pixmaps/linguist-qt4.png
install -v -Dm644 ${EPA_BASE}/Source/build_${PACKAGE}/tools/qdbus/qdbusviewer/images/qdbusviewer-128.png ${EPA_CMAKE_INSTALL_PREFIX}/usr/share/pixmaps/qdbusviewer-qt4.png
"
  )

add_custom_command(
  OUTPUT
  ${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-install
  COMMAND ${CMAKE_COMMAND} -E echo "install some addition png files recommended by BLFS."
  COMMAND ${BASH_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/install_png.sh
  APPEND
  )

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install_fixups.sh
"for file in `basename -a -s .prl ${EPA_CMAKE_INSTALL_PREFIX}/lib/lib*.prl`; do
  sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\\1/' ${EPA_CMAKE_INSTALL_PREFIX}/lib/\${file}.prl
  perl -pi -e \"s, -L\$PWD/?\\S+,,g\" ${EPA_CMAKE_INSTALL_PREFIX}/lib/pkgconfig/\${file##lib}.pc
done

unset file
"
  )

add_custom_command(
  OUTPUT
  ${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-install
  COMMAND ${CMAKE_COMMAND} -E echo "install fixups recommended by BLFS."
  COMMAND ${BASH_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/install_fixups.sh
  APPEND
  )

# N.B. I have explicitly ignored all post-install Qt4 configuration recommended
# by BLFS because I don't think that will be needed by PLplot.