PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/strigi-0.7.7/CMakeLists.txt

#
CMake | 72 lines | 58 code | 9 blank | 5 comment | 10 complexity | f9336c84eb355109f3d50cccf2958120 MD5 | raw file
Possible License(s): LGPL-2.0
  1. project (strigi)
  2. # This is the aggregate build file. It serves only to call the build in the
  3. # subdirectories. Each of the projects in the subdirectories is buildable
  4. # separately.
  5. cmake_minimum_required(VERSION 2.6)
  6. # for testing to work in cmake, this command must be called in the root src dir
  7. enable_testing()
  8. option(STRIGI_SYNC_SUBMODULES "Try to update the Strigi submodules automatically. Note that the update may fail if you have pending changes in one of the submodules." FALSE)
  9. if(STRIGI_SYNC_SUBMODULES)
  10. if (NOT GIT_EXECUTABLE)
  11. # Make it possible to override GIT_EXECUTABLE
  12. find_program(GIT_EXECUTABLE NAMES git)
  13. endif()
  14. if(NOT GIT_EXECUTABLE)
  15. message(FATAL_ERROR "Could not find git. Aborting.")
  16. endif()
  17. endif()
  18. macro(check_subdir _subDirectory)
  19. message(STATUS "Checking: ${strigi_SOURCE_DIR}/${_subDirectory}/CMakeLists.txt")
  20. if(NOT EXISTS "${strigi_SOURCE_DIR}/${_subDirectory}/CMakeLists.txt")
  21. message(STATUS "No CMakeLists.txt found in ${_subDirectory}")
  22. if(STRIGI_SYNC_SUBMODULES)
  23. message(STATUS "Trying to download the ${_subDirectory} submodule")
  24. execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init -- ${_subDirectory}
  25. WORKING_DIRECTORY ${strigi_SOURCE_DIR})
  26. else()
  27. set(showError 1)
  28. endif()
  29. else()
  30. if(STRIGI_SYNC_SUBMODULES)
  31. message(STATUS "Trying to update the ${_subDirectory} submodule")
  32. execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --rebase -- ${_subDirectory}
  33. WORKING_DIRECTORY ${strigi_SOURCE_DIR})
  34. endif()
  35. endif()
  36. endmacro()
  37. check_subdir(libstreams)
  38. check_subdir(libstreamanalyzer)
  39. check_subdir(strigiutils)
  40. check_subdir(strigidaemon)
  41. check_subdir(strigiclient)
  42. if(MSVC)
  43. add_definitions(-wd4251)
  44. add_definitions(-wd4355)
  45. add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
  46. add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
  47. add_definitions(-D_USE_MATH_DEFINES)
  48. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zc:wchar_t-")
  49. endif(MSVC)
  50. if(showError)
  51. message(FATAL_ERROR "No CMakeLists.txt was found in one of your sources subdirectory\n"
  52. "Make sure you downloaded the sub-modules files using:\n"
  53. " git submodule update --init"
  54. )
  55. else()
  56. add_subdirectory(libstreams) # Must be first
  57. add_subdirectory(libstreamanalyzer) # Must be second
  58. add_subdirectory(strigiutils)
  59. if(NOT WIN32)
  60. add_subdirectory(strigidaemon)
  61. endif()
  62. add_subdirectory(strigiclient) # Must be AFTER strigidaemon
  63. endif()