Legends-of-Azeroth-Pandaria-5.4.8

Форк
0
113 строк · 3.3 Кб
1
# Copyright (C) 2011-2016 Project SkyFire <http://www.projectskyfire.org/
2
# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3
#
4
# This file is free software; as a special exception the author gives
5
# unlimited permission to copy and/or distribute it, with or without
6
# modifications, as long as this notice is preserved.
7
#
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11

12
# find Readline (terminal input library) includes and library
13
#
14
# READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found
15
# READLINE_LIBRARY     - full path to the READLINE library
16
# READLINE_FOUND       - TRUE if READLINE was found
17

18
#[=======================================================================[.rst:
19
FindReadline
20
-----------
21

22
Find The GNU Readline Library.
23

24
Imported Targets
25
^^^^^^^^^^^^^^^^
26

27
This module defines the following :prop_tgt:`IMPORTED` targets:
28

29
``Readline::Readline``
30
  The Readline library, if found.
31

32
Result Variables
33
^^^^^^^^^^^^^^^^
34

35
This module will set the following variables in your project:
36

37
``READLINE_FOUND``
38
  System has The GNU Readline Library.
39
``READLINE_INCLUDE_DIR``
40
  The Readline include directory.
41
``READLINE_LIBRARY``
42
  The Readline library.
43

44
Hints
45
^^^^^
46

47
Set ``READLINE_ROOT_DIR`` to the root directory of Readline installation.
48
#]=======================================================================]
49

50
set(_READLINE_ROOT_HINTS
51
  ${READLINE_ROOT_DIR}
52
  ENV READLINE_ROOT_DIR
53
)
54

55
if(HOMEBREW_PREFIX)
56
  list(APPEND _READLINE_ROOT_HINTS "${HOMEBREW_PREFIX}/opt/readline")
57
endif()
58

59
find_path(READLINE_INCLUDE_DIR
60
  NAMES
61
    readline/readline.h
62
  HINTS
63
    ${_READLINE_ROOT_HINTS}
64
  PATH_SUFFIXES
65
    include)
66

67
find_library(READLINE_LIBRARY
68
  NAMES
69
    readline
70
  HINTS
71
    ${_READLINE_ROOT_HINTS}
72
  PATH_SUFFIXES
73
    lib)
74

75
if(READLINE_INCLUDE_DIR AND EXISTS "${READLINE_INCLUDE_DIR}/readline/readline.h")
76
  file(STRINGS "${READLINE_INCLUDE_DIR}/readline/readline.h" readline_major
77
    REGEX "^#[\t ]*define[\t ]+RL_VERSION_MAJOR[\t ]+([0-9])+.*")
78
  file(STRINGS "${READLINE_INCLUDE_DIR}/readline/readline.h" readline_minor
79
    REGEX "^#[\t ]*define[\t ]+RL_VERSION_MINOR[\t ]+([0-9])+.*")
80
  if (readline_major AND readline_minor)
81
    string(REGEX REPLACE "^.*RL_VERSION_MAJOR[\t ]+([0-9])+.*$"
82
           "\\1" readline_major "${readline_major}")
83
    string(REGEX REPLACE "^.*RL_VERSION_MINOR[\t ]+([0-9])+.*$"
84
           "\\1" readline_minor "${readline_minor}")
85
    set(READLINE_VERSION "${readline_major}.${readline_minor}")
86
  endif()
87
endif()
88

89
include(FindPackageHandleStandardArgs)
90
find_package_handle_standard_args(Readline
91
  REQUIRED_VARS
92
    READLINE_LIBRARY
93
    READLINE_INCLUDE_DIR
94
  VERSION_VAR
95
    READLINE_VERSION
96
)
97

98
mark_as_advanced(READLINE_FOUND READLINE_LIBRARY READLINE_INCLUDE_DIR)
99

100
if(READLINE_FOUND)
101
  message(STATUS "Found Readline library: ${READLINE_LIBRARY}")
102
  message(STATUS "Found Readline headers: ${READLINE_INCLUDE_DIR}")
103

104
  if (NOT TARGET Readline::Readline)
105
    add_library(Readline::Readline UNKNOWN IMPORTED)
106
    set_target_properties(Readline::Readline
107
      PROPERTIES
108
        IMPORTED_LOCATION
109
          "${READLINE_LIBRARY}"
110
        INTERFACE_INCLUDE_DIRECTORIES
111
          "${READLINE_INCLUDE_DIR}")
112
  endif()
113
endif()
114

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

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

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

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