-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
70 lines (55 loc) · 1.62 KB
/
CMakeLists.txt
File metadata and controls
70 lines (55 loc) · 1.62 KB
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
cmake_minimum_required(VERSION 3.16)
project(QtFiles LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
include(FetchContent)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.12.0
)
FetchContent_MakeAvailable(nlohmann_json)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)
# Prevent GoogleTest from overriding compiler settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_library(backend
src/core/file_operations.cpp
src/core/settings.cpp
)
target_include_directories(backend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/core)
target_include_directories(backend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/utils)
# Add QtCore so we can return QStrings
target_link_libraries(backend PUBLIC Qt6::Core)
target_link_libraries(backend PRIVATE nlohmann_json::nlohmann_json)
qt_add_resources(QtFilesRessources src/ressources.qrc)
add_executable(QtFiles
src/main.cpp
src/gui/file_explorer.cpp
src/gui/builders/modal_builder.cpp
src/gui/models/file_model.cpp
src/gui/components/inputs/clickable_line_edit.h
${QtFilesRessources}
)
target_link_libraries(QtFiles PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
nlohmann_json::nlohmann_json
backend
)
enable_testing()
add_executable(run_tests
tests/test_utils.cpp
tests/test_file_operations.cpp
)
target_link_libraries(run_tests PRIVATE backend GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(run_tests)