45 lines
793 B
CMake
45 lines
793 B
CMake
cmake_minimum_required(VERSION 3.6)
|
|
|
|
project(Plural LANGUAGES CXX)
|
|
|
|
find_package(Qt5Widgets REQUIRED)
|
|
find_package(Protobuf REQUIRED)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
qt5_wrap_ui(UI_HEADERS
|
|
PluralWidget.ui
|
|
)
|
|
|
|
set(Plural_PROTO_FILES
|
|
../../../proto/PluralModel.proto
|
|
)
|
|
|
|
protobuf_generate_cpp(Plural_PROTO_SRCS Plural_PROTO_HDRS ${Plural_PROTO_FILES})
|
|
|
|
add_library(${PROJECT_NAME}
|
|
PluralWidget.cpp
|
|
PluralModel.cpp
|
|
${UI_HEADERS}
|
|
${Plural_PROTO_SRCS}
|
|
${Plural_PROTO_HDRS}
|
|
)
|
|
|
|
set_target_properties(${PROJECT_NAME}
|
|
PROPERTIES CXX_STANDARD 14
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
PRIVATE
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
${Protobuf_INCLUDE_DIRS}
|
|
)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
PRIVATE
|
|
PrintableModel
|
|
Qt5::Widgets
|
|
${Protobuf_LIBRARIES}
|
|
)
|