summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-18 04:05:58 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-18 04:05:58 -0500
commit69a43103d9bd250eb59cf6ad7efcafe9ca13f139 (patch)
treed1fa5328d9997a76bf9fc3823c4761e1777286db /CMakeLists.txt
parent7d6aacd4037d9340c773da16ef399bbc100707a9 (diff)
downloadtdelibs-69a43103d9bd250eb59cf6ad7efcafe9ca13f139.tar.gz
tdelibs-69a43103d9bd250eb59cf6ad7efcafe9ca13f139.zip
Attempt to fix cryptsetup version detection yet again
The library authors would have done well to include a version number #define in the header...
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5ff0f76f..f16fce036 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -697,11 +697,22 @@ if( WITH_CRYPTSETUP )
endif( NOT LIBCRYPTSETUP_FOUND )
set( HAVE_CRYPTSETUP 1 )
if ( HAVE_CRYPTSETUP )
+ # save CMAKE_REQUIRED_LIBRARIES
+ set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
+ set( CMAKE_REQUIRED_LIBRARIES ${LIBCRYPTSETUP_LIBRARIES} )
check_c_source_compiles("
#include <stddef.h>
#include <libcryptsetup.h>
- int main(int argc, char *argv[]) { crypt_keyslot_info status = CRYPT_SLOT_INVALID; crypt_get_type(NULL); return 0; } "
+ int main(int argc, char *argv[]) { crypt_keyslot_info status = CRYPT_SLOT_INVALID; return 0; } "
HAVE_NEW_CRYPTSETUP )
+ check_c_source_compiles("
+ #include <stddef.h>
+ #include <libcryptsetup.h>
+ int main(int argc, char *argv[]) { crypt_get_type(NULL); return 0; } "
+ HAVE_CRYPTSETUP_GET_TYPE )
+ # restore CMAKE_REQUIRED_LIBRARIES
+ set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
+ unset( bak_CMAKE_REQUIRED_LIBRARIES )
endif( )
if ( NOT HAVE_NEW_CRYPTSETUP )
set( CRYPTSETUP_OLD_API 1 )