myx/MyxCMake/MyxCMakeConfig.cmake

77 lines
3.3 KiB
CMake
Raw Normal View History

2022-09-28 22:48:13 +00:00
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # IN_LIST operator
2022-10-24 17:03:42 +00:00
# CMake выполняет проверку системного окружения с помощью модулей,
# расположенных в следующих каталогах:
# /usr/share/cmake-${CMAKE_VERSION}/Modules
# /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/cmake
# /usr/lib/cmake
# Если для используемой программы или библиотеки нет стандартного
# модуля для поиска, то можно использовать собственный.
# С помощью переменной `CMAKE_MODULE_PATH` указывается перечень
# дополнительных каталогов, в которых производится поиск модулей.
2022-10-06 18:09:59 +00:00
set(MYX_CMAKE_FIND_DIR "${PROJECT_SOURCE_DIR}/cmake/find")
if(IS_DIRECTORY "${MYX_CMAKE_FIND_DIR}")
if(NOT ${MYX_CMAKE_FIND_DIR} IN_LIST CMAKE_MODULE_PATH)
list(INSERT CMAKE_MODULE_PATH 0 "${MYX_CMAKE_FIND_DIR}")
endif()
endif()
2022-10-01 20:34:07 +00:00
2022-09-28 22:48:13 +00:00
get_filename_component(MYX_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
2022-10-06 08:10:43 +00:00
set(MYX_CMAKE_BACKPORTS_DIR "${MYX_CMAKE_SOURCE_DIR}/backports")
set(MYX_CMAKE_LIB_DIR "${MYX_CMAKE_SOURCE_DIR}/lib")
2022-09-28 22:48:13 +00:00
2022-10-24 17:03:42 +00:00
# Модули для обеспечения обратной совместимости со старыми версиями CMake
2022-09-28 22:48:13 +00:00
include(${MYX_CMAKE_BACKPORTS_DIR}/IncludeGuard.cmake)
2024-03-18 21:16:53 +00:00
if(${CMAKE_VERSION} VERSION_LESS 3.11)
2022-09-28 22:48:13 +00:00
include(${MYX_CMAKE_BACKPORTS_DIR}/FetchContent.cmake)
2022-10-05 04:33:47 +00:00
else()
include(FetchContent)
2022-09-28 22:48:13 +00:00
endif()
2022-10-24 17:03:42 +00:00
# Загрузка стандартных модулей
2022-10-05 04:33:47 +00:00
include(GNUInstallDirs)
include(CMakeDependentOption)
2022-10-24 17:03:42 +00:00
# Полезные макросы
2022-10-05 04:33:47 +00:00
include(${MYX_CMAKE_LIB_DIR}/macro/CreateSymlink.cmake)
include(${MYX_CMAKE_LIB_DIR}/macro/FindPackages.cmake)
2023-08-01 08:21:33 +00:00
include(${MYX_CMAKE_LIB_DIR}/macro/FindQt.cmake)
2022-10-05 04:33:47 +00:00
include(${MYX_CMAKE_LIB_DIR}/macro/InstallRelative.cmake)
2022-10-06 23:49:02 +00:00
include(${MYX_CMAKE_LIB_DIR}/macro/CheckEnableCxxCompilerFlag.cmake)
2022-11-28 04:13:09 +00:00
include(${MYX_CMAKE_LIB_DIR}/macro/GTest.cmake)
2022-11-28 09:40:11 +00:00
include(${MYX_CMAKE_LIB_DIR}/macro/QTest.cmake)
2022-10-05 04:33:47 +00:00
2023-08-28 10:40:57 +00:00
include(${MYX_CMAKE_LIB_DIR}/ProjectIsTopLevel.cmake)
2022-10-06 23:49:02 +00:00
include(${MYX_CMAKE_LIB_DIR}/ColoredMessages.cmake)
2022-10-04 18:02:40 +00:00
include(${MYX_CMAKE_LIB_DIR}/PopulateCMakeBinaryDir.cmake)
2022-10-03 12:06:53 +00:00
include(${MYX_CMAKE_LIB_DIR}/CurrentDate.cmake)
2022-09-28 23:46:29 +00:00
include(${MYX_CMAKE_LIB_DIR}/NinjaGeneratorWarning.cmake)
include(${MYX_CMAKE_LIB_DIR}/DirectoriesGuards.cmake)
include(${MYX_CMAKE_LIB_DIR}/SemanticProjectVersion.cmake)
include(${MYX_CMAKE_LIB_DIR}/NinjaGeneratorWrapper.cmake)
include(${MYX_CMAKE_LIB_DIR}/DownloadContent.cmake)
2022-09-28 23:46:29 +00:00
2022-10-23 16:38:59 +00:00
include(${MYX_CMAKE_LIB_DIR}/Toolchains.cmake)
2022-10-05 11:57:56 +00:00
include(${MYX_CMAKE_LIB_DIR}/AddExecutable.cmake)
2022-10-19 11:39:26 +00:00
include(${MYX_CMAKE_LIB_DIR}/AddInterfaceLibrary.cmake)
include(${MYX_CMAKE_LIB_DIR}/AddObjectLibrary.cmake)
2022-09-29 14:54:13 +00:00
include(${MYX_CMAKE_LIB_DIR}/TargetSetup.cmake)
2023-08-01 08:21:33 +00:00
include(${MYX_CMAKE_LIB_DIR}/TargetSetupQt.cmake)
2022-09-29 10:34:57 +00:00
2022-10-06 12:14:38 +00:00
include(${MYX_CMAKE_LIB_DIR}/uncrustify/Uncrustify.cmake)
2022-10-04 14:24:08 +00:00
include(${MYX_CMAKE_LIB_DIR}/doc/Doxygen.cmake)
2022-10-02 20:34:32 +00:00
2022-10-03 12:06:53 +00:00
include(${MYX_CMAKE_LIB_DIR}/generators/PrivateConfigHeader.cmake)
2022-10-04 19:53:44 +00:00
include(${MYX_CMAKE_LIB_DIR}/generators/GitInfoHeader.cmake)
2022-10-03 12:06:53 +00:00
2022-10-09 01:23:55 +00:00
include(${MYX_CMAKE_LIB_DIR}/CreatePackages.cmake)
2022-10-06 13:15:46 +00:00
include(${MYX_CMAKE_LIB_DIR}/Uninstall.cmake)
unset(MYX_CMAKE_SOURCE_DIR)
unset(MYX_CMAKE_BACKPORTS_DIR)
unset(MYX_CMAKE_LIB_DIR)
2022-09-28 22:48:13 +00:00
cmake_policy(POP)