File: DependencyOptions.cmake

package info (click to toggle)
kodi 2%3A20.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 143,820 kB
  • sloc: cpp: 664,925; xml: 68,398; ansic: 37,223; python: 6,903; sh: 4,209; javascript: 2,325; makefile: 1,754; perl: 969; java: 513; cs: 390; objc: 340
file content (23 lines) | stat: -rw-r--r-- 940 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Set Option varname based on USE_INTERNAL_LIBS status
#
# Alternative to cmake_dependent_option
# cmake_dependent_option is restrictive, in the fact that we cannot override the 
# set option value as a cache variable (-Dvar=foo)
#
# This allows us to have the same outcome as cmake_dependent_option whilst still allowing
# user to override for platforms that would normally be forced ON
#
function(dependent_option varname optionmessage)

  # If varname already set, accept that, as it was provided by the user
  if(NOT DEFINED ${varname})
    # Generally we only define USE_INTERNAL_LIBS as the exception for platforms
    # we explicitly dont want to build internal libs (eg Linux/Freebsd)
    if(NOT DEFINED USE_INTERNAL_LIBS)
      option(${varname} ${optionmessage} ON)
    else()
      # Respect Value of USE_INTERNAL_LIBS for ON/OFF
      option(${varname} ${optionmessage} ${USE_INTERNAL_LIBS})
    endif()
  endif()
endfunction()