myx/MyxCMakeConfig.cmake
2022-09-29 02:46:29 +03:00

27 lines
1.0 KiB
CMake

cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # IN_LIST operator
get_filename_component(MYX_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
get_filename_component(PROJECT_CMAKE_DIR ${MYX_CMAKE_SOURCE_DIR} DIRECTORY)
if(NOT MYX_CMAKE_SOURCE_DIR STREQUAL "${PROJECT_SOURCE_DIR}/cmake/myx")
message(FATAL_ERROR "MyxCMake library should be placed in ${PROJECT_SOURCE_DIR}/cmake/myx directory")
endif()
set(MYX_CMAKE_BACKPORTS_DIR "${MYX_CMAKE_SOURCE_DIR}/backports")
set(MYX_CMAKE_LIB_DIR "${MYX_CMAKE_SOURCE_DIR}/lib")
include(${MYX_CMAKE_BACKPORTS_DIR}/IncludeGuard.cmake)
include(${MYX_CMAKE_BACKPORTS_DIR}/TopLevelProject.cmake)
if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
include(${MYX_CMAKE_BACKPORTS_DIR}/FetchContent.cmake)
endif()
include(${MYX_CMAKE_LIB_DIR}/ColoredMessages.cmake)
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)
cmake_policy(POP)