myx-cmake/MyxCMake/MyxCMakeConfig.cmake

55 lines
1.9 KiB
CMake
Raw Normal View History

2021-12-08 11:32:04 +00:00
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # IN_LIST operator
get_filename_component(MYX_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
set(MYX_CMAKE_FUNCTIONS_DIR "${MYX_CMAKE_DIR}/functions")
if(NOT IS_DIRECTORY "${MYX_CMAKE_FUNCTIONS_DIR}")
2021-12-21 10:45:09 +00:00
myx_cmake_message_warning("MyxCMake: Functions directory is not found.")
2021-12-08 11:32:04 +00:00
else()
if(NOT ${MYX_CMAKE_FUNCTIONS_DIR} IN_LIST CMAKE_MODULE_PATH)
list(INSERT CMAKE_MODULE_PATH 0 "${MYX_CMAKE_FUNCTIONS_DIR}")
endif()
endif()
set(MYX_CMAKE_THIRDPARTY_DIR "${MYX_CMAKE_DIR}/thirdparty")
if(NOT IS_DIRECTORY "${MYX_CMAKE_THIRDPARTY_DIR}")
2021-12-21 10:45:09 +00:00
myx_cmake_message_warning("MyxCMake: Thirdparty submodule is not found.")
2021-12-08 11:32:04 +00:00
else()
if(NOT ${MYX_CMAKE_THIRDPARTY_DIR} IN_LIST CMAKE_MODULE_PATH)
list(INSERT CMAKE_MODULE_PATH 0 "${MYX_CMAKE_THIRDPARTY_DIR}")
endif()
endif()
set(MYX_CMAKE_SANITIZERS_DIR "${MYX_CMAKE_DIR}/sanitizers")
if(NOT IS_DIRECTORY "${MYX_CMAKE_SANITIZERS_DIR}")
2021-12-21 10:45:09 +00:00
myx_cmake_message_warning(STATUS "MyxCMake: Sanitizers submodule is not found.")
2021-12-08 11:32:04 +00:00
else()
if(NOT ${MYX_CMAKE_SANITIZERS_DIR} IN_LIST CMAKE_MODULE_PATH)
list(INSERT CMAKE_MODULE_PATH 0 "${MYX_CMAKE_SANITIZERS_DIR}")
find_package(Sanitizers)
endif()
endif()
set(MYX_CMAKE_FIND_DIR "${MYX_CMAKE_DIR}/find")
if(NOT IS_DIRECTORY "${MYX_CMAKE_FIND_DIR}")
2021-12-21 10:45:09 +00:00
myx_cmake_message_warning("MyxCMake: Custom find submodules are not found.")
2021-12-08 11:32:04 +00:00
else()
if(NOT ${MYX_CMAKE_FIND_DIR} IN_LIST CMAKE_MODULE_PATH)
list(INSERT CMAKE_MODULE_PATH 0 "${MYX_CMAKE_FIND_DIR}")
endif()
endif()
set(MYX_CMAKE_MODULES_DIR "${MYX_CMAKE_DIR}/modules")
if(NOT IS_DIRECTORY "${MYX_CMAKE_MODULES_DIR}")
2021-12-21 10:45:09 +00:00
myx_cmake_message_error("MyxCMake: Requried modules directory is not found.")
2021-12-08 11:32:04 +00:00
else()
if(NOT ${MYX_CMAKE_MODULES_DIR} IN_LIST CMAKE_MODULE_PATH)
list(INSERT CMAKE_MODULE_PATH 0 "${MYX_CMAKE_MODULES_DIR}")
endif()
endif()
include(MyxCMakeCommon)
cmake_policy(POP)