2014-11-13 01:04:59 +02:00
# - Try to find Strigi, a fast and small desktop search program (http://strigi.sourceforge.net )
# Once done this will define
#
# STRIGI_FOUND - system has Strigi
# STRIGI_INCLUDE_DIRS - the Strigi include directories
# STRIGI_STREAMANALYZER_LIBRARY - Link these to use Strigi streamanalyzer
# STRIGI_STREAMS_LIBRARY - Link these to use Strigi streams
# STRIGI_LINE_ANALYZER_PREFIX - strigi plugin prefix
# STRIGI_THROUGH_ANALYZER_PREFIX - strigi plugin prefix
#
# The following variable is set for source compatibility purpose.
# STRIGI_INCLUDE_DIR - the Strigi include directory
#
# Copyright (c) 2008, Jos van den Oever, <jos@vandenoever.info>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Compat
if ( DEFINED STRIGI_MIN_VERSION )
set ( Strigi_FIND_VERSION ${ STRIGI_MIN_VERSION } )
endif ( )
if ( NOT Strigi_FIND_VERSION )
set ( Strigi_FIND_VERSION "0.5.9" )
endif ( )
file ( TO_CMAKE_PATH "$ENV{STRIGI_HOME}" strigi_home )
set ( _Strigi_FIND_QUIETLY ${ Strigi_FIND_QUIETLY } )
# Try to find and load the StrigiConfig.cmake installed by libstreams
find_package ( Strigi QUIET NO_MODULE PATHS "${strigi_home}/lib/strigi" "${strigi_home}/lib64/strigi" )
set ( Strigi_FIND_QUIETLY ${ _Strigi_FIND_QUIETLY } )
# If StrigiConfig.cmake (installed by libstreams) has been found
# and it contains all necessary information (since November 16th, 2008), use the information
# included there, otherwise search it in the same way as any non-cmake project.
# This variable is set by StrigiConfig.cmake. Alex
if ( STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION )
if ( NOT STRIGI_VERSION VERSION_LESS ${ Strigi_FIND_VERSION } )
set ( STRIGI_VERSION_OK TRUE )
set ( _strigiErrorMessage "Couldn't find Strigi streams and streamanalyzer libraries. Set the environment variable STRIGI_HOME (or CMAKE_PREFIX_PATH) to the strigi install dir." )
else ( )
set ( _strigiErrorMessage "Strigi version ${STRIGI_VERSION} found, but at least version ${Strigi_FIND_VERSION} is required" )
endif ( )
include ( FindPackageHandleStandardArgs )
# Redefine STRIGI_INCLUDE_DIR if _DIRS exists
# TODO KDE5 Remove STRIGI_INCLUDE_DIR
if ( DEFINED STRIGI_INCLUDE_DIRS )
set ( STRIGI_INCLUDE_DIR ${ STRIGI_INCLUDE_DIRS } )
endif ( )
find_package_handle_standard_args ( Strigi "${_strigiErrorMessage}"
S T R I G I _ S T R E A M S _ L I B R A R Y S T R I G I _ S T R E A M A N A L Y Z E R _ L I B R A R Y S T R I G I _ I N C L U D E _ D I R S T R I G I _ V E R S I O N _ O K )
else ( STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION )
# this else() branch is for finding strigi versions before November 16th, 2008. Alex
include ( MacroPushRequiredVars )
if ( WIN32 )
file ( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR )
endif ( WIN32 )
if ( NOT WIN32 )
if ( NOT strigi_home )
find_package ( PkgConfig )
if ( PKG_CONFIG_EXECUTABLE )
pkg_check_modules ( STRIGI QUIET libstreamanalyzer>= ${ Strigi_FIND_VERSION } )
endif ( PKG_CONFIG_EXECUTABLE )
endif ( NOT strigi_home )
endif ( NOT WIN32 )
if ( NOT STRIGI_INCLUDEDIR )
find_path ( STRIGI_INCLUDE_DIR strigi/streamanalyzer.h
P A T H S
$ { s t r i g i _ h o m e } / i n c l u d e
$ { S T R I G I _ I N C L U D E D I R }
$ { _ p r o g r a m _ F I L E S _ D I R } / s t r i g i / i n c l u d e
)
set ( STRIGI_INCLUDEDIR ${ STRIGI_INCLUDE_DIR } )
else ( NOT STRIGI_INCLUDEDIR )
set ( STRIGI_INCLUDE_DIR ${ STRIGI_INCLUDEDIR } )
endif ( NOT STRIGI_INCLUDEDIR )
2015-09-01 01:05:33 +03:00
find_library ( STRIGI_STREAMANALYZER_LIBRARY
2014-11-13 01:04:59 +02:00
N A M E S s t r e a m a n a l y z e r
P A T H S
$ { s t r i g i _ h o m e } / l i b
$ { S T R I G I _ L I B R A R Y _ D I R S }
$ { _ p r o g r a m _ F I L E S _ D I R } / s t r i g i / l i b
)
2015-09-01 01:05:33 +03:00
find_library ( STRIGI_STREAMS_LIBRARY
2014-11-13 01:04:59 +02:00
N A M E S s t r e a m s
P A T H S
$ { s t r i g i _ h o m e } / l i b
$ { S T R I G I _ L I B R A R Y _ D I R S }
$ { _ p r o g r a m _ F I L E S _ D I R } / s t r i g i / l i b
)
2015-09-01 01:05:33 +03:00
find_library ( STRIGI_STRIGIQTDBUSCLIENT_LIBRARY
2014-11-13 01:04:59 +02:00
N A M E S s t r i g i q t d b u s c l i e n t
P A T H S
$ { s t r i g i _ h o m e } / l i b
$ { S T R I G I _ L I B R A R Y _ D I R S }
$ { _ p r o g r a m _ F I L E S _ D I R } / s t r i g i / l i b
)
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args ( Strigi
" C o u l d n ' t f i n d S t r i g i s t r e a m s a n d s t r e a m a n a l y z e r l i b r a r i e s . S e t t h e e n v i r o n m e n t v a r i a b l e STRIGI_HOME ( or CMAKE_PREFIX_PATH if using CMake >=2.6 ) t o t h e s t r i g i i n s t a l l d i r . "
S T R I G I _ S T R E A M S _ L I B R A R Y S T R I G I _ S T R E A M A N A L Y Z E R _ L I B R A R Y S T R I G I _ I N C L U D E _ D I R )
if ( STRIGI_FOUND )
set ( STRIGI_NEEDS_SIGNED_CHAR TRUE CACHE BOOL "TRUE if strigi is 0.6.0 or later" )
set ( STRIGI_NEEDS_CHAR FALSE CACHE BOOL "TRUE if strigi is 0.5.9 or before" )
endif ( STRIGI_FOUND )
endif ( STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION )
if ( WIN32 )
# this is needed to have mingw, cygwin and msvc libs installed in one directory
if ( MSVC )
set ( STRIGI_LINE_ANALYZER_PREFIX msvc_strigila_ )
set ( STRIGI_THROUGH_ANALYZER_PREFIX msvc_strigita_ )
elseif ( CYGWIN )
set ( STRIGI_LINE_ANALYZER_PREFIX cyg_strigila_ )
set ( STRIGI_THROUGH_ANALYZER_PREFIX cyg_strigita_ )
elseif ( MINGW )
set ( STRIGI_LINE_ANALYZER_PREFIX mingw_strigila_ )
set ( STRIGI_THROUGH_ANALYZER_PREFIX mingw_strigita_ )
endif ( MSVC )
else ( WIN32 )
set ( STRIGI_LINE_ANALYZER_PREFIX strigila_ )
set ( STRIGI_THROUGH_ANALYZER_PREFIX strigita_ )
endif ( WIN32 )
mark_as_advanced (
S T R I G I _ I N C L U D E _ D I R
S T R I G I _ S T R E A M A N A L Y Z E R _ L I B R A R Y
S T R I G I _ S T R E A M A N A L Y Z E R _ L I B R A R Y _ D E B U G
S T R I G I _ S T R E A M A N A L Y Z E R _ L I B R A R Y _ R E L E A S E
S T R I G I _ S T R E A M S _ L I B R A R Y
S T R I G I _ S T R E A M S _ L I B R A R Y _ D E B U G
S T R I G I _ S T R E A M S _ L I B R A R Y _ R E L E A S E
S T R I G I _ S T R I G I Q T D B U S C L I E N T _ L I B R A R Y
S T R I G I _ S T R I G I Q T D B U S C L I E N T _ L I B R A R Y _ D E B U G
S T R I G I _ S T R I G I Q T D B U S C L I E N T _ L I B R A R Y _ R E L E A S E
S T R I G I _ L I N E _ A N A L Y Z E R _ P R E F I X
S T R I G I _ T H R O U G H _ A N A L Y Z E R _ P R E F I X
S T R I G I _ N E E D S _ S I G N E D _ C H A R
S T R I G I _ N E E D S _ C H A R
)