summaryrefslogtreecommitdiff
path: root/mk/configure
diff options
context:
space:
mode:
authorchuck <chuck@pkgsrc.org>2018-04-08 19:11:27 +0000
committerchuck <chuck@pkgsrc.org>2018-04-08 19:11:27 +0000
commit5ccd8b045f05fb2e1dbe9a8ec354dea1c17f55b6 (patch)
treebbc7ec859f0cf901437df6bdf7d661104852ce77 /mk/configure
parent57f2b402b2d8dcb1da2c8c1ba00e2fe567e4def7 (diff)
downloadpkgsrc-5ccd8b045f05fb2e1dbe9a8ec354dea1c17f55b6.tar.gz
add support for CMAKE_PKGSRC_BUILD_FLAGS
CMAKE_PKGSRC_BUILD_FLAGS If set to yes, disable compiler optimization flags associated with the CMAKE_BUILD_TYPE setting (for pkgsrc these come in from the user via variables like CFLAGS). The default is yes, but you can set it to no for pkgsrc packages that do not use a compiler to avoid cmake "Manually-specified variables were not used by the project" warnings associated with this variable.
Diffstat (limited to 'mk/configure')
-rw-r--r--mk/configure/cmake.mk13
1 files changed, 12 insertions, 1 deletions
diff --git a/mk/configure/cmake.mk b/mk/configure/cmake.mk
index 1929003f57a..452cf5b86f6 100644
--- a/mk/configure/cmake.mk
+++ b/mk/configure/cmake.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cmake.mk,v 1.15 2017/12/27 18:56:27 wiz Exp $
+# $NetBSD: cmake.mk,v 1.16 2018/04/08 19:11:27 chuck Exp $
#
# This file handles packages that use CMake as their primary build
# system. For more information about CMake, see http://www.cmake.org/.
@@ -15,6 +15,14 @@
# variable is adjusted to include the path from the pkgsrc wrappers.
# The file ${WRKSRC}/CMakeLists.txt is always appended to this list.
#
+# CMAKE_PKGSRC_BUILD_FLAGS
+# If set to yes, disable compiler optimization flags associated
+# with the CMAKE_BUILD_TYPE setting (for pkgsrc these come in from
+# the user via variables like CFLAGS). The default is yes, but you can
+# set it to no for pkgsrc packages that do not use a compiler to avoid
+# cmake "Manually-specified variables were not used by the project"
+# warnings associated with this variable.
+#
# CMAKE_PREFIX_PATH
# A list of directories to add the CMAKE_PREFIX_PATH cmake variable.
# If a package installs its contents in ${PREFIX}/package instead of
@@ -39,6 +47,9 @@ CMAKE_INSTALL_PREFIX?= ${PREFIX}
CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS+= -DCMAKE_MODULE_PATH:PATH=${_CMAKE_DIR}
+.if empty(CMAKE_PKGSRC_BUILD_FLAGS:M[nN][oO])
+CMAKE_ARGS+= -DCMAKE_PKGSRC_BUILD_FLAGS:BOOL=TRUE
+.endif
.if ${OPSYS} != "Darwin"
CMAKE_ARGS+= -DCMAKE_SKIP_RPATH:BOOL=TRUE
.else