File: Findargp.cmake

package info (click to toggle)
dwarves 1.31-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,916 kB
  • sloc: ansic: 154,000; python: 926; sh: 725; makefile: 193
file content (41 lines) | stat: -rw-r--r-- 1,086 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
# - Find argp
# Figure out if argp is in glibc or if it argp-standalone
#
#  ARGP_LIBRARY     - Library to use argp
#  ARGP_FOUND       - True if found.

message(STATUS "Checking availability of argp library")

INCLUDE(CheckLibraryExists)

if (ARGP_LIBRARY)
	# Already in cache, be silent
	set(ARGP_FIND_QUIETLY TRUE)
endif (ARGP_LIBRARY)

find_library(ARGP_LIBRARY
	NAMES argp
	PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 ~/usr/local/lib ~/usr/local/lib64
)

if (ARGP_LIBRARY)
	set(ARGP_FOUND TRUE)
	set(ARGP_LIBRARY ${ARGP_LIBRARY})
	set(CMAKE_REQUIRED_LIBRARIES ${ARGP_LIBRARY})
else (ARGP_LIBRARY)
	set(ARGP_LIBRARY "")
endif (ARGP_LIBRARY)

if (ARGP_FOUND)
	if (NOT ARGP_FIND_QUIETLY)
		message(STATUS "Found argp library: ${ARGP_LIBRARY}")
	endif (NOT ARGP_FIND_QUIETLY)
else (ARGP_FOUND)
	set(ARGP_FOUND TRUE)
	message(STATUS "Assuming argp is in libc")
endif (ARGP_FOUND)

mark_as_advanced(ARGP_LIBRARY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)

message(STATUS "Checking availability of argp library - done")