forked from acoustid/acoustid-index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
151 lines (130 loc) · 4.19 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
cmake_minimum_required(VERSION 2.6)
project(fpserver)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
find_package(GTest)
find_package(Qt4 COMPONENTS QtCore QtNetwork REQUIRED)
include(${QT_USE_FILE})
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME acoustid-index)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Lukas Lalinsky <[email protected]>")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
set(CPACK_STRIP_FILES TRUE)
include(CPack)
add_definitions(
-D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS
)
set(fpindexlib_SOURCES
src/index/index.cpp
src/index/index_file_deleter.cpp
src/index/index_info.cpp
src/index/index_reader.cpp
src/index/index_writer.cpp
src/index/segment_data_reader.cpp
src/index/segment_data_writer.cpp
src/index/segment_index.cpp
src/index/segment_index_reader.cpp
src/index/segment_index_writer.cpp
src/index/segment_info.cpp
src/index/segment_merge_policy.cpp
src/index/segment_merger.cpp
src/index/segment_searcher.cpp
src/index/top_hits_collector.cpp
src/store/buffered_input_stream.cpp
src/store/buffered_output_stream.cpp
src/store/checksum_output_stream.cpp
src/store/checksum_input_stream.cpp
src/store/directory.cpp
src/store/fs_directory.cpp
src/store/fs_input_stream.cpp
src/store/fs_output_stream.cpp
src/store/input_stream.cpp
src/store/memory_input_stream.cpp
src/store/mmap_input_stream.cpp
src/store/output_stream.cpp
src/store/ram_directory.cpp
src/store/ram_output_stream.cpp
src/util/crc.c
src/util/options.cpp
)
add_library(fpindexlib ${fpindexlib_SOURCES})
set(fpserver_HEADERS
src/server/listener.h
src/server/connection.h
src/server/handler.h
)
set(fpserver_SOURCES
src/server/listener.cpp
src/server/connection.cpp
src/server/handler.cpp
src/server/main.cpp
)
qt4_wrap_cpp(fpserver_MOC ${fpserver_HEADERS})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${GTEST_INCLUDE_DIRS}
)
add_executable(fpi-server ${fpserver_SOURCES} ${fpserver_MOC})
target_link_libraries(fpi-server ${QT_LIBRARIES} fpindexlib)
#add_executable(fpindex src/tools/fpindex.cpp)
#target_link_libraries(fpindex ${QT_LIBRARIES} fpindexlib)
#add_executable(fpstats src/tools/fpstats.cpp)
#target_link_libraries(fpstats ${QT_LIBRARIES} fpindexlib)
#add_executable(fpsearch src/tools/fpsearch.cpp)
#target_link_libraries(fpsearch ${QT_LIBRARIES} fpindexlib)
#add_executable(fpdumpindex src/tools/fpdumpindex.cpp)
#target_link_libraries(fpdumpindex ${QT_LIBRARIES} fpindexlib)
add_executable(fpi-add src/tools/fpi-add.cpp)
target_link_libraries(fpi-add ${QT_LIBRARIES} fpindexlib)
add_executable(fpi-import src/tools/fpi-import.cpp)
target_link_libraries(fpi-import ${QT_LIBRARIES} fpindexlib)
add_executable(fpi-search src/tools/fpi-search.cpp)
target_link_libraries(fpi-search ${QT_LIBRARIES} fpindexlib)
#add_executable(fpi-stats src/tools/fpi-stats.cpp)
#target_link_libraries(fpi-stats ${QT_LIBRARIES} fpindexlib)
set(tests_SOURCES
src/index/segment_data_writer_test.cpp
src/index/segment_index_test.cpp
src/index/segment_index_reader_test.cpp
src/index/segment_index_writer_test.cpp
src/index/index_test.cpp
src/index/index_info_test.cpp
src/index/index_reader_test.cpp
src/index/index_writer_test.cpp
src/index/index_file_deleter_test.cpp
src/index/segment_enum_test.cpp
src/index/segment_merger_test.cpp
src/index/segment_merge_policy_test.cpp
src/index/top_hits_collector_test.cpp
src/store/buffered_input_stream_test.cpp
src/store/input_stream_test.cpp
src/store/output_stream_test.cpp
src/store/fs_output_stream_test.cpp
src/store/ram_directory_test.cpp
src/util/search_utils_test.cpp
src/util/options_test.cpp
src/util/exceptions_test.cpp
src/util/tests.cpp
)
install(
TARGETS
fpi-add
fpi-import
fpi-search
fpi-server
RUNTIME DESTINATION bin
)
if(GTEST_FOUND)
include_directories(${GTEST_INCLUDE_DIRS})
add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/gtest_build)
add_executable(tests ${tests_SOURCES})
target_link_libraries(tests
${GTEST_BOTH_LIBRARIES} -lpthread
${QT_LIBRARIES}
fpindexlib)
enable_testing(true)
add_test(IndexTests tests)
add_custom_target(check ${CMAKE_CURRENT_BINARY_DIR}/tests $ENV{GTEST_FLAGS} DEPENDS tests)
endif()