mirror of
https://git.freebsd.org/ports.git
synced 2025-06-23 05:30:31 -04:00
*/cmake*: hoist cmake version to cmake.mk (+)
Differential Revision: D31894 (revisited)
This commit is contained in:
parent
8d9a92ff1d
commit
7bdeb4414c
7 changed files with 53 additions and 43 deletions
|
@ -17,6 +17,7 @@
|
||||||
# testing add the test target based on ctest
|
# testing add the test target based on ctest
|
||||||
# Additionally, CMAKE_TESTING_ON, CMAKE_TESTING_OFF, CMAKE_TESTING_ARGS, CMAKE_TESTING_TARGET
|
# Additionally, CMAKE_TESTING_ON, CMAKE_TESTING_OFF, CMAKE_TESTING_ARGS, CMAKE_TESTING_TARGET
|
||||||
# can be defined to override the default values.
|
# can be defined to override the default values.
|
||||||
|
# _internal Not to be used by any other ports than the ones created from the release-tarball of cmake
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Additional variables that affect cmake behaviour:
|
# Additional variables that affect cmake behaviour:
|
||||||
|
@ -47,7 +48,9 @@
|
||||||
.if !defined(_INCLUDE_USES_CMAKE_MK)
|
.if !defined(_INCLUDE_USES_CMAKE_MK)
|
||||||
_INCLUDE_USES_CMAKE_MK= yes
|
_INCLUDE_USES_CMAKE_MK= yes
|
||||||
|
|
||||||
_valid_ARGS= insource run noninja testing
|
_valid_ARGS= insource run noninja testing _internal
|
||||||
|
|
||||||
|
_CMAKE_VERSION= 3.24.3
|
||||||
|
|
||||||
# Sanity check
|
# Sanity check
|
||||||
. for arg in ${cmake_ARGS}
|
. for arg in ${cmake_ARGS}
|
||||||
|
@ -56,24 +59,26 @@ IGNORE= Incorrect 'USES+= cmake:${cmake_ARGS}' usage: argument [${arg}] is not r
|
||||||
. endif
|
. endif
|
||||||
. endfor
|
. endfor
|
||||||
|
|
||||||
|
# Check whehter other flags than only '_internal' are passed (this should be equivalent to PORT = devel/cmake-core
|
||||||
|
. if ${cmake_ARGS} != _internal
|
||||||
CMAKE_BIN= ${LOCALBASE}/bin/cmake
|
CMAKE_BIN= ${LOCALBASE}/bin/cmake
|
||||||
BUILD_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
|
BUILD_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
|
||||||
|
|
||||||
. if ${cmake_ARGS:Mrun}
|
. if ${cmake_ARGS:Mrun}
|
||||||
RUN_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
|
RUN_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
. if defined(WITH_DEBUG)
|
. if defined(WITH_DEBUG)
|
||||||
CMAKE_BUILD_TYPE?= Debug
|
CMAKE_BUILD_TYPE?= Debug
|
||||||
. else
|
. else
|
||||||
CMAKE_BUILD_TYPE?= Release
|
CMAKE_BUILD_TYPE?= Release
|
||||||
. endif #defined(WITH_DEBUG)
|
. endif #defined(WITH_DEBUG)
|
||||||
|
|
||||||
PLIST_SUB+= CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:tl}"
|
PLIST_SUB+= CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:tl}"
|
||||||
|
|
||||||
. if defined(STRIP) && ${STRIP} != "" && !defined(WITH_DEBUG)
|
. if defined(STRIP) && ${STRIP} != "" && !defined(WITH_DEBUG)
|
||||||
INSTALL_TARGET?= install/strip
|
INSTALL_TARGET?= install/strip
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \
|
CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \
|
||||||
-DCMAKE_CXX_COMPILER:STRING="${CXX}" \
|
-DCMAKE_CXX_COMPILER:STRING="${CXX}" \
|
||||||
|
@ -94,77 +99,84 @@ CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \
|
||||||
-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON
|
-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON
|
||||||
|
|
||||||
# Handle the option-like CMAKE_ON and CMAKE_OFF lists.
|
# Handle the option-like CMAKE_ON and CMAKE_OFF lists.
|
||||||
. for _bool_kind in ON OFF
|
. for _bool_kind in ON OFF
|
||||||
. if defined(CMAKE_${_bool_kind})
|
. if defined(CMAKE_${_bool_kind})
|
||||||
CMAKE_ARGS+= ${CMAKE_${_bool_kind}:C/.*/-D&:BOOL=${_bool_kind}/}
|
CMAKE_ARGS+= ${CMAKE_${_bool_kind}:C/.*/-D&:BOOL=${_bool_kind}/}
|
||||||
. endif
|
. endif
|
||||||
. endfor
|
. endfor
|
||||||
|
|
||||||
CMAKE_INSTALL_PREFIX?= ${PREFIX}
|
CMAKE_INSTALL_PREFIX?= ${PREFIX}
|
||||||
|
|
||||||
. if defined(BATCH) || defined(PACKAGE_BUILDING)
|
. if defined(BATCH) || defined(PACKAGE_BUILDING)
|
||||||
CMAKE_NOCOLOR= yes
|
CMAKE_NOCOLOR= yes
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
. if defined(CMAKE_NOCOLOR)
|
. if defined(CMAKE_NOCOLOR)
|
||||||
CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF
|
CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
_CMAKE_MSG= "===> Performing in-source build"
|
_CMAKE_MSG= "===> Performing in-source build"
|
||||||
CMAKE_SOURCE_PATH?= ${WRKSRC}
|
CMAKE_SOURCE_PATH?= ${WRKSRC}
|
||||||
|
|
||||||
. if empty(cmake_ARGS:Minsource)
|
. if empty(cmake_ARGS:Minsource)
|
||||||
_CMAKE_MSG= "===> Performing out-of-source build"
|
_CMAKE_MSG= "===> Performing out-of-source build"
|
||||||
CONFIGURE_WRKSRC= ${WRKDIR}/.build
|
CONFIGURE_WRKSRC= ${WRKDIR}/.build
|
||||||
BUILD_WRKSRC?= ${CONFIGURE_WRKSRC}
|
BUILD_WRKSRC?= ${CONFIGURE_WRKSRC}
|
||||||
INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC}
|
INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC}
|
||||||
TEST_WRKSRC?= ${CONFIGURE_WRKSRC}
|
TEST_WRKSRC?= ${CONFIGURE_WRKSRC}
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
# By default we use the ninja generator.
|
# By default we use the ninja generator.
|
||||||
# Except, if cmake:run is set (cmake not wanted as generator)
|
# Except, if cmake:run is set (cmake not wanted as generator)
|
||||||
# fortran is used, as the ninja-generator does not handle it.
|
# fortran is used, as the ninja-generator does not handle it.
|
||||||
# or if CONFIGURE_WRKSRC does not match BUILD_WRKSRC or INSTALL_WRKSRC
|
# or if CONFIGURE_WRKSRC does not match BUILD_WRKSRC or INSTALL_WRKSRC
|
||||||
# as the build.ninja file won't be where ninja expects it.
|
# as the build.ninja file won't be where ninja expects it.
|
||||||
. if empty(cmake_ARGS:Mnoninja) && empty(cmake_ARGS:Mrun) && empty(USES:Mfortran)
|
. if empty(cmake_ARGS:Mnoninja) && empty(cmake_ARGS:Mrun) && empty(USES:Mfortran)
|
||||||
. if "${CONFIGURE_WRKSRC}" == "${BUILD_WRKSRC}" && "${CONFIGURE_WRKSRC}" == "${INSTALL_WRKSRC}"
|
. if "${CONFIGURE_WRKSRC}" == "${BUILD_WRKSRC}" && "${CONFIGURE_WRKSRC}" == "${INSTALL_WRKSRC}"
|
||||||
# USES=gmake sets MAKE_CMD and ninja.mk does too (it also messes with MAKEFILE and MAKE_CMD).
|
# USES=gmake sets MAKE_CMD and ninja.mk does too (it also messes with MAKEFILE and MAKE_CMD).
|
||||||
. if ! empty(USES:Mgmake)
|
. if ! empty(USES:Mgmake)
|
||||||
BROKEN= USES=gmake is incompatible with cmake's ninja-generator (try cmake:noninja)
|
BROKEN= USES=gmake is incompatible with cmake's ninja-generator (try cmake:noninja)
|
||||||
. endif
|
. endif
|
||||||
# USES=emacs appends EMACS=<path> to MAKE_ARGS, which then get passed to ninja.
|
# USES=emacs appends EMACS=<path> to MAKE_ARGS, which then get passed to ninja.
|
||||||
# Since ninja doesn't support that kind of variable-setting on the command-line,
|
# Since ninja doesn't support that kind of variable-setting on the command-line,
|
||||||
# it errors out.
|
# it errors out.
|
||||||
. if ! empty(USES:Memacs)
|
. if ! empty(USES:Memacs)
|
||||||
BROKEN= USES=emacs is incompatible with cmake's ninja-generator (try cmake:noninja)
|
BROKEN= USES=emacs is incompatible with cmake's ninja-generator (try cmake:noninja)
|
||||||
. endif
|
. endif
|
||||||
. include "${USESDIR}/ninja.mk"
|
. include "${USESDIR}/ninja.mk"
|
||||||
|
. endif
|
||||||
. endif
|
. endif
|
||||||
. endif
|
|
||||||
|
|
||||||
. if !target(do-configure)
|
. if !target(do-configure)
|
||||||
do-configure:
|
do-configure:
|
||||||
@${ECHO_MSG} ${_CMAKE_MSG}
|
@${ECHO_MSG} ${_CMAKE_MSG}
|
||||||
${MKDIR} ${CONFIGURE_WRKSRC}
|
${MKDIR} ${CONFIGURE_WRKSRC}
|
||||||
@cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH}
|
@cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH}
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
. if !target(do-test) && ${cmake_ARGS:Mtesting}
|
. if !target(do-test) && ${cmake_ARGS:Mtesting}
|
||||||
CMAKE_TESTING_ON?= BUILD_TESTING
|
CMAKE_TESTING_ON?= BUILD_TESTING
|
||||||
CMAKE_TESTING_TARGET?= test
|
CMAKE_TESTING_TARGET?= test
|
||||||
|
|
||||||
# Handle the option-like CMAKE_TESTING_ON and CMAKE_TESTING_OFF lists.
|
# Handle the option-like CMAKE_TESTING_ON and CMAKE_TESTING_OFF lists.
|
||||||
. for _bool_kind in ON OFF
|
. for _bool_kind in ON OFF
|
||||||
. if defined(CMAKE_TESTING_${_bool_kind})
|
. if defined(CMAKE_TESTING_${_bool_kind})
|
||||||
CMAKE_TESTING_ARGS+= ${CMAKE_TESTING_${_bool_kind}:C/.*/-D&:BOOL=${_bool_kind}/}
|
CMAKE_TESTING_ARGS+= ${CMAKE_TESTING_${_bool_kind}:C/.*/-D&:BOOL=${_bool_kind}/}
|
||||||
. endif
|
. endif
|
||||||
. endfor
|
. endfor
|
||||||
|
|
||||||
do-test:
|
do-test:
|
||||||
@cd ${BUILD_WRKSRC} && \
|
@cd ${BUILD_WRKSRC} && \
|
||||||
${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_TESTING_ARGS} ${CMAKE_SOURCE_PATH} && \
|
${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_TESTING_ARGS} ${CMAKE_SOURCE_PATH} && \
|
||||||
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET} && \
|
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET} && \
|
||||||
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${CMAKE_TESTING_TARGET}
|
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${CMAKE_TESTING_TARGET}
|
||||||
|
. endif
|
||||||
|
. endif
|
||||||
|
|
||||||
|
. if !empty(cmake_ARGS:M_internal)
|
||||||
|
MASTER_SITES?= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
|
||||||
|
https://www.cmake.org/files/v${DISTVERSION}/
|
||||||
|
|
||||||
. endif
|
. endif
|
||||||
|
|
||||||
.endif #!defined(_INCLUDE_USES_CMAKE_MK)
|
.endif #!defined(_INCLUDE_USES_CMAKE_MK)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
PORTNAME= cmake
|
PORTNAME= cmake
|
||||||
# Remember to update devel/cmake-doc and devel/cmake-gui as well.
|
# Remember to update devel/cmake-doc and devel/cmake-gui as well.
|
||||||
DISTVERSION= 3.24.3
|
DISTVERSION= ${_CMAKE_VERSION}
|
||||||
CATEGORIES= devel
|
CATEGORIES= devel
|
||||||
MASTER_SITES= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
|
MASTER_SITES= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
|
||||||
https://www.cmake.org/files/v${PORTVERSION}/
|
https://www.cmake.org/files/v${PORTVERSION}/
|
||||||
|
@ -19,7 +19,7 @@ LIB_DEPENDS= libcurl.so:ftp/curl \
|
||||||
libuv.so:devel/libuv \
|
libuv.so:devel/libuv \
|
||||||
librhash.so:security/rhash
|
librhash.so:security/rhash
|
||||||
|
|
||||||
USES= compiler:c++11-lang cpe ncurses
|
USES= cmake:_internal compiler:c++11-lang cpe ncurses
|
||||||
|
|
||||||
CPE_VENDOR= cmake_project
|
CPE_VENDOR= cmake_project
|
||||||
HAS_CONFIGURE= yes
|
HAS_CONFIGURE= yes
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
PORTNAME= cmake
|
PORTNAME= cmake
|
||||||
DISTVERSION= 3.24.3
|
DISTVERSION= ${_CMAKE_VERSION}
|
||||||
CATEGORIES= devel
|
CATEGORIES= devel
|
||||||
MASTER_SITES= https://www.cmake.org/files/v${PORTVERSION:R}/
|
|
||||||
PKGNAMESUFFIX= -doc
|
PKGNAMESUFFIX= -doc
|
||||||
|
|
||||||
MAINTAINER= kde@FreeBSD.org
|
MAINTAINER= kde@FreeBSD.org
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
PORTNAME= cmake
|
PORTNAME= cmake
|
||||||
DISTVERSION= 3.24.3
|
DISTVERSION= ${_CMAKE_VERSION}
|
||||||
CATEGORIES= devel
|
CATEGORIES= devel
|
||||||
MASTER_SITES= https://www.cmake.org/files/v${PORTVERSION:R}/
|
|
||||||
PKGNAMESUFFIX= -gui-${FLAVOR}
|
PKGNAMESUFFIX= -gui-${FLAVOR}
|
||||||
|
|
||||||
MAINTAINER= kde@FreeBSD.org
|
MAINTAINER= kde@FreeBSD.org
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
PORTNAME= cmake
|
PORTNAME= cmake
|
||||||
DISTVERSION= 3.24.3
|
DISTVERSION= ${_CMAKE_VERSION}
|
||||||
CATEGORIES= devel
|
CATEGORIES= devel
|
||||||
MASTER_SITES= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \
|
|
||||||
https://www.cmake.org/files/v${DISTVERSION}/
|
|
||||||
PKGNAMESUFFIX= -man
|
PKGNAMESUFFIX= -man
|
||||||
|
|
||||||
MAINTAINER= kde@FreeBSD.org
|
MAINTAINER= kde@FreeBSD.org
|
||||||
|
@ -11,6 +9,8 @@ WWW= https://www.cmake.org/
|
||||||
|
|
||||||
LICENSE= BSD3CLAUSE
|
LICENSE= BSD3CLAUSE
|
||||||
|
|
||||||
|
DISTINFO_FILE= ${.CURDIR}/../cmake-core/distinfo
|
||||||
|
|
||||||
BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
|
BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
|
||||||
|
|
||||||
USES= cmake
|
USES= cmake
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
PORTNAME= cmake
|
PORTNAME= cmake
|
||||||
DISTVERSION= 3.24.3
|
DISTVERSION= ${_CMAKE_VERSION}
|
||||||
CATEGORIES= devel
|
CATEGORIES= devel
|
||||||
|
|
||||||
MAINTAINER= kde@FreeBSD.org
|
MAINTAINER= kde@FreeBSD.org
|
||||||
|
|
|
@ -16,6 +16,6 @@ GH_ACCOUNT= Kurento
|
||||||
|
|
||||||
NO_ARCH= yes
|
NO_ARCH= yes
|
||||||
|
|
||||||
PLIST_SUB= CMAKE_VERSION=3.24
|
PLIST_SUB= CMAKE_VERSION=${_CMAKE_VERSION:R}
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.mk>
|
||||||
|
|
Loading…
Add table
Reference in a new issue