File: FindCrypt.cmake

package info (click to toggle)
calamares 3.3.14-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,448 kB
  • sloc: cpp: 71,554; python: 4,328; xml: 1,379; sh: 866; ansic: 105; makefile: 7
file content (42 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (5)
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
# === This file is part of Calamares - <https://calamares.io> ===
#
#   SPDX-FileCopyrightText: 2014 Teo Mrnjavac <teo@kde.org>
#   SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
#   SPDX-License-Identifier: BSD-2-Clause
#
###
#
# - Find libcrypt
# Find the libcrypt includes and the libcrypt libraries
# This module defines
# LIBCRYPT_INCLUDE_DIR, root crypt include dir. Include crypt with crypt.h
# LIBCRYPT_LIBRARY, the path to libcrypt
# LIBCRYPT_FOUND, whether libcrypt was found

if( CMAKE_SYSTEM MATCHES "FreeBSD" )
    # FreeBSD has crypt(3) declared in unistd.h, which lives in
    # libc; the libcrypt found here is not used.
    find_path( CRYPT_INCLUDE_DIR NAMES unistd.h )
    add_definitions( -DNO_CRYPT_H )
else()
    find_path( CRYPT_INCLUDE_DIR
        NAMES crypt.h
        HINTS
            ${CMAKE_INSTALL_INCLUDEDIR}
        NO_CACHE
    )
endif()

find_library( CRYPT_LIBRARIES
    NAMES crypt
    HINTS
        ${CMAKE_INSTALL_LIBDIR}
)

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args(
    Crypt
    REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR
)

mark_as_advanced( CRYPT_INCLUDE_DIR CRYPT_LIBRARIES )