summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-09 11:09:25 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-09 11:09:25 -0500
commit232853179360c3d0fc3fb2dc830f02488e2b83e7 (patch)
tree64d7fb08601165ce491643f778ce4fd62aaa8c28 /CMakeLists.txt
parent216794724ca89104ad394ea9e55f5fdba1523707 (diff)
parent03a61295af97983a2313df9717653a466c99ef03 (diff)
downloadtdelibs-232853179360c3d0fc3fb2dc830f02488e2b83e7.tar.gz
tdelibs-232853179360c3d0fc3fb2dc830f02488e2b83e7.zip
Merge branch 'master' of https://scm.trinitydesktop.org/scm/git/tdelibs
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 )