Sun, 27 Feb 2022 20:45:41 +0100
Added inventory equipment table and editor.
1 | 1 | # CMakeLists.txt is part of bmsapp |
2 | # | |
3 | ||
4 | PROJECT(bmsapp) | |
5 | CMAKE_MINIMUM_REQUIRED( VERSION 3.6 ) | |
6 | SET(bmsapp_EXECUTABLE "bmsapp") | |
7 | MESSAGE( STATUS "Building bmsapp" ) | |
8 | ||
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
9 | # ===== Set application version ===== |
1 | 10 | |
11 | SET( bmsapp_VERSION_MAJOR 0 ) | |
12 | SET( bmsapp_VERSION_MINOR 1 ) | |
13 | SET( bmsapp_VERSION_PATCH 0 ) | |
14 | ||
15 | # Compile flags | |
16 | ||
17 | # Automatically run moc on source files when necessary | |
18 | set(CMAKE_AUTOMOC ON) | |
3 | 19 | set(CMAKE_AUTOUIC ON) |
20 | set(CMAKE_AUTORCC ON) | |
1 | 21 | |
22 | SET( CMAKE_CXX_FLAGS_RELEASE "-Wall -ansi -pedantic -Wno-long-long -O2 -pipe" ) | |
23 | SET( CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -pipe" ) | |
24 | ||
25 | #====================================================Set build type===================================================== | |
26 | # We might always to tell the compiler to include debugging information (eg via the -g option on gcc). It makes the | |
27 | # binaries slightly bigger on Linux, but helps greatly in analysing core dumps etc. (In closed-source projects people | |
28 | # sometimes turn it off for release builds to make it harder to reverse engineer the software, but obviously that's not | |
29 | # an issue for us.) | |
30 | # | |
31 | # However, setting CMAKE_BUILD_TYPE to "Debug", also changes other things, such as the default location for config | |
32 | # files, which we don't want on a release build, so we would probably need to set compiler flags directly. | |
33 | # | |
34 | # .:TBD:. Investigate whether setting CMAKE_BUILD_TYPE to "RelWithDebInfo" does what we want. | |
35 | # | |
36 | #IF( ${DO_RELEASE_BUILD} ) | |
37 | # SET(CMAKE_BUILD_TYPE "Release") | |
38 | #ELSE() | |
39 | # SET(CMAKE_BUILD_TYPE "Debug") | |
40 | #ENDIF() | |
41 | ||
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
42 | # ===== Directories ===== |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
43 | |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
44 | IF( NOT EXEC_PREFIX ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
45 | SET( EXEC_PREFIX ${CMAKE_INSTALL_PREFIX} ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
46 | ENDIF() |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
47 | |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
48 | SET( DATAROOTDIR "${EXEC_PREFIX}/share" ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
49 | SET( BINDIR "${EXEC_PREFIX}/bin" ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
50 | IF( NOT DOCDIR ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
51 | SET( DOCDIR "${DATAROOTDIR}/doc/${CMAKE_PROJECT_NAME}" ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
52 | ENDIF() |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
53 | |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
54 | SET( DATAPATH "${DATAROOTDIR}/${CMAKE_PROJECT_NAME}" ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
55 | SET( TARGETPATH ${BINDIR} ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
56 | SET( DOCPATH ${DOCDIR} ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
57 | |
1 | 58 | |
59 | SET(ROOTDIR "${CMAKE_CURRENT_SOURCE_DIR}") | |
60 | SET(SRCDIR "${ROOTDIR}/src") | |
3 | 61 | SET(UIDIR "${ROOTDIR}/ui") |
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
62 | SET(DATADIR "${ROOTDIR}/data") |
1 | 63 | #SET(TRANSLATIONSDIR "${ROOTDIR}/translations") |
64 | ||
65 | INCLUDE_DIRECTORIES(${SRCDIR}) | |
66 | INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/src") # In case of out-of-source build. | |
67 | ||
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
68 | # ===== Find Qt5 ===== |
1 | 69 | |
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
70 | # Minimum versio 5.13 for debug messages. |
3 | 71 | find_package(Qt5 5.13 REQUIRED COMPONENTS Core Widgets Network Sql) |
1 | 72 | |
3 | 73 | # PrintSupport Xml LinguistTools |
1 | 74 | |
75 | # Some extra files for the "make clean" target. | |
76 | SET_PROPERTY( | |
77 | DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
78 | PROPERTY ADDITIONAL_MAKE_CLEAN_FILES | |
79 | cmake_install.cmake | |
80 | compile_commands.json | |
81 | CMakeCache.txt | |
82 | ) | |
83 | ||
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
84 | # ===== Setup the config.h ===== |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
85 | |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
86 | SET( CONFIGDATADIR "${DATAPATH}/" ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
87 | SET( CONFIGDOCDIR "${DOCPATH}/" ) |
1 | 88 | |
89 | # Tell cmake where the configure file is and where | |
90 | # to put the output. All variables in config.in written as "${VAR}$ | |
91 | # will be replaced by VAR as determined by cmake in config.h. | |
92 | # Outputs only in the build directory. | |
93 | CONFIGURE_FILE( src/config.in src/config.h ) | |
94 | ||
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
95 | # ===== All sources ===== |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
96 | |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
97 | set( SRCS |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
98 | ${SRCDIR}/main.cpp |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
99 | ${SRCDIR}/bmsapp.cpp |
4 | 100 | ${SRCDIR}/AboutDialog.cpp |
6
f8474f2c5db9
We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
4
diff
changeset
|
101 | ${SRCDIR}/InventorySuppliers.cpp |
10
8aa2bd9ba9e8
Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents:
6
diff
changeset
|
102 | ${SRCDIR}/EditSupplier.cpp |
19
c94edc758a5b
Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents:
18
diff
changeset
|
103 | ${SRCDIR}/InventoryFermentables.cpp |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
104 | ${SRCDIR}/EditFermentable.cpp |
24 | 105 | ${SRCDIR}/InventoryHops.cpp |
106 | ${SRCDIR}/EditHop.cpp | |
25
a9da2744609e
Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents:
24
diff
changeset
|
107 | ${SRCDIR}/InventoryYeasts.cpp |
a9da2744609e
Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents:
24
diff
changeset
|
108 | ${SRCDIR}/EditYeast.cpp |
28
93a70b1502ca
Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
25
diff
changeset
|
109 | ${SRCDIR}/InventoryMiscs.cpp |
93a70b1502ca
Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
25
diff
changeset
|
110 | ${SRCDIR}/EditMisc.cpp |
29
76846c99f827
Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents:
28
diff
changeset
|
111 | ${SRCDIR}/InventoryWaters.cpp |
76846c99f827
Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents:
28
diff
changeset
|
112 | ${SRCDIR}/EditWater.cpp |
30
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
113 | ${SRCDIR}/InventoryEquipments.cpp |
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
114 | ${SRCDIR}/EditEquipment.cpp |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
115 | ${SRCDIR}/Setup.cpp |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
116 | ${SRCDIR}/Utils.cpp |
3 | 117 | ${SRCDIR}/MainWindow.cpp |
118 | ${SRCDIR}/database/database.cpp | |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
119 | ${SRCDIR}/nulldateedit.cpp |
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
120 | ) |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
121 | |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
122 | set( HDRS |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
123 | ${SRCDIR}/bmsapp.h |
4 | 124 | ${SRCDIR}/AboutDialog.h |
6
f8474f2c5db9
We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
4
diff
changeset
|
125 | ${SRCDIR}/InventorySuppliers.h |
10
8aa2bd9ba9e8
Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents:
6
diff
changeset
|
126 | ${SRCDIR}/EditSupplier.h |
19
c94edc758a5b
Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents:
18
diff
changeset
|
127 | ${SRCDIR}/InventoryFermentables.h |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
128 | ${SRCDIR}/EditFermentable.h |
24 | 129 | ${SRCDIR}/InventoryHops.h |
130 | ${SRCDIR}/EditHop.h | |
25
a9da2744609e
Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents:
24
diff
changeset
|
131 | ${SRCDIR}/InventoryYeasts.h |
a9da2744609e
Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents:
24
diff
changeset
|
132 | ${SRCDIR}/EditYeast.h |
28
93a70b1502ca
Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
25
diff
changeset
|
133 | ${SRCDIR}/InventoryMiscs.h |
93a70b1502ca
Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
25
diff
changeset
|
134 | ${SRCDIR}/EditMisc.h |
29
76846c99f827
Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents:
28
diff
changeset
|
135 | ${SRCDIR}/InventoryWaters.h |
76846c99f827
Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents:
28
diff
changeset
|
136 | ${SRCDIR}/EditWater.h |
30
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
137 | ${SRCDIR}/InventoryEquipments.h |
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
138 | ${SRCDIR}/EditEquipment.h |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
139 | ${SRCDIR}/Setup.h |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
140 | ${SRCDIR}/Utils.h |
3 | 141 | ${SRCDIR}/MainWindow.h |
142 | ${SRCDIR}/database/database.h | |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
143 | ${SRCDIR}/nulldateedit.h |
3 | 144 | ) |
145 | ||
146 | set( UIS | |
4 | 147 | ${UIDIR}/AboutDialog.ui |
6
f8474f2c5db9
We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
4
diff
changeset
|
148 | ${UIDIR}/InventorySuppliers.ui |
10
8aa2bd9ba9e8
Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents:
6
diff
changeset
|
149 | ${UIDIR}/EditSupplier.ui |
19
c94edc758a5b
Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents:
18
diff
changeset
|
150 | ${UIDIR}/InventoryFermentables.ui |
20
fcbbddcc22c1
Completed the Fermentables editor.
Michiel Broek <mbroek@mbse.eu>
parents:
19
diff
changeset
|
151 | ${UIDIR}/EditFermentable.ui |
23
1ac3fb2569c1
Added ui files for hops, yeasts and misc inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
152 | ${UIDIR}/InventoryHops.ui |
1ac3fb2569c1
Added ui files for hops, yeasts and misc inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
153 | ${UIDIR}/EditHop.ui |
1ac3fb2569c1
Added ui files for hops, yeasts and misc inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
154 | ${UIDIR}/InventoryYeasts.ui |
1ac3fb2569c1
Added ui files for hops, yeasts and misc inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
155 | ${UIDIR}/EditYeast.ui |
1ac3fb2569c1
Added ui files for hops, yeasts and misc inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
156 | ${UIDIR}/InventoryMiscs.ui |
1ac3fb2569c1
Added ui files for hops, yeasts and misc inventory.
Michiel Broek <mbroek@mbse.eu>
parents:
20
diff
changeset
|
157 | ${UIDIR}/EditMisc.ui |
29
76846c99f827
Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents:
28
diff
changeset
|
158 | ${UIDIR}/InventoryWaters.ui |
30
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
159 | ${UIDIR}/EditWater.ui |
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
160 | ${UIDIR}/InventoryEquipments.ui |
0fec6a1abd13
Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
29
diff
changeset
|
161 | ${UIDIR}/EditEquipment.ui |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
14
diff
changeset
|
162 | ${UIDIR}/Setup.ui |
3 | 163 | ${UIDIR}/MainWindow.ui |
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
164 | ) |
1 | 165 | |
166 | set( SOURCE_FILES | |
2
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
167 | ${SRCS} |
a1e435907f3a
Added commandline parameters. Added initial app functions. Added user configuration read/write/create.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
168 | ${HDRS} |
3 | 169 | ${UIS} |
170 | resources/icons.qrc | |
14
8a304c898a75
Added QDarkStyle stylesheet and images. Updated About window. Some minor layout improvements.
Michiel Broek <mbroek@mbse.eu>
parents:
10
diff
changeset
|
171 | resources/qdarkstyle/theme/style.qrc |
1 | 172 | ) |
173 | ||
174 | # ===== Build the application ===== | |
175 | ||
176 | add_executable(${bmsapp_EXECUTABLE} ${SOURCE_FILES}) | |
3 | 177 | target_link_libraries(${bmsapp_EXECUTABLE} Qt5::Core Qt5::Widgets Qt5::Network Qt5::Sql) |
1 | 178 |