tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

dist.cmake (2232B)


      1 #
      2 # Copyright (c) 2017, Alliance for Open Media. All rights reserved.
      3 #
      4 # This source code is subject to the terms of the BSD 2 Clause License and the
      5 # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was
      6 # not distributed with this source code in the LICENSE file, you can obtain it
      7 # at www.aomedia.org/license/software. If the Alliance for Open Media Patent
      8 # License 1.0 was not distributed with this source code in the PATENTS file, you
      9 # can obtain it at www.aomedia.org/license/patent.
     10 #
     11 cmake_minimum_required(VERSION 3.16)
     12 
     13 # Converts spaces in $in_string to semicolons and writes the output to
     14 # $out_string. In CMake's eyes this converts the input string to a list.
     15 function(listify_string in_string out_string)
     16  string(REPLACE " " ";" ${out_string} ${in_string})
     17  set(${out_string} "${${out_string}}" PARENT_SCOPE)
     18 endfunction()
     19 
     20 set(REQUIRED_ARGS "AOM_ROOT" "AOM_CONFIG_DIR" "AOM_DIST_DIR" "AOM_DIST_INCLUDES"
     21                  "AOM_DIST_LIBS" "ENABLE_DOCS")
     22 
     23 foreach(arg ${REQUIRED_ARGS})
     24  if("${${arg}}" STREQUAL "")
     25    message(FATAL_ERROR "${arg} must not be empty.")
     26  endif()
     27 endforeach()
     28 
     29 if(ENABLE_DOCS)
     30  file(INSTALL "${AOM_CONFIG_DIR}/docs" DESTINATION "${AOM_DIST_DIR}")
     31 endif()
     32 
     33 if(AOM_DIST_EXAMPLES)
     34  listify_string("${AOM_DIST_EXAMPLES}" "AOM_DIST_EXAMPLES")
     35  foreach(example ${AOM_DIST_EXAMPLES})
     36    if(NOT "${example}" MATCHES "aomdec\|aomenc")
     37      file(INSTALL "${example}" DESTINATION "${AOM_DIST_DIR}/bin/examples")
     38    endif()
     39  endforeach()
     40 endif()
     41 
     42 if(AOM_DIST_TOOLS)
     43  listify_string("${AOM_DIST_TOOLS}" "AOM_DIST_TOOLS")
     44  foreach(tool ${AOM_DIST_TOOLS})
     45    file(INSTALL "${tool}" DESTINATION "${AOM_DIST_DIR}/bin/tools")
     46  endforeach()
     47 endif()
     48 
     49 if(AOM_DIST_APPS)
     50  listify_string("${AOM_DIST_APPS}" "AOM_DIST_APPS")
     51  foreach(app ${AOM_DIST_APPS})
     52    file(INSTALL "${app}" DESTINATION "${AOM_DIST_DIR}/bin")
     53  endforeach()
     54 endif()
     55 
     56 listify_string("${AOM_DIST_INCLUDES}" "AOM_DIST_INCLUDES")
     57 foreach(inc ${AOM_DIST_INCLUDES})
     58  file(INSTALL "${inc}" DESTINATION "${AOM_DIST_DIR}/include/aom")
     59 endforeach()
     60 
     61 listify_string("${AOM_DIST_LIBS}" "AOM_DIST_LIBS")
     62 foreach(lib ${AOM_DIST_LIBS})
     63  file(INSTALL "${lib}" DESTINATION "${AOM_DIST_DIR}/lib")
     64 endforeach()