Files
GenericQtClientCore/CMakeLists.txt

57 lines
1.9 KiB
CMake

cmake_minimum_required(VERSION 3.16)
set(TARGET_APP "GenericCore")
project(${TARGET_APP} VERSION 0.3.0 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core LinguistTools)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core LinguistTools Gui)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Network)
configure_file(CoreConfig.h.in CoreConfig.h)
set(TS_FILES ${TARGET_APP}_en_US.ts)
add_library(${TARGET_APP} STATIC
genericcore.cpp
genericcore.h
${TS_FILES}
constants.h
data/settingshandler.h data/settingshandler.cpp
model/tablemodel.h model/tablemodel.cpp
model/modelitem.h model/modelitem.cpp
formats/jsonparser.h formats/jsonparser.cpp
model/commands/insertrowscommand.h model/commands/insertrowscommand.cpp
model/commands/removerowscommand.h model/commands/removerowscommand.cpp
model/commands/edititemcommand.h model/commands/edititemcommand.cpp
data/filehandler.h data/filehandler.cpp
model/metadata.h
formats/csvparser.h formats/csvparser.cpp
model/generalsortfiltermodel.h model/generalsortfiltermodel.cpp
network/servercommunicator.h network/servercommunicator.cpp
network/apiroutes.h
# 3rd party libraries
../3rdParty/rapidcsv/src/rapidcsv.h
utils/messagehandler.h
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(${TARGET_APP} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui)
target_link_libraries(GenericCore PRIVATE Qt${QT_VERSION_MAJOR}::Test)
target_link_libraries(GenericCore PRIVATE Qt${QT_VERSION_MAJOR}::Network)
target_compile_definitions(${TARGET_APP} PRIVATE ${TARGET_APP}_LIBRARY)
if(COMMAND qt_create_translation)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()