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