Lines 4-12
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: outsource |
7 |
# Valid ARGS: outsource, run, noninja |
8 |
# ARGS description: |
8 |
# ARGS description: |
9 |
# outsource perform an out-of-source build |
9 |
# outsource perform an out-of-source build |
|
|
10 |
# noninja don't use ninja instead of make |
11 |
# Setting this should be an exception, and hints to an issue |
12 |
# inside the ports build system. |
13 |
# A few corner cases never use ninja, and are handled, to reduce |
14 |
# the usage of 'noninja'.: |
15 |
# 1) fortran ports |
16 |
# 2) ports that set BUILD_- or INSTALL_WRKSRC to |
17 |
# something different than CONFIGURE_WRKSRC |
18 |
# run add a runtime dependency on cmake |
10 |
# |
19 |
# |
11 |
# |
20 |
# |
12 |
# Additional variables that affect cmake behaviour: |
21 |
# Additional variables that affect cmake behaviour: |
Lines 14-20
Link Here
|
14 |
# User defined variables: |
23 |
# User defined variables: |
15 |
# CMAKE_NOCOLOR - Disable colour build output |
24 |
# CMAKE_NOCOLOR - Disable colour build output |
16 |
# Default: not set, unless BATCH or PACKAGE_BUILDING is defined |
25 |
# Default: not set, unless BATCH or PACKAGE_BUILDING is defined |
17 |
# CMAKE_NINJA - Use ninja instead of make(1) |
|
|
18 |
# |
26 |
# |
19 |
# Variables for ports: |
27 |
# Variables for ports: |
20 |
# CMAKE_ARGS - Arguments passed to cmake |
28 |
# CMAKE_ARGS - Arguments passed to cmake |
Lines 36-42
Link Here
|
36 |
.if !defined(_INCLUDE_USES_CMAKE_MK) |
44 |
.if !defined(_INCLUDE_USES_CMAKE_MK) |
37 |
_INCLUDE_USES_CMAKE_MK= yes |
45 |
_INCLUDE_USES_CMAKE_MK= yes |
38 |
|
46 |
|
39 |
_valid_ARGS= outsource run |
47 |
_valid_ARGS= outsource run noninja |
40 |
|
48 |
|
41 |
# Sanity check |
49 |
# Sanity check |
42 |
.for arg in ${cmake_ARGS} |
50 |
.for arg in ${cmake_ARGS} |
Lines 91-100
Link Here
|
91 |
CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF |
99 |
CMAKE_ARGS+= -DCMAKE_COLOR_MAKEFILE:BOOL=OFF |
92 |
.endif |
100 |
.endif |
93 |
|
101 |
|
94 |
.if defined(CMAKE_NINJA) |
|
|
95 |
.include "${USESDIR}/ninja.mk" |
96 |
.endif |
97 |
|
98 |
_CMAKE_MSG= "===> Performing in-source build" |
102 |
_CMAKE_MSG= "===> Performing in-source build" |
99 |
CMAKE_SOURCE_PATH?= ${WRKSRC} |
103 |
CMAKE_SOURCE_PATH?= ${WRKSRC} |
100 |
|
104 |
|
Lines 106-111
Link Here
|
106 |
TEST_WRKSRC?= ${CONFIGURE_WRKSRC} |
110 |
TEST_WRKSRC?= ${CONFIGURE_WRKSRC} |
107 |
.endif |
111 |
.endif |
108 |
|
112 |
|
|
|
113 |
# By default we use the ninja generator. |
114 |
# Except, if cmake:run is set (cmake not wanted as generator) |
115 |
# fortran is used, as the ninja-generator does not handle it. |
116 |
# or if CONFIGURE_WRKSRC does not match BUILD_WRKSRC or INSTALL_WRKSRC |
117 |
# as the build.ninja file won't be where ninja expects it. |
118 |
.if empty(cmake_ARGS:Mnoninja) && empty(cmake_ARGS:Mrun) && empty(USES:Mfortran) |
119 |
. if "${CONFIGURE_WRKSRC}" == "${BUILD_WRKSRC}" && "${CONFIGURE_WRKSRC}" == "${INSTALL_WRKSRC}" |
120 |
. if ! empty(USES:Mgmake) |
121 |
BROKEN= USES=gmake is incompatible with cmake's ninja-generator |
122 |
. endif |
123 |
. include "${USESDIR}/ninja.mk" |
124 |
. endif |
125 |
.endif |
126 |
|
109 |
.if !target(do-configure) |
127 |
.if !target(do-configure) |
110 |
do-configure: |
128 |
do-configure: |
111 |
@${ECHO_MSG} ${_CMAKE_MSG} |
129 |
@${ECHO_MSG} ${_CMAKE_MSG} |