Debian Codegraph @

cmake/Modules/FindArgp.cmake

raw
1 # - Try to find ARGP
2 #
3 # The argp can be either shipped as part of libc (ex. glibc) or as a separate
4 # library that requires additional linking (ex. Windows, Mac, musl libc, ...)
5 #
6 # Once done this will define
7 #
8 # ARGP_ROOT_DIR - Set this variable to the root installation of ARGP
9 #
10 # Read-Only variables:
11 # ARGP_FOUND - system has ARGP
12 # ARGP_INCLUDE_DIR - the ARGP include directory
13 # ARGP_LIBRARIES - Link these to use ARGP
14 # ARGP_DEFINITIONS - Compiler switches required for using ARGP
15 #
16 #=============================================================================
17 # Copyright (c) 2011-2016 Andreas Schneider <[email protected]>
18 #
19 # Distributed under the OSI-approved BSD License (the "License");
20 # see accompanying file Copyright.txt for details.
21 #
22 # This software is distributed WITHOUT ANY WARRANTY; without even the
23 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 # See the License for more information.
25 #=============================================================================
26 #
27
28 set(_ARGP_ROOT_HINTS
29 )
30
31 set(_ARGP_ROOT_PATHS
32 "$ENV{PROGRAMFILES}/argp"
33 )
34
35 find_path(ARGP_ROOT_DIR
36 NAMES
37 include/argp.h
38 HINTS
39 ${_ARGP_ROOT_HINTS}
40 PATHS
41 ${_ARGP_ROOT_PATHS}
42 )
43 mark_as_advanced(ARGP_ROOT_DIR)
44
45 find_path(ARGP_INCLUDE_DIR
46 NAMES
47 argp.h
48 PATHS
49 ${ARGP_ROOT_DIR}/include
50 )
51
52 find_library(ARGP_LIBRARY
53 NAMES
54 argp
55 PATHS
56 ${ARGP_ROOT_DIR}/lib
57 )
58
59 if (ARGP_LIBRARY)
60 set(ARGP_LIBRARIES
61 ${ARGP_LIBRARIES}
62 ${ARGP_LIBRARY}
63 )
64 endif (ARGP_LIBRARY)
65
66 include(FindPackageHandleStandardArgs)
67 find_package_handle_standard_args(Argp DEFAULT_MSG ARGP_LIBRARIES ARGP_INCLUDE_DIR)
68
69 # show the ARGP_INCLUDE_DIR and ARGP_LIBRARIES variables only in the advanced view
70 mark_as_advanced(ARGP_INCLUDE_DIR ARGP_LIBRARIES)