PageRenderTime 55ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/strigi-0.7.7/libstreamanalyzer/CMakeLists.txt

#
CMake | 147 lines | 100 code | 26 blank | 21 comment | 8 complexity | d209cbe3e9039f36c0f555b3b3a45f34 MD5 | raw file
Possible License(s): LGPL-2.0
  1. project (libstreamanalyzer)
  2. ##### cmake settings #####
  3. cmake_minimum_required(VERSION 2.6)
  4. cmake_policy(VERSION 2.6.0)
  5. if(POLICY CMP0017)
  6. cmake_policy(SET CMP0017 NEW)
  7. endif()
  8. set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
  9. include(MacroCheckGccVisibility)
  10. include(MacroFindOptionalDep)
  11. enable_testing()
  12. ##### global variables #####
  13. # due to a bug in libxml2, we only get thread support if _REENTRANT is defined
  14. add_definitions(-D_REENTRANT)
  15. set(LIBSTREAMANALYZER_VERSION_MAJOR 0)
  16. set(LIBSTREAMANALYZER_VERSION_MINOR 7)
  17. set(LIBSTREAMANALYZER_VERSION_PATCH 7)
  18. set(LIBSTREAMANALYZER_VERSION ${LIBSTREAMANALYZER_VERSION_MAJOR}.${LIBSTREAMANALYZER_VERSION_MINOR}.${LIBSTREAMANALYZER_VERSION_PATCH})
  19. set(LIBSTREAMANALYZER_SOVERSION ${LIBSTREAMANALYZER_VERSION_MAJOR})
  20. option(BUILD_UTILS "build luceneindexer, xmlindexer, rdfindexer, ontoprint utilities" ON)
  21. option(BUILD_DEEPTOOLS "build deep find and deepgrep tools" ON)
  22. option(ENABLE_XINE
  23. "enable Xine support. This adds support for a larger number of media formats(highly unstable)." OFF)
  24. option(ENABLE_FFMPEG
  25. "enable FFMPEG support. This adds support for a larger number of media formats(testing)." ON)
  26. option(ENABLE_EXIV2
  27. "enable exiv2 support. This allows you to index EXIF/IPTC metadata." ON)
  28. set(CLUCENE_MIN_VERSION "0.9.21")
  29. option(ENABLE_CLUCENE "enable CLucene support (recommended)" ON)
  30. option(ENABLE_CLUCENE_NG "enable clucene-ng (version 1+) support (testing)" ON)
  31. # definition of LIB_DESTINATION which is the path where the lib is installed
  32. set (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
  33. set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name" FORCE)
  34. # Set up RPATH handling, so the libs are found if they are installed to a non-standard location.
  35. # By default cmake builds the targets with full RPATH to everything in the build directory,
  36. # but then removes the RPATH when installing.
  37. # These two options below make it set the RPATH of the installed targets to all
  38. # RPATH directories outside the current CMAKE_BINARY_DIR and also the library
  39. # install directory. Alex
  40. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  41. set(CMAKE_INSTALL_RPATH ${LIB_DESTINATION} )
  42. if(NOT WIN32 AND NOT CMAKE_SYSTEM MATCHES "SunOS-5*.")
  43. add_definitions(-fPIC)
  44. endif(NOT WIN32 AND NOT CMAKE_SYSTEM MATCHES "SunOS-5*.")
  45. ##### environment inspection #####
  46. # check for visibility support
  47. macro_check_gcc_visibility(__STRIGI_HAVE_GCC_VISIBILITY)
  48. # check for required packages
  49. if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
  50. find_package(LibStreams REQUIRED)
  51. else()
  52. set(LIBSTREAMS_INCLUDE_DIRS
  53. ${libstreams_SOURCE_DIR}/include
  54. ${libstreams_BINARY_DIR}/include
  55. )
  56. set(LIBSTREAMS_LIBRARIES streams)
  57. endif()
  58. find_package(Threads REQUIRED)
  59. if (NOT CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_USE_WIN32_THREADS_INIT)
  60. message(FATAL_ERROR "Strigi needs either pthreads or win32 threads, none was found.")
  61. endif (NOT CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_USE_WIN32_THREADS_INIT)
  62. find_package(LibXml2 REQUIRED)
  63. find_package(Iconv REQUIRED)
  64. find_package(Boost REQUIRED)
  65. find_optional_dep(CLucene ENABLE_CLUCENE CLucene_FOUND "CLucene backend")
  66. find_optional_dep(CLucene1 ENABLE_CLUCENE_NG CLUCENE1_FOUND "CLucene Version 1+ backend")
  67. find_optional_dep(Exiv2 ENABLE_EXIV2 EXIV2_FOUND "indexing of EXIF/IPTC metadata")
  68. find_optional_dep(FFmpeg ENABLE_FFMPEG FFMPEG_FOUND "indexing FFMPEG" COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
  69. find_package(XAttr)
  70. include(ConfigureChecks.cmake)
  71. configure_file(LibStreamAnalyzer.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LibStreamAnalyzerConfig.cmake @ONLY )
  72. ##### building and testing #####
  73. configure_file(${libstreamanalyzer_SOURCE_DIR}/strigi_thread.h.cmake
  74. ${libstreamanalyzer_BINARY_DIR}/include/strigi/strigi_thread.h)
  75. # every directory needs the headers that will be installed
  76. include_directories(${LIBSTREAMS_INCLUDE_DIRS}
  77. ${libstreamanalyzer_SOURCE_DIR}/include
  78. ${libstreamanalyzer_SOURCE_DIR}/include/strigi
  79. ${libstreamanalyzer_BINARY_DIR}/include
  80. ${libstreamanalyzer_BINARY_DIR}/include/strigi
  81. ${libstreamanalyzer_SOURCE_DIR}/lib
  82. ${libstreamanalyzer_BINARY_DIR}/lib
  83. ${ICONV_INCLUDE_DIR}
  84. ${LIBSTREAMS_LIBRARY_DIRS}
  85. ${EXIV2_INCLUDEDIR}
  86. ${XINE_INCLUDE_DIR}
  87. ${FFMPEG_INCLUDE_DIRS}
  88. ${MAGIC_INCLUDE_DIR}
  89. ${LIBXML2_INCLUDE_DIR}
  90. ${Boost_INCLUDE_DIR}
  91. )
  92. if(XATTR_FOUND)
  93. include_directories(${XATTR_INCLUDE_DIR})
  94. endif(XATTR_FOUND)
  95. add_subdirectory(lib)
  96. add_subdirectory(plugins)
  97. #add_subdirectory(tests)
  98. ##### installing #####
  99. # all installed files are listed here
  100. # headers
  101. file(GLOB STRIGI_HEADERS include/strigi/*.h)
  102. install(FILES
  103. ${STRIGI_HEADERS}
  104. ${libstreamanalyzer_BINARY_DIR}/include/strigi/strigi_thread.h
  105. DESTINATION include/strigi
  106. )
  107. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LibStreamAnalyzerConfig.cmake
  108. DESTINATION ${LIB_DESTINATION}/libstreamanalyzer)
  109. # ontologies
  110. file (GLOB STRIGI_ONTOLOGIES share/strigi/fieldproperties/*.rdfs)
  111. install(FILES
  112. ${STRIGI_ONTOLOGIES}
  113. DESTINATION share/strigi/fieldproperties/
  114. )
  115. # library
  116. if(NOT WIN32)
  117. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/libstreamanalyzer.pc.cmake
  118. ${CMAKE_CURRENT_BINARY_DIR}/lib/libstreamanalyzer.pc)
  119. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/libstreamanalyzer.pc
  120. DESTINATION ${LIB_DESTINATION}/pkgconfig)
  121. endif(NOT WIN32)