-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
98 lines (86 loc) · 2.8 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
97
98
cmake_minimum_required(VERSION 3.5)
project(AlcoMetr LANGUAGES CXX VERSION 1.0.2)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
#SET(BUILD_SHARED_LIBS OFF)
#SET(CMAKE_EXE_LINKER_FLAGS "-static")
set(CMAKE_RC_FLAGS —use-temp-file)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Core Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Core Network)
include_directories(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/gui
${CMAKE_CURRENT_SOURCE_DIR}/src/include
${QT_INCLUDES}
${${PROJECT_NAME}_OPT_INCLUDE_DIRS}
)
set(${PROJECT_NAME}_SRC
src/main.cpp
src/mainwindow.cpp
src/alco_item.cpp
src/parse_inshaker.cpp
src/alco_save_worker.cpp
src/alco_base_worker.cpp
src/alco_tablewidget.cpp
src/alco_cocktail_manager.cpp
src/alco_create_coctail_form.cpp
src/alco_current_bar.cpp
src/alco_chose_item_widget.cpp
src/alco_coctails_save_worker.cpp
src/alco_edit_base.cpp
src/alco_use_coctails.cpp
src/qdynamicgridlayout.cpp
)
set(${PROJECT_NAME}_HDR
src/include/mainwindow.h
src/include/alco_item.h
src/include/parse_inshaker.h
src/include/alco_save_worker.h
src/include/alco_base_worker.h
src/include/alco_tablewidget.h
src/include/alco_cocktail_manager.h
src/include/alco_create_coctail_form.h
src/include/alco_current_bar.h
src/include/alco_chose_item_widget.h
src/include/alco_coctails_save_worker.h
src/include/alco_edit_base.h
src/include/alco_use_coctails.h
src/include/qdynamicgridlayout.h
)
set(${PROJECT_NAME}_FORMS_UI
gui/mainwindow.ui
gui/alco_cocktail_manager.ui
gui/alco_create_coctail_form.ui
gui/alco_current_bar.ui
gui/alco_chose_item_widget.ui
gui/alco_edit_base.ui
gui/alco_use_coctails.ui
)
set(${PROJECT_NAME}_Qt_Resource_files
resources.qrc
${${PROJECT_NAME}_Qt_Resource_files})
qt6_wrap_ui(${PROJECT_NAME}_UIs ${${PROJECT_NAME}_FORMS_UI})
qt6_wrap_cpp(${PROJECT_NAME}_MOCs ${${PROJECT_NAME}_HDR})
qt6_add_resources(${PROJECT_NAME}_RCCs ${${PROJECT_NAME}_Qt_Resource_files})
set(TARGET_EXE ${PROJECT_NAME})
add_executable(${TARGET_EXE} WIN32 ${OS_EX_FLAG}
${${PROJECT_NAME}_QT_SOURCES}
${${PROJECT_NAME}_QT_HEADERS}
${${PROJECT_NAME}_UIs}
${${PROJECT_NAME}_RCCs}
${${PROJECT_NAME}_MOCs}
${${PROJECT_NAME}_SRC}
${${PROJECT_NAME}_HDR}
${${PROJECT_NAME}_VERSION_FILES})
set_target_properties(${TARGET_EXE}
PROPERTIES
VERSION ${${PROJECT_NAME}_VERSION}
)
target_link_libraries(${TARGET_EXE}
${QT_LIBRARIES}
${${PROJECT_NAME}_OPT_LIBS}
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Network
)