diff options
author | Tobias C. Berner <tcberner@FreeBSD.org> | 2018-06-28 17:39:53 +0000 |
---|---|---|
committer | Tobias C. Berner <tcberner@FreeBSD.org> | 2018-06-28 17:39:53 +0000 |
commit | b1a1d38bf9ef78334b640d30046388a9c055c3a9 (patch) | |
tree | 7b9785f1f0c244da1f5b69a2a610e3f37eb786a8 /Mk/Uses/qmake.mk | |
parent | bc77780d41178cf3d0327c79ac10737af704f236 (diff) | |
download | ports-b1a1d38bf9ef78334b640d30046388a9c055c3a9.tar.gz ports-b1a1d38bf9ef78334b640d30046388a9c055c3a9.zip |
Replace bsd.qt.mk by Uses/qt.mk and Uses/qt-dist.mk
From now on, ports that depend on Qt4 will have to set
USES= qt:4
USE_QT= foo bar
ports depending on Qt5 will use
USES= qt:5
USE_QT= foo bar
PR: 229225
Exp-run by: antoine
Reviewed by: mat
Approved by: portmgr (antoine)
Differential Revision: →https://reviews.freebsd.org/D15540
Notes
Notes:
svn path=/head/; revision=473503
Diffstat (limited to 'Mk/Uses/qmake.mk')
-rw-r--r-- | Mk/Uses/qmake.mk | 137 |
1 files changed, 84 insertions, 53 deletions
diff --git a/Mk/Uses/qmake.mk b/Mk/Uses/qmake.mk index 41b0da9c6d0f..ce9b0ebc4646 100644 --- a/Mk/Uses/qmake.mk +++ b/Mk/Uses/qmake.mk @@ -1,5 +1,13 @@ # $FreeBSD$ # +# There are three Qt related USES files with different access to Qt. +# - qmake: The port requires Qt's qmake to build -- creates the configure target +# - auto includes qt.mk +# - qt-dist: The port is a port for an part of Qt4 or Qt5 +# - auto inclues qt.mk +# - qt.mk - Dependency handling. USE_QT=foo bar +# +# # Provide support for qmake-based projects # # Feature: qmake @@ -9,6 +17,9 @@ # ARGS description: # norecursive Don't pass -recursive argument to qmake binary # outsource Perform an out-of-source build +# no_env Suppress modification of configure and make environment. +# no_configure Don't add the configure target -- this is implied by +# HAS_CONFIGURE=yes and GNU_CONFIGURE=yes # # # Variables for ports: @@ -33,77 +44,97 @@ .if !defined(_INCLUDE_USES_QMAKE_MK) _INCLUDE_USES_QMAKE_MK= yes -# _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 +# Suck in qt.mk +.include "${USESDIR}/qt.mk" -# _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 +_VALID_ARGS= norecursive outsource no_env no_configure -.for arg in ${qmake_ARGS} -. if empty(_VALID_ARGS:M${arg}) -IGNORE= Incorrect 'USES+= qmake' usage: argument '${arg}' is not recognized -. endif -.endfor +. for arg in ${qmake_ARGS} +. if empty(_VALID_ARGS:M${arg}) +IGNORE= Incorrect 'USES+= qmake' usage: argument '${arg}' is not recognized +. endif +. endfor -.if ! ${qmake_ARGS:M_env} -USE_QT${_QT_VERSION:R:R}+= qmake_build -.endif +# Check whether we need to add the configure target +_ADD_CONFIGURE_TARGET= yes +. if !empty(qmake_ARGS:Mno_configure) || defined(HAS_CONFIGURE) || defined(GNU_CONFIGURE) +_ADD_CONFIGURE_TARGET= # unset +. endif # 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}" \ - QMAKE_LIBS="${LIBS}" \ - QMAKE_CFLAGS_DEBUG="" \ - QMAKE_CFLAGS_RELEASE="" \ - QMAKE_CXXFLAGS_DEBUG="" \ - QMAKE_CXXFLAGS_RELEASE="" \ - PREFIX="${PREFIX}" - -.if defined(WITH_DEBUG) -QMAKE_ARGS+= CONFIG+="debug" \ - CONFIG-="release" -.else -QMAKE_ARGS+= CONFIG+="release" \ - CONFIG-="debug separate_debug_info" -.endif # defined(WITH_DEBUG) +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}" \ + QMAKE_LIBS="${LIBS}" \ + QMAKE_CFLAGS_DEBUG="" \ + QMAKE_CFLAGS_RELEASE="" \ + QMAKE_CXXFLAGS_DEBUG="" \ + QMAKE_CXXFLAGS_RELEASE="" \ + PREFIX="${PREFIX}" + +. if defined(WITH_DEBUG) +PLIST_SUB+= DEBUG="" +QMAKE_ARGS+= CONFIG+="debug" \ + CONFIG-="release" +. else +PLIST_SUB+= DEBUG="@comment " +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 +. if ! ${qmake_ARGS:Mnorecursive} +QMAKE_ARGS+= -recursive +. endif -.if defined(QMAKE_VERBOSE) -QMAKE_ARGS+= -d -.endif +. if defined(QMAKE_VERBOSE) +QMAKE_ARGS+= -d +. endif # _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} +. if ${qmake_ARGS:Moutsource} CONFIGURE_WRKSRC= ${WRKDIR}/.build BUILD_WRKSRC= ${CONFIGURE_WRKSRC} INSTALL_WRKSRC= ${BUILD_WRKSRC} TEST_WRKSRC= ${BUILD_WRKSRC} QMAKE_SOURCE_PATH?= ${WRKSRC} -.else +. else QMAKE_SOURCE_PATH?= # empty -.endif +. endif -.if ! ${qmake_ARGS:M_env} -DESTDIRNAME= INSTALL_ROOT -.endif +# Add qmake to USE_QT -- unless it's qmake itself +. if !${PORTNAME} == qmake +USE_QT+= qmake_build +. endif + +. if empty(qmake_ARGS:Mno_env) +DESTDIRNAME= INSTALL_ROOT +CONFIGURE_ENV+= QTDIR="${QT_ARCHDIR}" QMAKE="${QMAKE}" \ + MOC="${MOC}" RCC="${RCC}" UIC="${UIC}" \ + QMAKESPEC="${QMAKESPEC}" +CONFIGURE_ARGS+= --with-qt-includes=${QT_INCDIR} \ + --with-qt-libraries=${QT_LIBDIR} \ + --with-extra-includes=${LOCALBASE}/include \ + --with-extra-libs=${LOCALBASE}/lib +. endif + +_USES_POST+= qmake +.endif # _QMAKE_MK_INCLUDED + +# ============================================================================= +# +# ============================================================================= + +.if defined(_POSTMKINCLUDED) && !defined(_QMAKE_MK_POST_INCLUDED) +_QMAKE_MK_POST_INCLUDED= qmake.mk # Define a custom target to make it usable by bsd.qt.mk for internal Qt # configuration. @@ -114,8 +145,8 @@ qmake-configure: ${QMAKE_SOURCE_PATH} \ ${QMAKE_CONFIGURE_ARGS:?--:} ${QMAKE_CONFIGURE_ARGS} -.if !target(do-configure) && ! ${qmake_ARGS:M_env} +. if !target(do-configure) && !empty(_ADD_CONFIGURE_TARGET) _USES_configure+= 450:qmake-configure -.endif +. endif .endif # !defined(_INCLUDE_USES_QMAKE_MK) |