| 1 |
# === This file is part of Calamares - <https://calamares.io> === |
| 2 |
# |
| 3 |
# SPDX-FileCopyrightText: 2014 Teo Mrnjavac <[email protected]> |
| 4 |
# SPDX-FileCopyrightText: 2017 Adriaan de Groot <[email protected]> |
| 5 |
# SPDX-License-Identifier: BSD-2-Clause |
| 6 |
# |
| 7 |
### |
| 8 |
# |
| 9 |
# - Find libcrypt |
| 10 |
# Find the libcrypt includes and the libcrypt libraries |
| 11 |
# This module defines |
| 12 |
# LIBCRYPT_INCLUDE_DIR, root crypt include dir. Include crypt with crypt.h |
| 13 |
# LIBCRYPT_LIBRARY, the path to libcrypt |
| 14 |
# LIBCRYPT_FOUND, whether libcrypt was found |
| 15 |
|
| 16 |
if( CMAKE_SYSTEM MATCHES "FreeBSD" ) |
| 17 |
# FreeBSD has crypt(3) declared in unistd.h, which lives in |
| 18 |
# libc; the libcrypt found here is not used. |
| 19 |
find_path( CRYPT_INCLUDE_DIR NAMES unistd.h ) |
| 20 |
add_definitions( -DNO_CRYPT_H ) |
| 21 |
else() |
| 22 |
find_path( CRYPT_INCLUDE_DIR |
| 23 |
NAMES crypt.h |
| 24 |
HINTS |
| 25 |
${CMAKE_INSTALL_INCLUDEDIR} |
| 26 |
NO_CACHE |
| 27 |
) |
| 28 |
endif() |
| 29 |
|
| 30 |
find_library( CRYPT_LIBRARIES |
| 31 |
NAMES crypt |
| 32 |
HINTS |
| 33 |
${CMAKE_INSTALL_LIBDIR} |
| 34 |
) |
| 35 |
|
| 36 |
include( FindPackageHandleStandardArgs ) |
| 37 |
find_package_handle_standard_args( |
| 38 |
Crypt |
| 39 |
REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR |
| 40 |
) |
| 41 |
|
| 42 |
mark_as_advanced( CRYPT_INCLUDE_DIR CRYPT_LIBRARIES ) |