diff options
author | gahr <gahr@FreeBSD.org> | 2010-03-03 15:48:30 +0800 |
---|---|---|
committer | gahr <gahr@FreeBSD.org> | 2010-03-03 15:48:30 +0800 |
commit | 527bfd3bf6dabfcfc1778efd41df2265796a58c0 (patch) | |
tree | ab76b153495f303c287999cb350ade74e34cd596 /Mk | |
parent | 7fab8918ed4a18b008d04231045781234f6f2b3d (diff) | |
download | freebsd-ports-gnome-527bfd3bf6dabfcfc1778efd41df2265796a58c0.tar.gz freebsd-ports-gnome-527bfd3bf6dabfcfc1778efd41df2265796a58c0.tar.zst freebsd-ports-gnome-527bfd3bf6dabfcfc1778efd41df2265796a58c0.zip |
- Add a CMAKE_OUTSOURCE variable that, when set, causes the cmake framework
to use a directory other than ${WRKSRC} for generated files (out-of-source build).
See http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F
Approved by: kde@, portmgr@
Feature safe: yes
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.cmake.mk | 13 |
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 - |