diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-03-17 11:42:35 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2023-03-17 11:42:35 +0100 |
commit | c2271960d1563554f0fbbe56b51e68184c5295f4 (patch) | |
tree | 3f8e9fbf831dce54b967701f191aaf1ae2884dd4 | |
parent | 89f3dfb35e1d4a543d804a7132bbbdd8b6425431 (diff) | |
download | tdelibs-c2271960d1563554f0fbbe56b51e68184c5295f4.tar.gz tdelibs-c2271960d1563554f0fbbe56b51e68184c5295f4.zip |
Use pkg-config to detect libpcsclite.
Test the presence of libpcsclite, libpkcs11-helper-1, opensc-pkcs11
and libcryptsetup only if the tdehw library is built.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 38ce5f045..5230577e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,26 +756,29 @@ endif( WITH_LZMA ) ##### check for pcsc ############################ -if( WITH_PCSC ) - find_path( PCSCLITE_INCLUDE_DIR pcsclite.h - HINTS /usr/include/PCSC ) - find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC ) - if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) - message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" ) - set( PCSCLITE_FOUND 1 ) - set( PCSCLITE_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIR} ) - set( PCSCLITE_LIBRARIES ${PCSCLITE_LIBRARY} ) - endif( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) +if( WITH_TDEHWLIB AND WITH_PCSC ) + pkg_search_module( PCSCLITE libpcsclite ) + if( NOT PCSCLITE_FOUND ) + find_path( PCSCLITE_INCLUDE_DIR pcsclite.h + HINTS /usr/include/PCSC ) + find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC ) + if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) + message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" ) + set( PCSCLITE_FOUND 1 ) + set( PCSCLITE_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIR} ) + set( PCSCLITE_LIBRARIES ${PCSCLITE_LIBRARY} ) + endif( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) + endif( NOT PCSCLITE_FOUND ) if( NOT PCSCLITE_FOUND ) tde_message_fatal( "PCSCLITE is requested, but not found on your system" ) endif( NOT PCSCLITE_FOUND ) set( HAVE_PCSC_SUPPORT 1 ) -endif( WITH_PCSC ) +endif( WITH_TDEHWLIB AND WITH_PCSC ) ##### check for pkcs ############################ -if( WITH_PKCS ) +if( WITH_TDEHWLIB AND WITH_PKCS ) pkg_search_module( LIBPKCS11-HELPER libpkcs11-helper-1 ) if( NOT LIBPKCS11-HELPER_FOUND ) message(FATAL_ERROR "\nPKCS support was requested, but libpkcs11-helper-1 was not found on your system" ) @@ -797,7 +800,7 @@ endif( ) ##### check for pkcs ############################ -if( WITH_CRYPTSETUP ) +if( WITH_TDEHWLIB AND WITH_CRYPTSETUP ) pkg_search_module( LIBCRYPTSETUP libcryptsetup ) if( NOT LIBCRYPTSETUP_FOUND ) find_library( LIBCRYPTSETUP_LIBRARY cryptsetup ) |