File: T4K_Sugar.cmake

package info (click to toggle)
tuxmath 2.0.3-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,488 kB
  • sloc: ansic: 18,791; sh: 4,416; makefile: 778; xml: 51; sed: 16
file content (21 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Some syntactic sugar to make scripts more readable
#
# Brendan Luchen, 2010

# Set a variable only if it has not already been set
# Example: gentle_set(CMAKE_BUILD_TYPE DEBUG)
macro(t4k_gentle_set var val)
  if (NOT DEFINED var)
    set(var val)
  endif (NOT DEFINED var)
endmacro(t4k_gentle_set)

# Propagate a CMake variable to the C preprocessor
# Example: include_definition(HAVE_ICONV)
function(t4k_include_definition name)
  if (${name})
    add_definitions(-D${name}=1)
  else (${name})
    add_definitions(-D${name}=0)
  endif(${name})
endfunction(t4k_include_definition)