-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (50 loc) · 1.45 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
cmake_minimum_required(VERSION 3.14)
project(Weseliada LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Core Quick LinguistTools QuickControls2 REQUIRED)
set(TS_FILES Weseliada_pl_PL.ts)
set(CPP_INCLUDE_DIR "include")
set(CPP_HEADERS
${CPP_INCLUDE_DIR}/scoreboardmodel.h
${CPP_INCLUDE_DIR}/sidebarmodel.h
${CPP_INCLUDE_DIR}/answerareamodel.h
${CPP_INCLUDE_DIR}/questionlistmodel.h
${CPP_INCLUDE_DIR}/answerlistmodel.h
${CPP_INCLUDE_DIR}/teamscoremodel.h)
set(CPP_SRC_DIR "src")
set(CPP_SOURCES
${CPP_SRC_DIR}/main.cpp
${CPP_SRC_DIR}/scoreboardmodel.cpp
${CPP_SRC_DIR}/sidebarmodel.cpp
${CPP_SRC_DIR}/answerareamodel.cpp
${CPP_SRC_DIR}/questionlistmodel.cpp
${CPP_SRC_DIR}/answerlistmodel.cpp
${CPP_SRC_DIR}/teamscoremodel.cpp)
if(ANDROID)
add_library(Weseliada SHARED
${CPP_SOURCES}
qml.qrc
resources.qrc
${TS_FILES}
)
else()
add_executable(Weseliada
${CPP_SOURCES}
qml.qrc
resources.qrc
${TS_FILES}
${CPP_HEADERS}
)
endif()
target_compile_definitions(Weseliada
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(Weseliada
PRIVATE Qt5::Core Qt5::Quick Qt5::QuickControls2)
target_include_directories(Weseliada
PRIVATE ${CPP_INCLUDE_DIR})
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})