-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
52 lines (41 loc) · 1.11 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
cmake_minimum_required(VERSION 3.27.8)
project(si-config-logger VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
add_compile_options(
-Wall
-Wextra
-pedantic
-Werror
)
add_executable(
${PROJECT_NAME}
main.cpp
resources/resources.qrc
)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
# https://stackoverflow.com/a/65970819
find_package(Tesseract)
if (NOT Tesseract_FOUND)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Tesseract REQUIRED IMPORTED_TARGET tesseract lept)
add_library(Tesseract::libtesseract ALIAS PkgConfig::Tesseract)
endif()
set(ORIGIN_YEAR "2023")
string(TIMESTAMP CURRENT_YEAR "%Y")
string(COMPARE EQUAL ${ORIGIN_YEAR} ${CURRENT_YEAR} YEARS_EQUAL)
if(YEARS_EQUAL)
set(PROJECT_YEAR_RANGE ${ORIGIN_YEAR})
else()
string(CONCAT PROJECT_YEAR_RANGE ${ORIGIN_YEAR} "-" ${CURRENT_YEAR})
endif()
configure_file(src/configure-files/LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
add_subdirectory(src)
target_link_libraries(
si-config-logger PRIVATE
Qt::Widgets
MainWindow
)