Commit 2f9770185cc57b012df34d1f474cb49d9b23f5d6

Fixes for building the packages independently.
  
1212
1313##### global variables #####
1414
15set(LIBSTREAMANALYZER_VERSION 0.7.1)
16set(LIBSTREAMANALYZER_SOVERSION 0.7)
1517option(BUILD_UTILS "build luceneindexer, xmlindexer, rdfindexer, ontoprint utilities" ON)
1618option(BUILD_DEEPTOOLS "build deep find and deepgrep tools" ON)
1719option(ENABLE_EXIV2
2121set(CLUCENE_MIN_VERSION "0.9.21")
2222option(ENABLE_CLUCENE "enable CLucene support (recommended)" ON)
2323
24# definition of LIB_DESTINATION which is the path where the lib is installed
25set (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
26set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name" FORCE)
27
2428if(NOT MSVC AND NOT CMAKE_SYSTEM MATCHES "SunOS-5*.")
2529 add_definitions(-fPIC)
2630endif(NOT MSVC AND NOT CMAKE_SYSTEM MATCHES "SunOS-5*.")
3838# check for required packages
3939if(STRIGI_VERSION_STRING)
4040 # libstreams is being compiled now too
41 set(LIBSTREAMS_INCLUDES ../libstreams/include
41 set(LIBSTREAMS_INCLUDEDIR ../libstreams/include
4242 ${CMAKE_CURRENT_BINARY_DIR}/../libstreams/include
43# ${CMAKE_CURRENT_BINARY_DIR}/../libstreams/lib # REMOVE lib !!!
44# ${CMAKE_CURRENT_SOURCE_DIR}/../libstreams/lib # REMOVE lib !!!
4543)
46#ADD_DEFINITIONS(-DHAVE_CONFIG_H) # REMOVE !!!
4744else(STRIGI_VERSION_STRING)
48 find_package(libstreams REQUIRED)
45 find_package(LibStreams REQUIRED)
4946endif(STRIGI_VERSION_STRING)
5047find_package(Threads REQUIRED)
5148find_package(LibXml2 REQUIRED)
5656 ${libstreamanalyzer_BINARY_DIR}/include/strigi/strigi_thread.h)
5757
5858# every directory needs the headers that will be installed
59include_directories(${LIBSTREAMS_INCLUDES})
59include_directories(${LIBSTREAMS_INCLUDEDIR})
6060include_directories(${libstreamanalyzer_SOURCE_DIR}/include)
6161include_directories(${libstreamanalyzer_BINARY_DIR}/include)
62link_directories(${LIBSTREAMS_LIBRARY_DIRS})
6263
6364add_subdirectory(lib)
6465add_subdirectory(plugins)
7373file(GLOB STRIGI_HEADERS include/strigi/*.h)
7474install(FILES
7575 ${STRIGI_HEADERS}
76 ${libstreamanalyzer_BINARY_DIR}/include/strigi/strigi_thread.h
7677 DESTINATION include/strigi
7778)
7879# ontologies
8383 DESTINATION share/strigi/fieldproperties/
8484)
8585# library
86file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
87add_library(streamanalyzer SHARED ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
88set_target_properties(streamanalyzer PROPERTIES
89 VERSION ${STRIGI_VERSION_STRING}
90 SOVERSION ${STRIGI_VERSION_MAJOR}
91 DEFINE_SYMBOL MAKE_STREAMANALYZER_LIB
92)
93target_link_libraries(streamanalyzer streamanalyzerstatic)
94install(TARGETS streamanalyzer
95 LIBRARY DESTINATION ${LIB_DESTINATION}
96 RUNTIME DESTINATION bin
97 ARCHIVE DESTINATION ${LIB_DESTINATION}
98)
9986if(NOT WIN32)
10087 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/libstreamanalyzer.pc
10188 DESTINATION ${LIB_DESTINATION}/pkgconfig)
  
1#
2# This module looks for libstreams
3# It will define the following values
4#
5# LIBSTREAMS_FOUND
6# LIBSTREAMS_INCLUDEDIR
7# LIBSTREAMS_LIBDIR
8# LIBSTREAMS_LIBS
9# LIBSTREAMS_VERSION
10
11if(WIN32)
12
13 file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
14 find_path(LIBSTREAMS_INCLUDEDIR strigi/strigiconfig.h
15 ${_program_FILES_DIR}/libstreams/include
16 ${CMAKE_INSTALL_PREFIX}/include
17 ${CMAKE_INCLUDE_PATH}
18 )
19 set(LIBSTREAMS_LIBDIR ${_program_FILES_DIR}/dbus/lib)
20 find_library(LIBSTREAMS_LIBS NAMES streams
21 PATHS
22 ${LIBSTREAMS_LIBDIR}
23 ${CMAKE_INSTALL_PREFIX}/lib
24 ${CMAKE_LIBRARY_PATH}
25 )
26
27else(WIN32)
28
29 find_package(PkgConfig REQUIRED)
30 pkg_check_modules(LIBSTREAMS libstreams)
31
32endif(WIN32)
33
34if (LibStreams_FIND_REQUIRED)
35 if (NOT LIBSTREAMS_FOUND)
36 message(FATAL_ERROR "Could NOT find libstreams")
37 endif (NOT LIBSTREAMS_FOUND)
38endif (LibStreams_FIND_REQUIRED)
  
55#add_subdirectory(tests)
66#add_subdirectory(fieldproperties)
77#add_subdirectory(xesam)
8add_definitions(-DMAKE_STREAMANALYZER_LIB)
89include_directories(
910 ${LIBXML2_INCLUDE_DIR}
1011 ${libstreamanalyzer_SOURCE_DIR}/lib
7474
7575add_library(streamanalyzerstatic STATIC ${streamanalyzer_SRCS})
7676
77set(streamanalyzer_libs streams ${LIBXML2_LIBRARIES} )
77set(streamanalyzer_libs ${LIBSTREAMS_LIBRARIES} ${LIBXML2_LIBRARIES} )
7878if(HAVE_LIBDL)
7979 set(streamanalyzer_libs ${streamanalyzer_libs} ${LIBDL} )
8080endif(HAVE_LIBDL)
8181target_link_libraries(streamanalyzerstatic ${streamanalyzer_libs}
8282 ${CMAKE_THREAD_LIBS_INIT})
83
84add_library(streamanalyzer SHARED ${streamanalyzer_SRCS})
85set_target_properties(streamanalyzer PROPERTIES
86 VERSION ${LIBSTREAMANALYZER_VERSION}
87 SOVERSION ${LIBSTREAMANALYZER_SOVERSION}
88 DEFINE_SYMBOL MAKE_STREAMANALYZER_LIB
89)
90target_link_libraries(streamanalyzer streamanalyzerstatic)
91install(TARGETS streamanalyzer
92 LIBRARY DESTINATION ${LIB_DESTINATION}
93 RUNTIME DESTINATION bin
94 ARCHIVE DESTINATION ${LIB_DESTINATION}
95)
8396
8497if(NOT WIN32)
8598 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libstreamanalyzer.pc.cmake
  
66Name: libstreamanalyzer
77Description: C++ library for extracting text and metadata from files and streams
88Requires: libstreams
9Version: ${STRIGI_VERSION_MAJOR}.${STRIGI_VERSION_MINOR}.${STRIGI_VERSION_PATCH}
9Version: ${LIBSTREAMANALYZER_VERSION}
1010Libs: -L${LIB_DESTINATION} -lstreamanalyzer
1111Cflags: -I${CMAKE_INSTALL_PREFIX}/include
  
55
66cmake_minimum_required(VERSION 2.6)
77set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
8include(MacroCheckGccVisibility)
89enable_testing()
910
1011
1616set(STRIGI_VERSION_MINOR 7 CACHE INT "Minor Strigi version number" FORCE)
1717set(STRIGI_VERSION_PATCH 1 CACHE INT "Release Strigi version number" FORCE)
1818set(STRIGI_VERSION_STRING "${STRIGI_VERSION_MAJOR}.${STRIGI_VERSION_MINOR}.${STRIGI_VERSION_PATCH}" CACHE STRING "Strigi version string" FORCE)
19set(LIBSTREAMS_VERSION ${STRIGI_VERSION_STRING})
1920
2021# definition of LIB_DESTINATION which is the path where the lib is installed
2122set (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
2828
2929##### environment inspection #####
3030
31# check for visibility support
32macro_check_gcc_visibility(__STRIGI_HAVE_GCC_VISIBILITY)
33
3134# check for required packages
3235find_package(ZLIB REQUIRED)
3336find_package(BZip2 REQUIRED)
6767 DESTINATION ${LIB_DESTINATION}/strigi)
6868
6969# library
70file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
71add_library(streams SHARED ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
72set_target_properties(streams PROPERTIES
73 VERSION ${STRIGI_VERSION_STRING}
74 SOVERSION ${STRIGI_VERSION_MAJOR}
75 DEFINE_SYMBOL MAKE_STREAMS_LIB
76)
77target_link_libraries(streams streamsstatic)
78install(TARGETS streams
79 LIBRARY DESTINATION ${LIB_DESTINATION}
80 RUNTIME DESTINATION bin
81 ARCHIVE DESTINATION ${LIB_DESTINATION}
82)
8370if(NOT WIN32)
8471 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/libstreams.pc
8572 DESTINATION ${LIB_DESTINATION}/pkgconfig)
  
1#
2# Copyright (c) 2006, Alexander Neundorf <neundorf@kde.org>
3# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
4#
5# Redistribution and use is allowed according to the terms of the BSD license.
6# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
7
8macro(MACRO_CHECK_GCC_VISIBILITY GccVisibility)
9 if (CMAKE_COMPILER_IS_GNUCXX)
10 include(CheckCXXCompilerFlag)
11 include(MacroEnsureVersion)
12 # visibility support
13 check_cxx_compiler_flag(-fvisibility=hidden ${GccVisibility})
14
15 # get the gcc version
16 exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
17
18 string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
19 # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here:
20 if (NOT _gcc_version)
21 string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}")
22 endif (NOT _gcc_version)
23
24 macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1)
25 macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2)
26
27 set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE)
28 if (GCC_IS_NEWER_THAN_4_1)
29 exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info)
30 string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}")
31 endif (GCC_IS_NEWER_THAN_4_1)
32
33 if (${GccVisibility} AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
34 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
35 set (KDE4_C_FLAGS "${KDE4_C_FLAGS}" "-fvisibility=hidden")
36
37 if (GCC_IS_NEWER_THAN_4_2)
38 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
39 endif (GCC_IS_NEWER_THAN_4_2)
40 else (${GccVisibility} AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
41 set (${GccVisibility} 0)
42 endif (${GccVisibility} AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
43
44 else (CMAKE_COMPILER_IS_GNUCXX)
45 set(${GccVisibility} FALSE)
46 endif (CMAKE_COMPILER_IS_GNUCXX)
47endmacro(MACRO_CHECK_GCC_VISIBILITY)
  
1# This macro compares version numbers of the form "x.y.z"
2# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
3# will set FOO_VERSIN_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
4# where both have to be in a 3-part-version format, leading and trailing
5# text is ok, e.g.
6# MACRO_ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK)
7# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system
8
9# Copyright (c) 2006, David Faure, <faure@kde.org>
10#
11# Redistribution and use is allowed according to the terms of the BSD license.
12# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
13
14MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old)
15
16 # parse the parts of the version string
17 STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_major_vers "${requested_version}")
18 STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" req_minor_vers "${requested_version}")
19 STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_patch_vers "${requested_version}")
20
21 STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" found_major_vers "${found_version}")
22 STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" found_minor_vers "${found_version}")
23 STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" found_patch_vers "${found_version}")
24
25 # compute an overall version number which can be compared at once
26 MATH(EXPR req_vers_num "${req_major_vers}*10000 + ${req_minor_vers}*100 + ${req_patch_vers}")
27 MATH(EXPR found_vers_num "${found_major_vers}*10000 + ${found_minor_vers}*100 + ${found_patch_vers}")
28
29 if (found_vers_num LESS req_vers_num)
30 set( ${var_too_old} FALSE )
31 else (found_vers_num LESS req_vers_num)
32 set( ${var_too_old} TRUE )
33 endif (found_vers_num LESS req_vers_num)
34
35ENDMACRO(MACRO_ENSURE_VERSION)
36
37
38# This macro compares version numbers of the form "x.y"
39# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
40# will set FOO_VERSIN_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
41# where both have to be in a 2-part-version format, leading and trailing
42# text is ok, e.g.
43# MACRO_ENSURE_VERSION( "0.5" "foo 0.6" VERSION_OK)
44# which means 0.5 is required and "foo 0.6" is what was found on the system
45
46# Copyright (c) 2006, David Faure, <faure@kde.org>
47# Copyright (c) 2007, Pino Toscano, <pino@kde.org>
48#
49# Redistribution and use is allowed according to the terms of the BSD license.
50# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
51
52MACRO(MACRO_ENSURE_VERSION2 requested_version found_version var_too_old)
53
54 # parse the parts of the version string
55 STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" req_major_vers "${requested_version}")
56 STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" req_minor_vers "${requested_version}")
57
58 STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+.*" "\\1" found_major_vers "${found_version}")
59 STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1" found_minor_vers "${found_version}")
60
61 # compute an overall version number which can be compared at once
62 MATH(EXPR req_vers_num "${req_major_vers}*100 + ${req_minor_vers}")
63 MATH(EXPR found_vers_num "${found_major_vers}*100 + ${found_minor_vers}")
64
65 if (found_vers_num LESS req_vers_num)
66 set( ${var_too_old} FALSE )
67 else (found_vers_num LESS req_vers_num)
68 set( ${var_too_old} TRUE )
69 endif (found_vers_num LESS req_vers_num)
70
71ENDMACRO(MACRO_ENSURE_VERSION2)
  
11# This directory builds only the library libstreams
2add_definitions(-DMAKE_STREAMS_LIB)
23
34include_directories(
45 ${ZLIB_INCLUDE_DIR}
5454set(streams_SRCS ${streams_SRCS} compat.cpp)
5555
5656add_library(streamsstatic STATIC ${streams_SRCS})
57set_target_properties(streamsstatic PROPERTIES DEFINE_SYMBOL MAKE_STREAMS_LIB)
58
59add_library(streams SHARED ${streams_SRCS})
60set_target_properties(streams PROPERTIES
61 VERSION ${STRIGI_VERSION_STRING}
62 SOVERSION ${STRIGI_VERSION_MAJOR}
63 DEFINE_SYMBOL MAKE_STREAMS_LIB
64)
65target_link_libraries(streams streamsstatic)
66install(TARGETS streams
67 LIBRARY DESTINATION ${LIB_DESTINATION}
68 RUNTIME DESTINATION bin
69 ARCHIVE DESTINATION ${LIB_DESTINATION}
70)
5771
5872
5973target_link_libraries(streamsstatic ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${ICONV_LIBRARIES})
  
55
66Name: libstreams
77Description: C++ streams for reading data as streams from various file formats
8Version: ${STRIGI_VERSION_MAJOR}.${STRIGI_VERSION_MINOR}.${STRIGI_VERSION_PATCH}
8Version: ${LIBSTREAMS_VERSION}
99Libs: -L${LIB_DESTINATION} -lstreams
1010Cflags: -I${CMAKE_INSTALL_PREFIX}/include
  
1717# check for required packages
1818if(STRIGI_VERSION_STRING)
1919 # if STRIGI_VERSION_STRING is defined, we are compiling the meta-package
20 set(LIBSTREAMS_INCLUDES
20 set(LIBSTREAMS_INCLUDEDIR
2121 ../libstreams/include
2222 ${CMAKE_CURRENT_BINARY_DIR}/../libstreams/include)
23 set(LIBSTREAMANALYZER_INCLUDES
23 set(LIBSTREAMANALYZER_INCLUDEDIR
2424 ../libstreamanalyzer/include
2525 ${CMAKE_CURRENT_BINARY_DIR}/../libstreamanalyzer/include)
2626else(STRIGI_VERSION_STRING)
27 find_package(libstreams REQUIRED)
28 find_package(libstreamanalyzer REQUIRED)
27 find_package(LibStreams REQUIRED)
28 find_package(LibStreamAnalyzer REQUIRED)
2929endif(STRIGI_VERSION_STRING)
30include(ConfigureChecks.cmake)
3031
3132##### building and testing #####
32include_directories(${LIBSTREAMS_INCLUDES})
33include_directories(${LIBSTREAMANALYZER_INCLUDES})
33include_directories(${LIBSTREAMS_INCLUDEDIR})
34include_directories(${LIBSTREAMANALYZER_INCLUDEDIR})
35link_directories(${LIBSTREAMANALYZER_LIBRARY_DIRS})
3436
3537add_subdirectory(bin)
3638
  
1#need to find a few default headers:
2INCLUDE(CheckIncludeFileCXX)
3CHECK_INCLUDE_FILE_CXX(regex.h HAVE_REGEX_H) # src/dummyindexer/*
  
44 # TODO: install copyright file !
55endif(NOT HAVE_REGEX_H)
66
7include_directories(
8 ../streamanalyzer
9 ../streams
10 ${REGEX_INCLUDE_DIR}
11 ${strigi_BINARY_DIR}/src/streams
12)
13
147add_executable(dummyindexer dummyindexer.cpp)
15target_link_libraries(dummyindexer streamanalyzer)
8target_link_libraries(dummyindexer ${LIBSTREAMANALYZER_LIBRARIES})
169
1710add_library(libdeepfind STATIC deepfind.cpp)
18target_link_libraries(libdeepfind streamanalyzer)
11target_link_libraries(libdeepfind ${LIBSTREAMANALYZER_LIBRARIES})
1912
2013add_library(grepindexer STATIC grepindexreader.cpp grepindexmanager.cpp
2114 grepindexwriter.cpp ${REGEX_SOURCES})
2215
2316add_library(libdeepgrep STATIC deepgrep.cpp)
24target_link_libraries(libdeepgrep grepindexer streamanalyzer ${REGEX_LIBRARIES})
17target_link_libraries(libdeepgrep grepindexer ${LIBSTREAMANALYZER_LIBRARIES} ${REGEX_LIBRARIES})
2518
2619add_executable(greptest grepindexreader.cpp)
2720target_link_libraries(greptest streamanalyzer)
2821
2922if(NOT MSVC)
3023 add_executable(analyzerlatencytester analyzerlatencytester.cpp)
31 target_link_libraries(analyzerlatencytester streamanalyzer)
24 target_link_libraries(analyzerlatencytester ${LIBSTREAMANALYZER_LIBRARIES})
3225endif(NOT MSVC)
3326
3427add_library(grepindex STATIC grepindexmanager.cpp)
  
1#
2# This module looks for libstreamanalyzer
3# It will define the following values
4#
5# LIBSTREAMANALYZER_FOUND
6# LIBSTREAMANALYZER_INCLUDEDIR
7# LIBSTREAMANALYZER_LIBDIR
8# LIBSTREAMANALYZER_LIBS
9
10if(WIN32)
11
12 file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
13 find_path(LIBSTREAMANALYZER_INCLUDEDIR strigi/strigiconfig.h
14 ${_program_FILES_DIR}/libstreamanalyzer/include
15 ${CMAKE_INSTALL_PREFIX}/include
16 ${CMAKE_INCLUDE_PATH}
17 )
18 set(LIBSTREAMANALYZER_LIBDIR ${_program_FILES_DIR}/dbus/lib)
19 find_library(LIBSTREAMANALYZER_LIBS NAMES streams
20 PATHS
21 ${LIBSTREAMANALYZER_LIBDIR}
22 ${CMAKE_INSTALL_PREFIX}/lib
23 ${CMAKE_LIBRARY_PATH}
24 )
25
26else(WIN32)
27
28 find_package(PkgConfig REQUIRED)
29 pkg_check_modules(LIBSTREAMANALYZER libstreamanalyzer)
30
31endif(WIN32)
32
33if (LibStreamAnalyzer_FIND_REQUIRED)
34 if (NOT LIBSTREAMANALYZER_FOUND)
35 message(FATAL_ERROR "Could NOT find libstreamanalyzer")
36 endif (NOT LIBSTREAMANALYZER_FOUND)
37endif (LibStreamAnalyzer_FIND_REQUIRED)
  
1#
2# This module looks for libstreams
3# It will define the following values
4#
5# LIBSTREAMS_FOUND
6# LIBSTREAMS_INCLUDEDIR
7# LIBSTREAMS_LIBDIR
8# LIBSTREAMS_LIBS
9# LIBSTREAMS_VERSION
10
11if(WIN32)
12
13 file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
14 find_path(LIBSTREAMS_INCLUDEDIR strigi/strigiconfig.h
15 ${_program_FILES_DIR}/libstreams/include
16 ${CMAKE_INSTALL_PREFIX}/include
17 ${CMAKE_INCLUDE_PATH}
18 )
19 set(LIBSTREAMS_LIBDIR ${_program_FILES_DIR}/dbus/lib)
20 find_library(LIBSTREAMS_LIBS NAMES streams
21 PATHS
22 ${LIBSTREAMS_LIBDIR}
23 ${CMAKE_INSTALL_PREFIX}/lib
24 ${CMAKE_LIBRARY_PATH}
25 )
26
27else(WIN32)
28
29 find_package(PkgConfig REQUIRED)
30 pkg_check_modules(LIBSTREAMS libstreams)
31
32endif(WIN32)
33
34if (LibStreams_FIND_REQUIRED)
35 if (NOT LIBSTREAMS_FOUND)
36 message(FATAL_ERROR "Could NOT find libstreams")
37 endif (NOT LIBSTREAMS_FOUND)
38endif (LibStreams_FIND_REQUIRED)