File: FindReadline.cmake

package info (click to toggle)
libzypp 17.38.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,744 kB
  • sloc: cpp: 132,661; xml: 2,587; sh: 518; python: 266; makefile: 27
file content (42 lines) | stat: -rw-r--r-- 1,244 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# - Find readline library
# This module looks for the GNU gettext tools. This module defines the
# following values:
#

if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
        # Already in cache, be silent
        set(READLINE_FIND_QUIETLY TRUE)
endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)

set(READLINE_LIBRARY)
set(READLINE_INCLUDE_DIR)

FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
  /usr/include
  /usr/include/readline
  /usr/local/include
  /usr/include/readline
)

# make find_library look only for shared lib
# otherwise it would find the static libreadline.a
SET(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
FIND_LIBRARY(READLINE_LIBRARY readline
  PATHS
  /usr/lib
  /usr/lib64
  /usr/local/lib
  /usr/local/lib64
)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP})

if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
   MESSAGE( STATUS "readline found: includes in ${READLINE_INCLUDE_DIR}, library in ${READLINE_LIBRARY}")
   set(READLINE_FOUND TRUE)
else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
   MESSAGE( STATUS "readline not found")
endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)

MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)