Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/cmake.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
# Provide support for CMake based projects | # Provide support for CMake based projects | ||||
# | # | ||||
# Feature: cmake | # Feature: cmake | ||||
# Usage: USES=cmake or USES=cmake:ARGS | # Usage: USES=cmake or USES=cmake:ARGS | ||||
# Valid ARGS: outsource, run, noninja | # Valid ARGS: insource, run, noninja | ||||
# ARGS description: | # ARGS description: | ||||
# outsource perform an out-of-source build | # insource do not perform an out-of-source build | ||||
# noninja don't use ninja instead of make | # noninja don't use ninja instead of make | ||||
# Setting this should be an exception, and hints to an issue | # Setting this should be an exception, and hints to an issue | ||||
# inside the ports build system. | # inside the ports build system. | ||||
# A few corner cases never use ninja, and are handled, to reduce | # A few corner cases never use ninja, and are handled, to reduce | ||||
# the usage of 'noninja'.: | # the usage of 'noninja'.: | ||||
# 1) fortran ports | # 1) fortran ports | ||||
# 2) ports that set BUILD_- or INSTALL_WRKSRC to | # 2) ports that set BUILD_- or INSTALL_WRKSRC to | ||||
# something different than CONFIGURE_WRKSRC | # something different than CONFIGURE_WRKSRC | ||||
Show All 23 Lines | |||||
# CMAKE_SOURCE_PATH - Path to the source directory | # CMAKE_SOURCE_PATH - Path to the source directory | ||||
# Default: ${WRKSRC} | # Default: ${WRKSRC} | ||||
# | # | ||||
# MAINTAINER: kde@FreeBSD.org | # MAINTAINER: kde@FreeBSD.org | ||||
.if !defined(_INCLUDE_USES_CMAKE_MK) | .if !defined(_INCLUDE_USES_CMAKE_MK) | ||||
_INCLUDE_USES_CMAKE_MK= yes | _INCLUDE_USES_CMAKE_MK= yes | ||||
_valid_ARGS= outsource run noninja | _valid_ARGS= insource run noninja | ||||
# Sanity check | # Sanity check | ||||
.for arg in ${cmake_ARGS} | .for arg in ${cmake_ARGS} | ||||
. if empty(_valid_ARGS:M${arg}) | . if empty(_valid_ARGS:M${arg}) | ||||
IGNORE= Incorrect 'USES+= cmake:${cmake_ARGS}' usage: argument [${arg}] is not recognized | IGNORE= Incorrect 'USES+= cmake:${cmake_ARGS}' usage: argument [${arg}] is not recognized | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
.if defined(CMAKE_NOCOLOR) | .if defined(CMAKE_NOCOLOR) | ||||
CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF | CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF | ||||
.endif | .endif | ||||
_CMAKE_MSG= "===> Performing in-source build" | _CMAKE_MSG= "===> Performing in-source build" | ||||
CMAKE_SOURCE_PATH?= ${WRKSRC} | CMAKE_SOURCE_PATH?= ${WRKSRC} | ||||
.if ${cmake_ARGS:Moutsource} | .if empty(cmake_ARGS:Minsource) | ||||
_CMAKE_MSG= "===> Performing out-of-source build" | _CMAKE_MSG= "===> Performing out-of-source build" | ||||
CONFIGURE_WRKSRC= ${WRKDIR}/.build | CONFIGURE_WRKSRC= ${WRKDIR}/.build | ||||
BUILD_WRKSRC?= ${CONFIGURE_WRKSRC} | BUILD_WRKSRC?= ${CONFIGURE_WRKSRC} | ||||
INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC} | INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC} | ||||
TEST_WRKSRC?= ${CONFIGURE_WRKSRC} | TEST_WRKSRC?= ${CONFIGURE_WRKSRC} | ||||
.endif | .endif | ||||
# By default we use the ninja generator. | # By default we use the ninja generator. | ||||
Show All 21 Lines |