This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ESGRAF48/source/CMakeLists.txt

124 lines
2.5 KiB
CMake
Raw Permalink Normal View History

2018-05-10 16:41:14 +00:00
cmake_minimum_required(VERSION 3.6)
2019-02-17 16:33:43 +00:00
set(BUILD_VERSION_MAJOR_MINOR 0.6)
if ($ENV{BUILD_NUMBER})
set(BUILD_VERSION_PATCH $ENV{BUILD_NUMBER})
else()
set(BUILD_VERSION_PATCH 0)
endif()
project(ESGRAF48
VERSION ${BUILD_VERSION_MAJOR_MINOR}.${BUILD_VERSION_PATCH}
DESCRIPTION "ESGRAF 4-8"
LANGUAGES CXX
)
configure_file(
version.h.in
version.h
)
2018-05-10 16:41:14 +00:00
find_package(Qt5Widgets REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Protobuf REQUIRED)
2018-05-10 16:41:14 +00:00
set(CMAKE_AUTOMOC ON)
2018-05-18 18:12:48 +00:00
set(CMAKE_AUTORCC ON)
2018-05-10 16:41:14 +00:00
2018-05-23 16:52:13 +00:00
qt5_wrap_ui(LOGO_TEST_UI
2018-05-10 16:41:14 +00:00
mainwindow.ui
)
2018-05-18 18:36:48 +00:00
2018-05-23 16:52:13 +00:00
qt5_add_resources(LOGO_TEST_QRC
2018-05-18 18:36:48 +00:00
mainwindow.qrc
2018-05-18 18:12:48 +00:00
)
2018-05-10 16:41:14 +00:00
set(DataModel_PROTO_FILES
../proto/DataModel.proto
2018-11-16 22:21:02 +00:00
../proto/MetaDataModel.proto
../proto/V2SvkModel.proto
../proto/VerbEndModel.proto
../proto/GenusModel.proto
../proto/AkkusativModel.proto
../proto/DativModel.proto
2018-11-18 16:40:07 +00:00
../proto/PluralModel.proto
../proto/LateSkillsPassivModel.proto
../proto/LateSkillsGenitivModel.proto
)
2018-11-13 23:17:29 +00:00
protobuf_generate_cpp(DataModel_PROTO_SRCS DataModel_PROTO_HDRS
${DataModel_PROTO_FILES})
add_executable(${PROJECT_NAME} WIN32
2018-12-08 15:39:33 +00:00
ESGRAF48.cpp
2018-05-16 05:02:12 +00:00
DataModel.cpp
2018-05-10 16:41:14 +00:00
mainwindow.cpp
2018-05-23 16:52:13 +00:00
${LOGO_TEST_UI}
${LOGO_TEST_QRC}
2018-11-13 23:17:29 +00:00
${DataModel_PROTO_SRCS}
${DataModel_PROTO_HDRS}
2018-05-10 16:41:14 +00:00
)
set_target_properties(${PROJECT_NAME}
PROPERTIES CXX_STANDARD 14
)
2018-05-10 16:41:14 +00:00
target_include_directories(${PROJECT_NAME}
PRIVATE
2018-05-17 18:04:42 +00:00
${CMAKE_CURRENT_LIST_DIR}
2018-05-10 16:41:14 +00:00
${CMAKE_CURRENT_BINARY_DIR}
${Protobuf_INCLUDE_DIRS}
2018-05-10 16:41:14 +00:00
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Age
CheckableItem
CheckableTest
CheckableTestModel
PrintableModel
2018-05-18 18:36:48 +00:00
MetaData
2018-05-23 16:43:57 +00:00
VerbEnd
2018-06-04 16:48:58 +00:00
Plural
2018-05-20 17:13:18 +00:00
Genus
2018-06-16 15:54:27 +00:00
AkkusativDativ
2018-06-25 21:04:32 +00:00
V2Svk
LateSkills
2018-06-16 15:54:27 +00:00
ResultWidget
2018-05-10 16:41:14 +00:00
Qt5::Widgets
Qt5::PrintSupport
${Protobuf_LIBRARIES}
2018-05-10 16:41:14 +00:00
)
2018-05-18 18:36:48 +00:00
if (WIN32)
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
message(STATUS "_qmake_executable: ${_qmake_executable}")
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
message(STATUS "_qt_bin_dir: ${_qt_bin_dir}")
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
if (WINDEPLOYQT_EXECUTABLE)
message(STATUS "Found ${WINDEPLOYQT_EXECUTABLE}")
else()
message(FATAL_ERROR "Unable to find windeployqt")
endif()
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${WINDEPLOYQT_EXECUTABLE} $<TARGET_FILE:${PROJECT_NAME}>)
endif()
add_subdirectory(Age)
2018-05-24 06:16:04 +00:00
add_subdirectory(CheckableItem)
add_subdirectory(CheckableTest)
add_subdirectory(CheckableTestModel)
add_subdirectory(PrintableModel)
2018-05-24 06:16:04 +00:00
2018-05-18 18:36:48 +00:00
add_subdirectory(MetaData)
2018-06-04 16:23:51 +00:00
add_subdirectory(SubTests)
add_subdirectory(ResultWidget)