myxlib/CMakeLists.txt

65 lines
2.0 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Минимальная версия Cmake
cmake_minimum_required(VERSION 3.3)
cmake_policy(VERSION 3.0.2..3.7)
# Название проекта
project(myx VERSION 0.3.0 LANGUAGES C CXX)
set(CPACK_GENERATOR "TXZ;DEB")
set(CPACK_PACKAGE_CONTACT "dev@246060.ru")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mixed functions")
set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
# В каталоге cmake/lib находятся файлы с библиотечными функциями
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 not exists")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/find)
include(CMLibCommon)
option(BUILD_EXAMPLES "Build examples" OFF)
# Поиск библиотек с помощью pkgconfig
find_package(PkgConfig)
# Qt5
find_package(Qt5 COMPONENTS Core Network Gui Widgets DBus Concurrent Sql REQUIRED)
pkg_check_modules(FMT fmt>=5.3.0)
pkg_check_modules(SPDLOG spdlog>=1.3.1)
# Автоматически генерируемый заголовочный файл
cmlib_config_hpp_generate()
configure_file(${CMAKE_SOURCE_DIR}/src/base/config_flags.hpp.in
${CMAKE_BINARY_DIR}/include/config_flags.hpp)
# Подключение внешних проектов
include(ExternalProject)
# Библиотеки
add_subdirectory(src/base)
add_subdirectory(src/filesystem)
add_subdirectory(src/log)
# Примеры
if (BUILD_EXAMPLES)
add_subdirectory(examples/filesystem)
add_subdirectory(examples/log)
endif()
add_breathe_target(
TARGET_NAME doc-breathe
SOURCE_DIR ${CMAKE_SOURCE_DIR}/doc/html
BUILD_DIR ${CMAKE_BINARY_DIR}
CACHE_DIR ${CMAKE_BINARY_DIR}/_doctrees
HTML_DIR ${CMAKE_BINARY_DIR}/html
DOXY_FILE ${CMAKE_SOURCE_DIR}/doc/html/Doxyfile.in
CONF_FILE ${CMAKE_SOURCE_DIR}/doc/html/conf.py.in
COMMENT "Documentation in HTML format with Breathe generator"
)