51 lines
1.4 KiB
CMake
51 lines
1.4 KiB
CMake
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
# Instruct CMake to run moc automatically when needed
|
|
set(CMAKE_AUTOMOC ON)
|
|
# Create code from a list of Qt designer ui files
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
# Find the QtWidgets library
|
|
find_package(Qt5Widgets CONFIG REQUIRED)
|
|
find_package(Qt5PrintSupport CONFIG REQUIRED)
|
|
|
|
# For SingleApplication:
|
|
find_package(Qt5Network CONFIG REQUIRED)
|
|
set(QAPPLICATION_CLASS QApplication)
|
|
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
|
|
${PROJECT_SOURCE_DIR}/3rdparty/singleapplication/singleapplication.cpp
|
|
${PROJECT_SOURCE_DIR}/3rdparty/singleapplication/singleapplication_p.cpp
|
|
)
|
|
|
|
add_executable(kima2 ${GUI_SOURCES} kima2.rc)
|
|
target_include_directories(kima2 PRIVATE ${PROJECT_BINARY_DIR})
|
|
target_include_directories(kima2 PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/singleapplication)
|
|
target_link_libraries(kima2 core printer Qt5::Widgets Qt5::PrintSupport Qt5::Network stdc++fs)
|
|
if(WIN32)
|
|
set_target_properties(kima2 PROPERTIES LINK_FLAGS "-mwindows")
|
|
endif(WIN32)
|
|
|
|
# CPack
|
|
install(TARGETS kima2 RUNTIME DESTINATION bin)
|
|
|