mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
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
14 lines
584 B
CMake
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()
|