2019-02-12 16:37:35 +00:00
|
|
|
|
# Минимальная версия Cmake
|
|
|
|
|
cmake_minimum_required(VERSION 3.3)
|
|
|
|
|
cmake_policy(VERSION 3.0.2..3.7)
|
|
|
|
|
|
|
|
|
|
# Название проекта
|
2019-02-20 20:23:13 +00:00
|
|
|
|
project(cmex VERSION 0.2.2 LANGUAGES C CXX)
|
2019-02-12 16:37:35 +00:00
|
|
|
|
|
2019-02-13 00:19:11 +00:00
|
|
|
|
# В каталоге cmake/lib находятся файлы с библиотечными функциями
|
2019-02-12 16:42:59 +00:00
|
|
|
|
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()
|
2019-02-14 18:57:18 +00:00
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/find)
|
2019-02-12 16:42:59 +00:00
|
|
|
|
|
|
|
|
|
include(CMLibCommon)
|
|
|
|
|
|
2019-02-12 17:09:51 +00:00
|
|
|
|
# Поиск библиотек с помощью pkgconfig
|
|
|
|
|
find_package(PkgConfig)
|
|
|
|
|
pkg_check_modules(GSL REQUIRED gsl)
|
|
|
|
|
pkg_check_modules(FFTW3 REQUIRED fftw3)
|
|
|
|
|
|
2019-02-12 17:16:26 +00:00
|
|
|
|
# Поиск библиотек и приложений с помощью функции find_package
|
|
|
|
|
find_package(LibXml2)
|
|
|
|
|
find_package(CURL)
|
|
|
|
|
|
2019-02-12 17:16:58 +00:00
|
|
|
|
# Поиск библиотеки с помощью функции find_library
|
|
|
|
|
find_library(MATHGL mgl PATHS /usr/lib /usr/lib/x86_64-linux-gnu)
|
|
|
|
|
find_library(MATHGLQT5 mgl-qt5 PATHS /usr/lib /usr/lib/x86_64-linux-gnu)
|
|
|
|
|
|
2019-02-12 17:33:07 +00:00
|
|
|
|
# Qt5
|
|
|
|
|
find_package(Qt5 COMPONENTS Core Network Gui Widgets DBus Concurrent Sql REQUIRED)
|
|
|
|
|
|
2019-02-12 17:33:53 +00:00
|
|
|
|
# Автоматически генерируемый заголовочный файл
|
|
|
|
|
cmlib_config_hpp_generate()
|
|
|
|
|
|
2019-02-12 21:53:51 +00:00
|
|
|
|
# Подключение внешних проектов
|
|
|
|
|
include(ExternalProject)
|
|
|
|
|
|
|
|
|
|
ExternalProject_Add(cmext
|
|
|
|
|
EXCLUDE_FROM_ALL TRUE
|
|
|
|
|
SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/libcmext
|
|
|
|
|
INSTALL_DIR ${CMAKE_BINARY_DIR}
|
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
|
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libcmext.a
|
|
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_BUILD_TYPE=Release
|
|
|
|
|
)
|
|
|
|
|
|
2019-02-12 19:00:28 +00:00
|
|
|
|
# Библиотека
|
|
|
|
|
add_subdirectory(src/libcmex)
|
|
|
|
|
|
2019-02-12 19:23:41 +00:00
|
|
|
|
# Приложение
|
|
|
|
|
add_subdirectory(src/cmex)
|
|
|
|
|
|