calamares/CMakeModules/FindCrypt.cmake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
CMake
Raw Permalink Normal View History

# === 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
#
###
#
2014-07-31 19:02:50 +02:00
# - 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
2017-09-13 22:24:30 +02:00
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()
2014-07-31 19:02:50 +02:00
2017-09-13 22:24:30 +02:00
find_library( CRYPT_LIBRARIES
NAMES crypt
2014-07-31 19:02:50 +02:00
HINTS
${CMAKE_INSTALL_LIBDIR}
)
include( FindPackageHandleStandardArgs )
2017-09-13 22:24:30 +02:00
find_package_handle_standard_args(
Crypt
REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR
)
2014-07-31 19:02:50 +02:00
mark_as_advanced( CRYPT_INCLUDE_DIR CRYPT_LIBRARIES )