2020-04-11 11:06:19 +00:00
|
|
|
|
# Минимальная версия CMake
|
|
|
|
|
cmake_minimum_required(VERSION 3.3)
|
|
|
|
|
|
|
|
|
|
# Предпочтительно следовать стандартам принятым в указанном диапазоне версий
|
|
|
|
|
cmake_policy(VERSION 3.0.2..3.7)
|
|
|
|
|
|
|
|
|
|
# Название и версия проекта и используемые языки программирования
|
2020-04-14 09:58:28 +00:00
|
|
|
|
project(cmlib-example-app-features VERSION 0.2.0 LANGUAGES C CXX)
|
2020-04-11 11:06:19 +00:00
|
|
|
|
|
|
|
|
|
# В каталоге cmake/cmlib находятся файлы с библиотечными функциями
|
|
|
|
|
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/cmlib)
|
|
|
|
|
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/cmlib)
|
|
|
|
|
else()
|
|
|
|
|
message(FATAL_ERROR "CMake library directory does not exist")
|
|
|
|
|
endif()
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/find)
|
|
|
|
|
|
|
|
|
|
include(CMLibCommon)
|
|
|
|
|
|
2020-04-11 11:42:41 +00:00
|
|
|
|
# Boost
|
|
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
|
|
|
set(Boost_USE_MULTITHREADED OFF)
|
|
|
|
|
set(Boost_USE_STATIC_RUNTIME ON)
|
2020-04-22 19:38:05 +00:00
|
|
|
|
find_package(Boost 1.55.0 REQUIRED)
|
2020-04-11 11:42:41 +00:00
|
|
|
|
|
2020-04-13 21:36:09 +00:00
|
|
|
|
# Qt5
|
2020-04-14 06:20:13 +00:00
|
|
|
|
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
|
2020-04-13 21:36:09 +00:00
|
|
|
|
|
2020-04-11 11:42:41 +00:00
|
|
|
|
# Автоматически генерируемый заголовочный файл
|
|
|
|
|
cmlib_config_hpp_generate()
|
|
|
|
|
|
2020-04-13 21:36:09 +00:00
|
|
|
|
# Подключение внешних проектов
|
|
|
|
|
include(ExternalProject)
|
|
|
|
|
|
|
|
|
|
ExternalProject_Add(
|
|
|
|
|
myxlib
|
|
|
|
|
SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/myxlib
|
|
|
|
|
INSTALL_DIR ${CMAKE_BINARY_DIR}
|
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
|
CONFIGURE_COMMAND
|
|
|
|
|
${CMAKE_COMMAND} -"G${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
|
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
|
|
|
|
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} <SOURCE_DIR>
|
|
|
|
|
BUILD_COMMAND true)
|
|
|
|
|
|
2020-04-11 11:42:41 +00:00
|
|
|
|
# Приложение
|
|
|
|
|
add_subdirectory(src/cmlib-example)
|
|
|
|
|
|
|
|
|
|
# Документация
|
|
|
|
|
add_subdirectory(cmake/doc)
|
|
|
|
|
|
|
|
|
|
# Создание вспомогательных символических ссылок
|
2020-04-14 09:58:28 +00:00
|
|
|
|
add_dependencies(cmlib-example-app-features create_auxilary_symlinks)
|
2020-04-11 11:42:41 +00:00
|
|
|
|
|