File: command_line_arg.cmake

package info (click to toggle)
cppad 2025.00.00.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,552 kB
  • sloc: cpp: 112,594; sh: 5,972; ansic: 179; python: 71; sed: 12; makefile: 10
file content (39 lines) | stat: -rw-r--r-- 1,549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
# SPDX-FileContributor: 2003-22 Bradley M. Bell
# ----------------------------------------------------------------------------
# command_line_arg(variable default type description)
#
# variable: (out)
# is the variable we are setting to its default value.
# The varaiable can be changed on the cmake command line (or in the camke gui).
# The final value of the variable is printed with the cmake output.
#
# default: (in)
# is the default value for this variable; i.e.,
# if it is not set by the cmake command line or gui.
#
# type: (in)
# must be one of the following:
#  STRING, if the variable holds an arbitrary string.
#  PATH, if the variable holds a directory.
#  BOOL, if the variable only has the values true or false.
#
# description: (in)
# Is a description of how the variable affects the CppAD install procedure.
#
MACRO(command_line_arg variable default type description)
   IF( NOT ( ${type} STREQUAL "STRING" ) )
   IF( NOT ( ${type} STREQUAL "PATH" ) )
   IF( NOT ( ${type} STREQUAL "BOOL" ) )
      MESSAGE(FATAL_ERROR, "command_line_arg: bug in CppAD cmake commands")
   ENDIF( NOT ( ${type} STREQUAL "BOOL" ) )
   ENDIF( NOT ( ${type} STREQUAL "PATH" ) )
   ENDIF( NOT ( ${type} STREQUAL "STRING" ) )
   #
   IF( NOT ${variable} )
      SET(${variable} "${default}" CACHE ${type} "${description}")
   ENDIF( NOT ${variable} )
   MESSAGE(STATUS "${variable} = ${${variable}}")
   #
ENDMACRO( command_line_arg )