summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
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 )