cmake stuff

This commit is contained in:
Martin Brodbeck 2025-03-18 12:32:10 +01:00
parent 980f60c003
commit 27f36b4aa8
3 changed files with 27 additions and 25 deletions

View file

@ -6,7 +6,9 @@ find_package(SQLite3 REQUIRED)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)
set(CORE_SOURCES
add_library(core STATIC)
target_sources(core PRIVATE
database.cpp
entity.cpp
entityint.cpp
@ -20,9 +22,6 @@ set(CORE_SOURCES
utils.cpp
)
add_library(core STATIC ${CORE_SOURCES})
if (WIN32)
target_link_libraries(core PRIVATE sqlite3 nlohmann_json::nlohmann_json)
target_link_libraries(core PRIVATE bcrypt)

View file

@ -21,27 +21,30 @@ FetchContent_Declare(
FetchContent_MakeAvailable(SingleApplication)
add_compile_definitions(QAPPLICATION_CLASS=${QAPPLICATION_CLASS})
set(GUI_SOURCES
kima2.cpp
mainwindow.cpp
mainwindow.ui
sellerdialog.cpp
sellerdialog.ui
sellermodel.cpp
pricedialog.cpp
pricedialog.ui
basketmodel.cpp
salemodel.cpp
reportdialog.cpp
reportdialog.ui
reportmodel.cpp
settingsdialog.cpp
settingsdialog.ui
../../kima2.qrc
add_executable(kima2)
target_sources(kima2 PRIVATE
kima2.cpp
mainwindow.cpp
mainwindow.ui
sellerdialog.cpp
sellerdialog.ui
sellermodel.cpp
pricedialog.cpp
pricedialog.ui
basketmodel.cpp
salemodel.cpp
reportdialog.cpp
reportdialog.ui
reportmodel.cpp
settingsdialog.cpp
settingsdialog.ui
../../kima2.qrc
kima2.rc
)
add_executable(kima2 ${GUI_SOURCES} kima2.rc)
target_include_directories(kima2 PRIVATE ${PROJECT_BINARY_DIR})
target_link_libraries(kima2 core printer Qt::Core Qt::PrintSupport Qt::Network SingleApplication::SingleApplication)
if(WIN32)

View file

@ -10,9 +10,9 @@ else()
endif()
add_library(printer STATIC)
target_sources(printer
PRIVATE
posprinter.cpp utils.cpp
target_sources(printer PRIVATE
posprinter.cpp
utils.cpp
)
if(WIN32)