Index: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml @@ -4342,7 +4342,7 @@ not selected. For example: OPTIONS_DEFINE= OPT1 -OPT1_CMAKE_ON= -DTEST:BOOL=true +OPT1_CMAKE_ON= -DTEST:BOOL=true -DDEBUG:BOOL=true OPT1_CMAKE_OFF= -DOPTIMIZE:BOOL=true is equivalent to: @@ -4352,10 +4352,56 @@ .include <bsd.port.options.mk> .if ${PORT_OPTIONS:MOPT1} -CMAKE_ARGS+= -DTEST:BOOL=true +CMAKE_ARGS+= -DTEST:BOOL=true -DDEBUG:BOOL=true .else CMAKE_ARGS+= -DOPTIMIZE:BOOL=true .endif + + See for a shorter + helper when the value is boolean. + + + + <varname><replaceable>OPT</replaceable>_CMAKE_BOOL</varname> + and + <varname><replaceable>OPT</replaceable>_CMAKE_BOOL_OFF</varname> + + When option OPT is selected, + for each entry in + OPT_CMAKE_BOOL + then + -Dentry:BOOL=true + is appended to CMAKE_ARGS. When option + OPT is not + selected, + -Dentry:BOOL=false + is appended to CONFIGURE_ARGS. + OPT_CMAKE_BOOL_OFF + is the oposite, + -Dentry:BOOL=false + is appended to CMAKE_ARGS when the option + is selected, and + -Dentry:BOOL=true + when the option is not selected. For + example: + + OPTIONS_DEFINE= OPT1 +OPT1_CMAKE_BOOL= TEST DEBUG +OPT1_CMAKE_BOOL_OFF= OPTIMIZE + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +CMAKE_ARGS+= -DTEST:BOOL=true -DDEBUG:BOOL=true \ + -DOPTIMIZE:BOOL=false +.else +CMAKE_ARGS+= -DTEST:BOOL=false -DDEBUG:BOOL=false \ + -DOPTIMIZE:BOOL=true +.endif