Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jun 2016 22:23:37 +0000 (UTC)
From:      Adam Weinberger <adamw@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r417497 - in head: . Mk
Message-ID:  <201606252223.u5PMNbwU049496@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adamw
Date: Sat Jun 25 22:23:37 2016
New Revision: 417497
URL: https://svnweb.freebsd.org/changeset/ports/417497

Log:
  Add an opt_CMAKE_BOOL options helper.
  
    SOMEOPT_CMAKE_BOOL=	WITH_FOO BAR
  
  expands to:
  
    -DWITH_FOO:BOOL=true -DBAR:BOOL=true
  or
    -DWITH_FOO:BOOL=false -DBAR:BOOL=false
  
  PR:		210576
  Approved by:	portmgr (mat)

Modified:
  head/CHANGES
  head/Mk/bsd.options.mk

Modified: head/CHANGES
==============================================================================
--- head/CHANGES	Sat Jun 25 22:20:55 2016	(r417496)
+++ head/CHANGES	Sat Jun 25 22:23:37 2016	(r417497)
@@ -10,6 +10,18 @@ in the release notes and/or placed into 
 
 All ports committers are allowed to commit to this file.
 
+20160625:
+AUTHOR: adamw@FreeBSD.org
+
+  A new ${opt}_CMAKE_BOOL OPTIONS helper has been added. Instead of:
+
+    FOO_CMAKE_ON=	-DWITH_FOO:BOOL=YES -DWITH_BAR:BOOL=YES
+    FOO_CMAKE_OFF=	-DWITH_FOO:BOOL=NO  -DWITH_BAR:BOOL=NO
+
+  you can use this shortcut:
+
+    SOMEOPT_CMAKE_BOOL=	WITH_FOO WITH_BAR
+
 20160525:
 AUTHOR: mat@FreeBSD.org
 

Modified: head/Mk/bsd.options.mk
==============================================================================
--- head/Mk/bsd.options.mk	Sat Jun 25 22:20:55 2016	(r417496)
+++ head/Mk/bsd.options.mk	Sat Jun 25 22:23:37 2016	(r417497)
@@ -98,6 +98,10 @@
 # ${opt}_CMAKE_OFF		When option is disabled, it will add its content to
 #				the CMAKE_ARGS.
 #
+# ${opt}_CMAKE_BOOL		Will add to CMAKE_ARGS:
+#				Option enabled  -D${content}:BOOL=true
+#				Option disabled -D${content}:BOOL=false
+#
 # ${opt}_QMAKE_ON		When option is enabled, it will add its content to
 #				the QMAKE_ARGS.
 # ${opt}_QMAKE_OFF		When option is disabled, it will add its content to
@@ -515,6 +519,9 @@ CONFIGURE_ARGS+=	${${opt}_CONFIGURE_ENAB
 .    if defined(${opt}_CONFIGURE_WITH)
 CONFIGURE_ARGS+=	${${opt}_CONFIGURE_WITH:S/^/--with-/}
 .    endif
+.    if defined(${opt}_CMAKE_BOOL)
+CMAKE_ARGS+=		${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=true/}
+.    endif
 .    for configure in CONFIGURE CMAKE QMAKE
 .      if defined(${opt}_${configure}_ON)
 ${configure}_ARGS+=	${${opt}_${configure}_ON}
@@ -559,6 +566,9 @@ CONFIGURE_ARGS+=	${${opt}_CONFIGURE_ENAB
 .    if defined(${opt}_CONFIGURE_WITH)
 CONFIGURE_ARGS+=	${${opt}_CONFIGURE_WITH:S/^/--without-/:C/=.*//}
 .    endif
+.    if defined(${opt}_CMAKE_BOOL)
+CMAKE_ARGS+=		${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=false/}
+.    endif
 .    for configure in CONFIGURE CMAKE QMAKE
 .      if defined(${opt}_${configure}_OFF)
 ${configure}_ARGS+=	${${opt}_${configure}_OFF}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606252223.u5PMNbwU049496>