dep-libtomcrypt/contrib/libtomcrypt.cmake
Richard Levitte 894f33b81c Add contrib/libtomcrypt.cmake, and write about it in doc/crypt.tex
contrib/libtomcrypt.cmake is a snippet that can be used by any CMake
based project that wants to link with libtomcrypt, no matter if it
was installed with libtomcrypt-config.cmake or libtomcrypt.pc.

Fixes #681
2025-02-18 21:27:38 +01:00

14 lines
584 B
CMake

# To find libtomcrypt no matter what the installation look like, start with
# looking for the CMake specific configuration, and failing that, try the
# pkg-config package instead. The resulting target is different in each
# case, but is recorded in the variable ${LIBTOMCRYPT}, so please use that
# for all targets that depend on libtomcrypt.
find_package(libtomcrypt QUIET)
if (libtomcrypt_FOUND)
set(LIBTOMCRYPT libtomcrypt)
else()
find_package(PkgConfig)
pkg_check_modules(libtomcrypt REQUIRED IMPORTED_TARGET libtomcrypt)
set(LIBTOMCRYPT PkgConfig::libtomcrypt)
endif()