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>
pull/196/head
Slávek Banko 2 years ago
parent 89f3dfb35e
commit c2271960d1
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -756,26 +756,29 @@ endif( WITH_LZMA )
##### check for pcsc ############################ ##### check for pcsc ############################
if( WITH_PCSC ) if( WITH_TDEHWLIB AND WITH_PCSC )
find_path( PCSCLITE_INCLUDE_DIR pcsclite.h pkg_search_module( PCSCLITE libpcsclite )
HINTS /usr/include/PCSC ) if( NOT PCSCLITE_FOUND )
find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC ) find_path( PCSCLITE_INCLUDE_DIR pcsclite.h
if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) HINTS /usr/include/PCSC )
message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" ) find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC )
set( PCSCLITE_FOUND 1 ) if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR )
set( PCSCLITE_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIR} ) message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" )
set( PCSCLITE_LIBRARIES ${PCSCLITE_LIBRARY} ) set( PCSCLITE_FOUND 1 )
endif( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) 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 ) if( NOT PCSCLITE_FOUND )
tde_message_fatal( "PCSCLITE is requested, but not found on your system" ) tde_message_fatal( "PCSCLITE is requested, but not found on your system" )
endif( NOT PCSCLITE_FOUND ) endif( NOT PCSCLITE_FOUND )
set( HAVE_PCSC_SUPPORT 1 ) set( HAVE_PCSC_SUPPORT 1 )
endif( WITH_PCSC ) endif( WITH_TDEHWLIB AND WITH_PCSC )
##### check for pkcs ############################ ##### check for pkcs ############################
if( WITH_PKCS ) if( WITH_TDEHWLIB AND WITH_PKCS )
pkg_search_module( LIBPKCS11-HELPER libpkcs11-helper-1 ) pkg_search_module( LIBPKCS11-HELPER libpkcs11-helper-1 )
if( NOT LIBPKCS11-HELPER_FOUND ) if( NOT LIBPKCS11-HELPER_FOUND )
message(FATAL_ERROR "\nPKCS support was requested, but libpkcs11-helper-1 was not found on your system" ) 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 ############################ ##### check for pkcs ############################
if( WITH_CRYPTSETUP ) if( WITH_TDEHWLIB AND WITH_CRYPTSETUP )
pkg_search_module( LIBCRYPTSETUP libcryptsetup ) pkg_search_module( LIBCRYPTSETUP libcryptsetup )
if( NOT LIBCRYPTSETUP_FOUND ) if( NOT LIBCRYPTSETUP_FOUND )
find_library( LIBCRYPTSETUP_LIBRARY cryptsetup ) find_library( LIBCRYPTSETUP_LIBRARY cryptsetup )

Loading…
Cancel
Save