View | Details | Raw Unified | Return to bug 249024 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/Uses/cmake.mk (-2 / +23 lines)
Lines 4-10 Link Here
4
#
4
#
5
# Feature:		cmake
5
# Feature:		cmake
6
# Usage:		USES=cmake or USES=cmake:ARGS
6
# Usage:		USES=cmake or USES=cmake:ARGS
7
# Valid ARGS:		insource, run, noninja
7
# Valid ARGS:		insource, run, noninja, testing
8
# ARGS description:
8
# ARGS description:
9
# insource		do not perform an out-of-source build
9
# insource		do not perform an out-of-source build
10
# noninja		don't use ninja instead of make
10
# noninja		don't use ninja instead of make
Lines 16-21 Link Here
16
#				2) ports that set BUILD_- or INSTALL_WRKSRC to
16
#				2) ports that set BUILD_- or INSTALL_WRKSRC to
17
#				   something different than CONFIGURE_WRKSRC
17
#				   something different than CONFIGURE_WRKSRC
18
# run			add a runtime dependency on cmake
18
# run			add a runtime dependency on cmake
19
# testing		add the test target based on ctest
20
#			Additionally, CMAKE_TESTING_ON, CMAKE_TESTING_OFF, CMAKE_TESTING_ARGS, CMAKE_TESTING_TARGET
21
#			can be defined to override the default values.
19
#
22
#
20
#
23
#
21
# Additional variables that affect cmake behaviour:
24
# Additional variables that affect cmake behaviour:
Lines 46-52 Link Here
46
.if !defined(_INCLUDE_USES_CMAKE_MK)
49
.if !defined(_INCLUDE_USES_CMAKE_MK)
47
_INCLUDE_USES_CMAKE_MK=	yes
50
_INCLUDE_USES_CMAKE_MK=	yes
48
51
49
_valid_ARGS=		insource run noninja
52
_valid_ARGS=		insource run noninja testing
50
53
51
# Sanity check
54
# Sanity check
52
.for arg in ${cmake_ARGS}
55
.for arg in ${cmake_ARGS}
Lines 140-143 Link Here
140
	@cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH}
143
	@cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH}
141
.endif
144
.endif
142
145
146
.if !target(do-test) && ${cmake_ARGS:Mtesting}
147
CMAKE_TESTING_ON?=		BUILD_TESTING
148
CMAKE_TESTING_TARGET?=		test
149
150
# Handle the option-like CMAKE_TESTING_ON and CMAKE_TESTING_OFF lists.
151
.for _bool_kind in ON OFF
152
.  if defined(CMAKE_TESTING_${_bool_kind})
153
CMAKE_TESTING_ARGS+=		${CMAKE_TESTING_${_bool_kind}:C/.*/-D&:BOOL=${_bool_kind}/}
154
.  endif
155
.endfor
156
157
do-test:
158
	@cd ${BUILD_WRKSRC} && \
159
		${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_TESTING_ARGS} ${CMAKE_SOURCE_PATH} && \
160
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \
161
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${CMAKE_TESTING_TARGET}
162
.endif
163
143
.endif #!defined(_INCLUDE_USES_CMAKE_MK)
164
.endif #!defined(_INCLUDE_USES_CMAKE_MK)

Return to bug 249024