git: 2ce9c15f88b8 - main - graphics/openexr: Only build test suite when requested

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Fri, 03 May 2024 18:57:37 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2ce9c15f88b83c14cab7ccb2114c70f7cff7aa77

commit 2ce9c15f88b83c14cab7ccb2114c70f7cff7aa77
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-04-21 09:02:00 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2024-05-03 18:57:13 +0000

    graphics/openexr: Only build test suite when requested
    
    In order to avoid ctest performance regressions, we also required
    commit cbee39bcd1a2472b8f3e24754f5bb3a3429b79a0 from PR 278533.
    
    PR:             278500
---
 graphics/openexr/Makefile | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/graphics/openexr/Makefile b/graphics/openexr/Makefile
index 94de55a0624e..9508428b37f9 100644
--- a/graphics/openexr/Makefile
+++ b/graphics/openexr/Makefile
@@ -40,13 +40,23 @@ BUILD_DEPENDS?=	help2man:misc/help2man
 LIB_DEPENDS?=	libImath-3_1.so.29:math/Imath \
 		libdeflate.so:archivers/libdeflate
 
-USES?=		cmake compiler:c++14-lang cpe pathfix pkgconfig
+USES?=		cmake:testing compiler:c++14-lang cpe pathfix pkgconfig
 
 #USE_GITHUB=	yes
 #GH_TUPLE=	AcademySoftwareFoundation:openexr:v${PORTVERSION}
 
 USE_LDCONFIG=	yes
 
+CMAKE_TESTING_ON=	BUILD_TESTING \
+			OPENEXR_TEST_LIBRARIES \
+			OPENEXR_TEST_PYTHON \
+			OPENEXR_TEST_TOOLS
+
+CMAKE_OFF=	BUILD_TESTING \
+		OPENEXR_TEST_LIBRARIES \
+		OPENEXR_TEST_PYTHON \
+		OPENEXR_TEST_TOOLS
+
 CMAKE_ARGS?=	-DCMAKE_DEBUG_POSTFIX=
 
 CPPFLAGS+=	-I.
@@ -104,8 +114,5 @@ post-install-EXAMPLES-off:
 	${RM} -R ${STAGEDIR}${PREFIX}/share/doc/OpenEXR/examples/
 	@${RMDIR} ${STAGEDIR}${PREFIX}/share/doc/OpenEXR 2>/dev/null || :
 
-do-test:
-	cd ${BUILD_WRKSRC} && ctest -j ${MAKE_JOBS_NUMBER}
-
 .endif
 .include <bsd.port.mk>