diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2014-10-09 03:17:02 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-10-09 03:17:48 +0200 |
commit | 03a61295af97983a2313df9717653a466c99ef03 (patch) | |
tree | a322176b1ec239813aa19066af0245eb3452b32d /CMakeLists.txt | |
parent | e1eaf5a90159b023cb4c0c9e5c68acba397c1457 (diff) | |
download | tdelibs-03a61295af97983a2313df9717653a466c99ef03.tar.gz tdelibs-03a61295af97983a2313df9717653a466c99ef03.zip |
Fix FTBFS on missing magic_getpath
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 11d3c4bfe..e02891634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -525,6 +525,26 @@ if( NOT HAVE_LIBDL ) endif( NOT HAVE_LIBDL ) +##### check for magic ########################### + +set( MAGIC_LIBRARIES magic ) +check_library_exists( ${MAGIC_LIBRARIES} magic_load "" HAVE_LIBMAGIC ) +if( HAVE_LIBMAGIC ) + check_library_exists( ${MAGIC_LIBRARIES} magic_getpath "" HAVE_LIBMAGIC_GETPATH ) + if( NOT HAVE_LIBMAGIC_GETPATH ) + execute_process( + COMMAND file --version + OUTPUT_VARIABLE LIBMAGIC_VERSION + ERROR_VARIABLE LIBMAGIC_VERSION + ) + string(REGEX REPLACE ".*magic file from ([^ \n]*).*" "\\1" LIBMAGIC_PATH ${LIBMAGIC_VERSION} ) + message( STATUS "libmagick default path ${LIBMAGIC_PATH}" ) + endif( NOT HAVE_LIBMAGIC_GETPATH ) +else( HAVE_LIBMAGIC ) + tde_message_fatal( "libmagic is required, but not found on your system" ) +endif( HAVE_LIBMAGIC ) + + ##### check for utempter ######################## if( WITH_UTEMPTER ) |