-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
96 lines (83 loc) · 2.7 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
cmake_minimum_required(VERSION 3.2)
project(qadc)
include(LibsPath.cmake)
# GCC Flags
set(GCC_FLAGS "-g -O3 -m64 -march=native -ffast-math -fopenmp -Wall -Wno-ignored-attributes -Werror")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(GCC_FLAGS "-fdiagnostics-color=auto ${GCC_FLAGS}")
endif()
link_directories("${LIBS_DIR}")
include_directories("${LIBS_INCLUDE_DIR}")
# C++ Flags
set(CXX_STD "-std=c++14")
set(CMAKE_CXX_FLAGS "${CXX_STD} ${GCC_FLAGS}")
# Object files
add_library(vector_io OBJECT vector_io.cpp)
add_library(quantizers OBJECT quantizers.cpp)
add_library(databases OBJECT databases.cpp)
add_library(distances OBJECT distances.cpp)
add_library(neighbors OBJECT neighbors.cpp)
add_executable(flatdb_create
flatdb_create.cpp
$<TARGET_OBJECTS:databases>
$<TARGET_OBJECTS:quantizers>
$<TARGET_OBJECTS:vector_io>
$<TARGET_OBJECTS:distances>
$<TARGET_OBJECTS:neighbors>)
target_link_libraries(flatdb_create
${LIBS_DIR}/lib${SEQUENTIAL_BLAS_LIB}.so
${OPENCV_CORE_LIB})
add_executable(indexdb_create1
indexdb_create1.cpp
$<TARGET_OBJECTS:databases>
$<TARGET_OBJECTS:quantizers>
$<TARGET_OBJECTS:vector_io>
$<TARGET_OBJECTS:distances>
$<TARGET_OBJECTS:neighbors>)
target_link_libraries(indexdb_create1
${LIBS_DIR}/lib${SEQUENTIAL_BLAS_LIB}.so
${OPENCV_CORE_LIB})
add_executable(indexdb_create2
indexdb_create2.cpp
$<TARGET_OBJECTS:databases>
$<TARGET_OBJECTS:quantizers>
$<TARGET_OBJECTS:vector_io>
$<TARGET_OBJECTS:distances>
$<TARGET_OBJECTS:neighbors>)
target_link_libraries(indexdb_create2
${LIBS_DIR}/lib${SEQUENTIAL_BLAS_LIB}.so
${OPENCV_CORE_LIB})
add_executable(db_add
db_add.cpp
$<TARGET_OBJECTS:databases>
$<TARGET_OBJECTS:quantizers>
$<TARGET_OBJECTS:vector_io>
$<TARGET_OBJECTS:distances>
$<TARGET_OBJECTS:neighbors>)
target_link_libraries(db_add
${LIBS_DIR}/lib${SEQUENTIAL_BLAS_LIB}.so
${OPENCV_CORE_LIB})
add_executable(db_query
db_query.cpp
$<TARGET_OBJECTS:databases>
$<TARGET_OBJECTS:quantizers>
$<TARGET_OBJECTS:vector_io>
$<TARGET_OBJECTS:distances>
$<TARGET_OBJECTS:neighbors>)
target_link_libraries(db_query
${LIBS_DIR}/lib${SEQUENTIAL_BLAS_LIB}.so
${OPENCV_CORE_LIB})
add_executable(db_query_4
db_query_4.cpp
$<TARGET_OBJECTS:databases>
$<TARGET_OBJECTS:quantizers>
$<TARGET_OBJECTS:vector_io>
$<TARGET_OBJECTS:distances>
$<TARGET_OBJECTS:neighbors>)
target_link_libraries(db_query_4
${LIBS_DIR}/lib${SEQUENTIAL_BLAS_LIB}.so
${OPENCV_CORE_LIB})
add_executable(split_vecs
split_vecs.cpp)