aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/Uses/qmake.mk
diff options
context:
space:
mode:
authormakc <makc@FreeBSD.org>2014-01-07 00:16:52 +0800
committermakc <makc@FreeBSD.org>2014-01-07 00:16:52 +0800
commit8fb80a5f23ee7dd03872809dbd790ea4f90c6ff5 (patch)
treee9ca925ce8537078366a02e4f615c5847746c0b5 /Mk/Uses/qmake.mk
parent5b251e589961b796d7eafa23de894f129f92bf6d (diff)
downloadfreebsd-ports-gnome-8fb80a5f23ee7dd03872809dbd790ea4f90c6ff5.tar.gz
freebsd-ports-gnome-8fb80a5f23ee7dd03872809dbd790ea4f90c6ff5.tar.zst
freebsd-ports-gnome-8fb80a5f23ee7dd03872809dbd790ea4f90c6ff5.zip
In preparation for Qt 5 ports:
Mk/Uses/qmake.mk: - Add support for out-of-source builds - Add support for Qt 5 ports - Respect WITH_DEBUG Mk/bsd.qt.mk: - Massive rework for Qt 5 ports - Remove '-phonon' from global configure args, thus allow qt4-designer and qt4-qtconfig to be built without Phonon support [1] devel/qmake4: - Improve mkspecs for gcc (mainly sync with linux version) and clang devel/qt4-corelib: - Convert to USES=iconv - Remove ancient patch devel/qt4-designer: - Remove reference to WRKSRC from installed pkgconfig files [2] - Don't build Qt Designer plugin for Phonon from outdated Qt sources. Separate port for plugin will be committed later devel/qt4-assistant-adp, devel/qt4-libqtassistantclient: - Convert to USES=qmake Clean up Qt4 ports: - Update comments - Update description; use common description - Consistently use QT_INCDIR, QT_LIBDIR, etc. - Use options helpers - Convert to new LIB_DEPENDS syntax - Update DESKTOP_ENTRIES to avoid conflicts with Qt 5 ports - Rename/move several ports for unification with Qt 5 ports PR: ports/184620 [1] Reported by: Kevin Zheng <kevinz5000@gmail.com> PR: ports/181141 [2] Reported by: thierry PR: ports/185101 Exp-run by: bdrewery This is mostly solely avilla's work in area51, kudos to him! And a couple commits from myself, so you know who's collecting pointyhats :)
Diffstat (limited to 'Mk/Uses/qmake.mk')
-rw-r--r--Mk/Uses/qmake.mk90
1 files changed, 70 insertions, 20 deletions
diff --git a/Mk/Uses/qmake.mk b/Mk/Uses/qmake.mk
index 19e991d15d5f..7ac00a702fe2 100644
--- a/Mk/Uses/qmake.mk
+++ b/Mk/Uses/qmake.mk
@@ -1,15 +1,16 @@
# $FreeBSD$
#
-# Provide support for qmake based projects
+# Provide support for qmake-based projects
#
# MAINTAINER: kde@FreeBSD.org
#
# Feature: qmake
# Usage: USES=qmake or USES=qmake:ARGS
-# Must be used along with 'USE_QT4='
-# Valid ARGS: norecursive
+# Must be used along with 'USE_QT*=#'
+# Valid ARGS: norecursive outsource
# ARGS description:
# norecursive Don't pass -recursive argument to qmake binary
+# outsource Perform an out-of-source build
#
#
# Variables for ports:
@@ -18,7 +19,8 @@
# QMAKE_ARGS - Arguments passed to qmake.
# Default: see below
# QMAKE_SOURCE_PATH - Path to qmake project files.
-# Default: empty (autodetect)
+# Default: ${WRKSRC} if out-of-source build is
+# requested, empty otherwise.
#
# User defined variables:
# QMAKE_VERBOSE - Enable verbose configure output.
@@ -27,25 +29,51 @@
.if !defined(_INCLUDE_USES_QMAKE_MK)
_INCLUDE_USES_QMAKE_MK= yes
-.if !defined(NO_STAGE)
-DESTDIRNAME= INSTALL_ROOT
+# _QT_VERSION is defined in bsd.qt.mk, only if a correct Qt version was selected
+# via USE_QT*.
+.if empty(_QT_VERSION)
+IGNORE= 'USES+= qmake' must be accompanied with 'USE_QT[${_QT_SUPPORTED:S/ //g}]= #'
.endif
+# _env is a private argument used only by bsd.qt.mk to get variables and custom
+# targets (currently, only qmake-configure), without qmake being added to the
+# configure stage.
+_VALID_ARGS= norecursive outsource _env
+_qmake_ARGS= ${qmake_ARGS:S/\:/ /g}
+
.if defined(qmake_ARGS)
-. if ${qmake_ARGS} == "norecursive"
-QMAKE_NORECURSIVE= yes
-. else
-IGNORE= Incorrect 'USES+= qmake' usage: argument '${qmake_ARGS}' is not recognized
-. endif
+. for arg in ${_qmake_ARGS}
+. if empty(_VALID_ARGS:M${arg})
+IGNORE= Incorrect 'USES+= qmake' usage: argument '${arg}' is not recognized
+. endif
+. endfor
.endif
-.if !defined(USE_QT4)
-IGNORE= 'USES+= qmake' must be accompanied with 'USE_QT4= #'
+.if ! ${_qmake_ARGS:M_env}
+USE_QT${_QT_VERSION:R:R}+= qmake_build
.endif
-USE_QT4+= qmake_build
+# QMAKESPEC belongs to bsd.qt.mk.
+QMAKE_ENV?= ${CONFIGURE_ENV}
+QMAKE_ARGS+= -spec ${QMAKESPEC} \
+ QMAKE_CC="${CC}" QMAKE_CXX="${CXX}" \
+ QMAKE_LINK_C="${CC}" QMAKE_LINK_C_SHLIB="${CC}" \
+ QMAKE_LINK="${CXX}" QMAKE_LINK_SHLIB="${CXX}" \
+ QMAKE_CFLAGS="${CFLAGS}" \
+ QMAKE_CXXFLAGS="${CXXFLAGS}" \
+ QMAKE_LFLAGS="${LDFLAGS}" \
+ PREFIX="${PREFIX}"
-.if !defined(QMAKE_NORECURSIVE)
+.if defined(WITH_DEBUG)
+QMAKE_ARGS+= CONFIG+="debug" \
+ CONFIG-="release"
+.else
+QMAKE_ARGS+= CONFIG+="release" \
+ CONFIG-="debug separate_debug_info"
+.endif # defined(WITH_DEBUG)
+
+# We set -recursive by default to keep qmake from running in the build stage.
+.if ! ${_qmake_ARGS:Mnorecursive}
QMAKE_ARGS+= -recursive
.endif
@@ -53,11 +81,33 @@ QMAKE_ARGS+= -recursive
QMAKE_ARGS+= -d
.endif
-QMAKE_SOURCE_PATH?= ${QMAKE_PRO}
+# _QMAKE_WRKSRC (and _QMAKE, below) are needed to abstract the qmake target and
+# use it for both qtbase and USES=qmake ports. They are private, not supposed to
+# be used anywhere else.
+_QMAKE_WRKSRC?= ${CONFIGURE_WRKSRC}
+.if ${_qmake_ARGS:Moutsource}
+CONFIGURE_WRKSRC= ${WRKDIR}/.build
+BUILD_WRKSRC= ${CONFIGURE_WRKSRC}
+INSTALL_WRKSRC= ${BUILD_WRKSRC}
+QMAKE_SOURCE_PATH?= ${WRKSRC}
+.else
+QMAKE_SOURCE_PATH?= # empty
+.endif
+
+.if !defined(NO_STAGE) && ! ${_qmake_ARGS:M_env}
+DESTDIRNAME= INSTALL_ROOT
+.endif
+
+# Define a custom target to make it usable by bsd.qt.mk for internal Qt
+# configuration.
+qmake-configure:
+ @${MKDIR} ${_QMAKE_WRKSRC}
+ @cd ${_QMAKE_WRKSRC} && \
+ ${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} ${QMAKE_SOURCE_PATH}
-.if !target(do-configure)
-do-configure:
- @cd ${CONFIGURE_WRKSRC} && ${SETENV} ${QMAKE_ENV} ${QMAKE} ${QMAKE_ARGS} ${QMAKE_SOURCE_PATH}
+.if !target(do-configure) && ! ${_qmake_ARGS:M_env}
+do-configure: qmake-configure
+ @${DO_NADA}
.endif
-.endif #!defined(_INCLUDE_USES_QMAKE_MK)
+.endif # !defined(_INCLUDE_USES_QMAKE_MK)