PageRenderTime 45ms CodeModel.GetById 25ms app.highlight 17ms RepoModel.GetById 0ms app.codeStats 1ms

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