Received: by mail.netbsd.org (Postfix, from userid 605) id 9025184D6C; Tue, 9 Aug 2022 16:08:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id C814B84D58 for ; Tue, 9 Aug 2022 16:08:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id gTSU_dg6O5C2 for ; Tue, 9 Aug 2022 16:08:44 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id E3F4584D0E for ; Tue, 9 Aug 2022 16:08:43 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id DA61FFB1A; Tue, 9 Aug 2022 16:08:43 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1660061323259670" MIME-Version: 1.0 Date: Tue, 9 Aug 2022 16:08:43 +0000 From: "Thomas Klausner" Subject: CVS commit: pkgsrc/devel/cmake To: pkgsrc-changes@NetBSD.org Reply-To: wiz@netbsd.org X-Mailer: log_accum Message-Id: <20220809160843.DA61FFB1A@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1660061323259670 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: wiz Date: Tue Aug 9 16:08:43 UTC 2022 Added Files: pkgsrc/devel/cmake: build.mk Log Message: cmake: add build.mk file for use by other packages Not a complete replacement for USE_CMAKE yet, but further development can happen in-tree. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 pkgsrc/devel/cmake/build.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1660061323259670 Content-Disposition: inline Content-Length: 2901 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Added files: Index: pkgsrc/devel/cmake/build.mk diff -u /dev/null pkgsrc/devel/cmake/build.mk:1.1 --- /dev/null Tue Aug 9 16:08:43 2022 +++ pkgsrc/devel/cmake/build.mk Tue Aug 9 16:08:43 2022 @@ -0,0 +1,102 @@ +# $NetBSD: build.mk,v 1.1 2022/08/09 16:08:43 wiz Exp $ +# +# This Makefile fragment supports building using the CMake build tool. +# +# User-settable variables: +# +# CMAKE_GENERATOR +# Which build tool to use. +# +# Possible: make ninja +# Default: make +# +# Package-settable variables: +# +# CMAKE_CONFIGURE_ARGS +# Arguments to pass to CMake during the configure stage. Defaults +# to CMAKE_ARGS for backwards compatibility with USE_CMAKE. +# +# CMAKE_BUILD_ARGS +# Arguments to pass to CMake during build. Default: empty +# +# CMAKE_INSTALL_ARGS +# Arguments to pass to CMake during installation: Default: empty +# +# CONFIGURE_DIRS +# Directories relative to WRKSRC in which to run CMake. Usually +# only one, the toplevel. +# +# BUILD_DIRS +# Directories relative to WRKSRC in which to build. Defaults +# to CONFIGURE_DIRS. +# +# TEST_DIRS +# Directories relative to WRKSRC in which to run the tests. Defaults +# to CONFIGURE_DIRS. +# +# INSTALL_DIRS +# Directories relative to WRKSRC in which to run the 'install' +# step. Defaults to CONFIGURE_DIRS. + +CMAKE_REQD?= 0 +.for version in ${CMAKE_REQD} +TOOL_DEPENDS+= cmake>=${version}:../../devel/cmake +.endfor + +CMAKE_CONFIGURE_ARGS?= ${CMAKE_ARGS} + +CONFIGURE_ENV+= BUILDLINK_DIR=${BUILDLINK_DIR} + +CMAKE_BUILD_DIR?= cmake-pkgsrc-build +CMAKE_GENERATOR?= make +CMAKE_BUILD_ARGS?= -j ${_MAKE_JOBS_N:U1} +CMAKE_INSTALL_ARGS?= # empty +.if ${CMAKE_GENERATOR} == "ninja" +TOOL_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build +_CMAKE_BUILD_SYSTEM?= Ninja +_CMAKE_BUILD_TOOL?= ninja +.else +_CMAKE_BUILD_SYSTEM?= Unix Makefiles +_CMAKE_BUILD_TOOL?= ${MAKE} +.endif + +CONFIGURE_DIRS?= . +BUILD_DIRS?= ${CONFIGURE_DIRS} +INSTALL_DIRS?= ${CONFIGURE_DIRS} +TEST_DIRS?= ${CONFIGURE_DIRS} + +.PHONY: cmake-configure cmake-build cmake-install cmake-test + +do-configure: cmake-configure +cmake-configure: +.for d in ${CONFIGURE_DIRS} + ${RUN} cd ${WRKSRC}/${d} && ${SETENV} ${CONFIGURE_ENV} cmake \ + --install-prefix ${PREFIX} \ + -B ${CMAKE_BUILD_DIR} \ + -G ${_CMAKE_BUILD_SYSTEM:Q} \ + ${CMAKE_ARGS} +.endfor + +do-build: cmake-build +cmake-build: +.for d in ${BUILD_DIRS} + ${RUN} cd ${WRKSRC}/${d}/${CMAKE_BUILD_DIR} && \ + ${SETENV} ${MAKE_ENV} \ + ${_CMAKE_BUILD_TOOL} ${CMAKE_BUILD_ARGS} +.endfor + +do-test: cmake-test +cmake-test: +.for d in ${TEST_DIRS} + ${RUN} cd ${WRKSRC}/${d}/${CMAKE_BUILD_DIR} && \ + ${SETENV} ${TEST_ENV} \ + ${_CMAKE_BUILD_TOOL} ${CMAKE_BUILD_ARGS} test +.endfor + +do-install: cmake-install +cmake-install: +.for d in ${INSTALL_DIRS} + ${RUN} cd ${WRKSRC}/${d}/${CMAKE_BUILD_DIR} && \ + ${SETENV} ${INSTALL_ENV} \ + ${_CMAKE_BUILD_TOOL} ${CMAKE_INSTALL_ARGS} install +.endfor --_----------=_1660061323259670--