aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorPietro Cerutti <gahr@FreeBSD.org>2010-03-03 07:48:30 +0000
committerPietro Cerutti <gahr@FreeBSD.org>2010-03-03 07:48:30 +0000
commitad1a55146519ada4daf51311e4a2f50d053f08c1 (patch)
treee4f99e51d492cb343a77e4e87ff860cbd440e3ff /Mk
parent0f6f59329702163884cef5c06cc3dfb5374292ea (diff)
downloadports-ad1a55146519ada4daf51311e4a2f50d053f08c1.tar.gz
ports-ad1a55146519ada4daf51311e4a2f50d053f08c1.zip
Notes
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.cmake.mk13
1 files changed, 10 insertions, 3 deletions
diff --git a/Mk/bsd.cmake.mk b/Mk/bsd.cmake.mk
index e68fe83a5750..3c9b561b34fc 100644
--- a/Mk/bsd.cmake.mk
+++ b/Mk/bsd.cmake.mk
@@ -15,8 +15,10 @@
# Default: none (which respects CFLAGS)
# CMAKE_VERBOSE - Verbose build
# Default: not set
+# CMAKE_OUTSOURCE - Instruct to perform an out-of-source build
+# Default: not set
# CMAKE_SOURCE_PATH - Path to sourcedir for cmake
-# Default: .
+# Default: ${WRKSRC}
# CMAKE_INSTALL_PREFIX - prefix for cmake to use for installation.
# Default: ${PREFIX}
#
@@ -54,7 +56,12 @@ CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \
#
# Default build type and sourcedir
#
-CMAKE_SOURCE_PATH?= .
+CMAKE_SOURCE_PATH?= ${WRKSRC}
+.if defined(CMAKE_OUTSOURCE)
+CONFIGURE_WRKSRC= ${WRKDIR}/.build
+BUILD_WRKSRC= ${CONFIGURE_WRKSRC}
+INSTALL_WRKSRC= ${CONFIGURE_WRKSRC}
+.endif
CMAKE_INSTALL_PREFIX?= ${PREFIX}
CMAKE_BUILD_TYPE?= #none
@@ -89,6 +96,6 @@ CMAKE_ARGS+= -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
#
.if !target(do-configure)
do-configure:
+ ${MKDIR} ${CONFIGURE_WRKSRC}
@cd ${CONFIGURE_WRKSRC}; ${SETENV} ${CMAKE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} ${CMAKE_SOURCE_PATH}
.endif
-