llvm-project

Форк
0
/
GNUInstallPackageDir.cmake 
33 строки · 1.5 Кб
1
# Mimick `GNUInstallDirs` for one more install directory, the one where
2
# project's installed cmake subdirs go.
3

4
# These functions are internal functions vendored in from GNUInstallDirs (with
5
# new names), so we don't depend on unstable implementation details. They are
6
# also simplified to only handle the cases we need.
7
#
8
# The purpose would appear to be making `CACHE PATH` vars in a way that
9
# bypasses the legacy oddity that `-D<PATH>` gets canonicalized, despite
10
# non-canonical `CACHE PATH`s being perfectly valid.
11

12
macro(_GNUInstallPackageDir_cache_convert_to_path var description)
13
  get_property(_GNUInstallPackageDir_cache_type CACHE ${var} PROPERTY TYPE)
14
  if(_GNUInstallPackageDir_cache_type STREQUAL "UNINITIALIZED")
15
    file(TO_CMAKE_PATH "${${var}}" _GNUInstallPackageDir_cmakepath)
16
    set_property(CACHE ${var} PROPERTY TYPE PATH)
17
    set_property(CACHE ${var} PROPERTY VALUE "${_GNUInstallPackageDir_cmakepath}")
18
    set_property(CACHE ${var} PROPERTY HELPSTRING "${description}")
19
    unset(_GNUInstallPackageDir_cmakepath)
20
  endif()
21
  unset(_GNUInstallPackageDir_cache_type)
22
endmacro()
23

24
# Create a cache variable with default for a path.
25
macro(_GNUInstallPackageDir_cache_path var default description)
26
  if(NOT DEFINED ${var})
27
    set(${var} "${default}" CACHE PATH "${description}")
28
  endif()
29
  _GNUInstallPackageDir_cache_convert_to_path("${var}" "${description}")
30
endmacro()
31

32
_GNUInstallPackageDir_cache_path(CMAKE_INSTALL_PACKAGEDIR "lib${LLVM_LIBDIR_SUFFIX}/cmake"
33
  "Directories containing installed CMake modules (lib/cmake)")
34

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.