During g2k22 I looked at cmake.port.mk. The following change includes 3 main parts:
- Use cmake(1) and ctest(1) cmake(1) controls the build and install task/jobs. This is the way CMake prefers and it works very well for us. Full bulk build passed! Victims already fixed. - USE_NINJA Is no longer necessary but still optional (requested by sthen@). This diff removes all usage. Expect www/h2o (see at ports@) This is possible because of the use of cmake(1). - verbose IMHO It helps use to see easier what's going wrong and show up if other languages are calling. Example below. Before: ===> Regression tests for cmark-0.30.2p0 Test project /usr/ports/pobj/cmark-0.30.2/build-amd64 Start 1: api_test 1/9 Test #1: api_test ......................... Passed 0.01 sec Start 2: html_normalization 2/9 Test #2: html_normalization ............... Passed 0.16 sec Start 3: spectest_library With the new option: ===> Regression tests for cmark-0.30.2p0 UpdateCTestConfiguration from :/usr/ports/pobj/cmark-0.30.2/build-amd64/DartConfiguration.tcl 21:09:28 [17/151] Test project /usr/ports/pobj/cmark-0.30.2/build-amd64 Constructing a list of tests Done constructing a list of tests Updating test list for fixtures Added 0 tests to meet fixture requirements Checking test dependency graph... Checking test dependency graph end test 1 Start 1: api_test 1: Test command: /usr/ports/pobj/cmark-0.30.2/build-amd64/api_test/api_test 1: Working Directory: /usr/ports/pobj/cmark-0.30.2/build-amd64/testdir 1: Test timeout computed to be: 10000000 1: 539 tests passed, 0 failed, 0 skipped 1: PASS 1/9 Test #1: api_test ......................... Passed 0.01 sec test 2 Start 2: html_normalization 2: Test command: /usr/local/bin/python3.9 "-m" "doctest" "/usr/ports/pobj/cmark-0.30.2/cmark-0.30.2/test/normalize.py" 2: Working Directory: /usr/ports/pobj/cmark-0.30.2/build-amd64/testdir 2: Test timeout computed to be: 10000000 2/9 Test #2: html_normalization ............... Passed 0.16 sec This diff has survived a full bulk build. (THANKS tb@) Victims already fixed and I got an OK from tb@ Thoughts, other OKs? Rafael Index: devel/cmake/cmake.port.mk =================================================================== RCS file: /cvs/ports/devel/cmake/cmake.port.mk,v retrieving revision 1.75 diff -u -p -r1.75 cmake.port.mk --- devel/cmake/cmake.port.mk 6 Jun 2022 09:31:51 -0000 1.75 +++ devel/cmake/cmake.port.mk 1 Sep 2022 18:56:54 -0000 @@ -16,26 +16,22 @@ MAKE_ENV += MODCMAKE_USE_SHARED_LIBS=yes USE_NINJA ?= Yes .if ${USE_NINJA:L} == "yes" -BUILD_DEPENDS += devel/ninja>=1.5.1 -NINJA ?= ninja -NINJA_FLAGS ?= -v -j ${MAKE_JOBS} +BUILD_DEPENDS += devel/ninja .elif ${USE_NINJA:L} == "samurai" BUILD_DEPENDS += devel/samurai -NINJA ?= samu -NINJA_FLAGS ?= -v -j ${MAKE_JOBS} -CONFIGURE_ARGS += -DCMAKE_MAKE_PROGRAM=${NINJA} +CONFIGURE_ARGS += -DCMAKE_MAKE_PROGRAM=samu .endif .if ${USE_NINJA:L} == "yes" || ${USE_NINJA:L} == "samurai" _MODCMAKE_GEN = Ninja MODCMAKE_BUILD_TARGET = cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${NINJA} ${NINJA_FLAGS} ${ALL_TARGET} + cmake --build ${WRKBUILD} ${_MAKE_VERBOSE} -j ${MAKE_JOBS} MODCMAKE_INSTALL_TARGET = cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ - ${FAKE_SETUP} ${NINJA} ${NINJA_FLAGS} ${FAKE_TARGET} + ${FAKE_SETUP} cmake --install ${WRKBUILD} MODCMAKE_TEST_TARGET = cd ${WRKBUILD} && exec ${SETENV} ${ALL_TEST_ENV} \ - ${NINJA} ${NINJA_FLAGS} ${TEST_FLAGS} ${TEST_TARGET} + ctest ${_MAKE_VERBOSE} -j ${MAKE_JOBS} .if !target(do-build) do-build: @@ -99,7 +95,6 @@ CONFIGURE_ENV += MODTK_VERSION=${MODTK_V MODTK_LIB=${MODTK_LIB} .endif - .if ! empty(MODCMAKE_LDFLAGS) # https://cmake.org/cmake/help/latest/envvar/LDFLAGS.html # Will only be used by CMake on the first configuration to determine the @@ -120,9 +115,12 @@ MODCMAKE_configure = cd ${WRKBUILD} && $ CC="${CC}" CFLAGS="${CFLAGS}" \ CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ ${CONFIGURE_ENV} ${LOCALBASE}/bin/cmake \ + -B ${WRKBUILD} \ + -S ${WRKSRC} \ + -G ${_MODCMAKE_GEN} \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_SUPPRESS_REGENERATION=ON \ - -G ${_MODCMAKE_GEN} ${CONFIGURE_ARGS} ${WRKSRC} + ${CONFIGURE_ARGS} .if !defined(CONFIGURE_ARGS) || ! ${CONFIGURE_ARGS:M*CMAKE_BUILD_TYPE*} . if ${MODCMAKE_DEBUG:L} == "yes" @@ -137,11 +135,6 @@ SUBST_VARS += MODCMAKE_BUILD_SUFFIX SEPARATE_BUILD ?= Yes -TEST_TARGET ?= test - -MODCMAKE_WANTCOLOR ?= No -MODCMAKE_VERBOSE ?= Yes - # https://cmake.org/cmake/help/latest/command/enable_language.html # 3.23: Swift OBJCXX OBJC ISPC HIP Fortran CXX CUDA C _CMAKE_PROCESSING_LANGUAGE = ASM OBJCXX OBJC Fortran CXX C @@ -163,10 +156,14 @@ CONFIGURE_ARGS := -DCMAKE_ADDR2LINE:FILE CONFIGURE_ENV += MODCMAKE_PORT_BUILD=yes MAKE_ENV += MODCMAKE_PORT_BUILD=yes +MODCMAKE_WANTCOLOR ?= No + .if ${MODCMAKE_WANTCOLOR:L} == "yes" && defined(TERM) MAKE_ENV += TERM=${TERM} .endif +MODCMAKE_VERBOSE ?= Yes + .if ${MODCMAKE_VERBOSE:L} == "yes" -MAKE_ENV += VERBOSE=1 +_MAKE_VERBOSE = --verbose .endif Index: games/openclonk/Makefile =================================================================== RCS file: /cvs/ports/games/openclonk/Makefile,v retrieving revision 1.13 diff -u -p -r1.13 Makefile --- games/openclonk/Makefile 28 May 2022 06:20:00 -0000 1.13 +++ games/openclonk/Makefile 1 Sep 2022 18:56:54 -0000 @@ -49,9 +49,6 @@ CONFIGURE_ARGS += -DFREETYPE_INCLUDE_DIR CXXFLAGS += -I${LOCALBASE}/include -I${X11BASE}/include MODCMAKE_LDFLAGS = -L${LOCALBASE}/lib -# Random, intermittent failures with Ninja during fake. -USE_NINJA = No - NO_TEST = Yes WRKDIST = ${WRKDIR}/openclonk-release-${V}-src Index: math/mlpack/Makefile =================================================================== RCS file: /cvs/ports/math/mlpack/Makefile,v retrieving revision 1.22 diff -u -p -r1.22 Makefile --- math/mlpack/Makefile 31 Mar 2022 17:16:30 -0000 1.22 +++ math/mlpack/Makefile 1 Sep 2022 18:56:54 -0000 @@ -89,9 +89,6 @@ CONFIGURE_ARGS += -DCMAKE_DISABLE_FIND_ -DBUILD_PYTHON_BINDINGS=ON \ -DCMAKE_INSTALL_MANDIR=${PREFIX}/man/man1 -# naddy reported a burp -USE_NINJA = No - # XXX note that some of the tests WILL fail. You've got to love probabilistic # software... TEST_ENV = CTEST_OUTPUT_ON_FAILURE=1 Index: math/plplot/Makefile =================================================================== RCS file: /cvs/ports/math/plplot/Makefile,v retrieving revision 1.71 diff -u -p -r1.71 Makefile --- math/plplot/Makefile 26 Apr 2022 14:48:53 -0000 1.71 +++ math/plplot/Makefile 1 Sep 2022 18:56:54 -0000 @@ -38,9 +38,6 @@ myRUN_DEPENDS = print/ghostscript/gnu-fo MODULES += devel/cmake -# Until the cmake ninja generator supports fortran -USE_NINJA = No - CONFIGURE_ARGS = -D ENABLE_ada=OFF \ -D ENABLE_cxx=ON \ -D ENABLE_d=OFF \