Files
scylladb/cmake/Findlibxcrypt.cmake
Avi Kivity f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00

48 lines
1.0 KiB
CMake

#
# Copyright 2023-present ScyllaDB
#
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
#
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_xcrypt QUIET libxcrypt)
find_library(xcrypt_LIBRARY
NAMES crypt
HINTS
${PC_xcrypt_LIBDIR}
${PC_xcrypt_LIBRARY_DIRS})
find_path(xcrypt_INCLUDE_DIR
NAMES crypt.h
HINTS
${PC_xcrypt_INCLUDEDIR}
${PC_xcrypt_INCLUDE_DIRS})
mark_as_advanced(
xcrypt_LIBRARY
xcrypt_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libxcrypt
REQUIRED_VARS
xcrypt_LIBRARY
xcrypt_INCLUDE_DIR
VERSION_VAR PC_xcrypt_VERSION)
if(libxcrypt_FOUND)
set(xcrypt_LIBRARIES ${xcrypt_LIBRARY})
set(xcrypt_INCLUDE_DIRS ${xcrypt_INCLUDE_DIR})
if(NOT(TARGET libxcrypt::libxcrypt))
add_library(libxcrypt::libxcrypt UNKNOWN IMPORTED)
set_target_properties(libxcrypt::libxcrypt
PROPERTIES
IMPORTED_LOCATION ${xcrypt_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${xcrypt_INCLUDE_DIRS})
endif()
endif()