-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (42 loc) · 1.16 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
cmake_minimum_required(VERSION 3.12)
set(TARGET_NAME qtsearcher)
project(${TARGET_NAME})
set(CMAKE_CXX_STANDARD 17)
add_compile_options(-Wall --std=c++17 -g -pthread)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
tests/gtest
)
# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)
# Source files
set(SOURCES
application/main.cpp
indexer/index.h
indexer/indexer.h
finder/finder.h
ui/MainWindow.h finder/prefix_function.h)
# User interface files
set(FORMS
ui/MainWindow.ui)
# Shared libraries
set(LIBRARIES
Qt5::Widgets
pthread
)
# Generate additional sources with MOC and UIC
qt5_wrap_ui(UIC_SOURCES ${FORMS})
# Set target
add_executable(${TARGET_NAME} ${SOURCES} ${HEADERS} ${UIC_SOURCES})
# Link with libraries
target_link_libraries(${TARGET_NAME} ${LIBRARIES})
# testing
add_executable(testing
indexer/index.h
tests/test_index.cpp
tests/gtest/gtest-all.cc
tests/gtest/gtest_main.cc)
target_link_libraries(testing ${LIBRARIES})