File: RedefaultableOption.cmake

package info (click to toggle)
madness 0.10.1%2Bgit20200818.eee5fd9f-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 34,980 kB
  • sloc: cpp: 280,841; ansic: 12,626; python: 4,961; fortran: 4,245; xml: 1,053; makefile: 714; sh: 276; perl: 244; yacc: 227; lex: 188; asm: 141; csh: 55
file content (12 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
# if local variable is defined, use its value as the default, otherwise use _default
# this is consistent with cmake 3.13 and later (see policy CMP0077)
macro(redefaultable_option _name _descr _default)

  if (${_name})
    set(${_name}_DEFAULT ${${_name}})
  else()
    set(${_name}_DEFAULT ${${_default}})
  endif()
  option(${_name} ${_descr} ${${_name}_DEFAULT})

endmacro()