From 33fdb03334e5acef15b66f9651e00a649ea12aad Mon Sep 17 00:00:00 2001 From: flagarde Date: Wed, 8 May 2024 17:16:14 +0800 Subject: [PATCH] fix --- CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 531d391..586983a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,26 +1,27 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -option(BUILD_DOCS "Build the docs" ON) -option(BUILD_TESTS "Build the tests" ON) +option(KHAOS_BUILD_DOCS "Build the docs" ON) +option(KHAOS_BUILD_TESTS "Build the tests" ON) -if(BUILD_DOCS OR BUILD_TESTS) - include(GetCMakeMM) - cmmm(VERSION 2.3 REPOSITORY flagarde/CMakeMM) - - cmmm_modules_list(REPOSITORY flagarde/CMakeCM) +if(KHAOS_BUILD_DOCS OR KHAOS_BUILD_TESTS) + include(FetchContent) + FetchContent_Declare(CMMM GIT_REPOSITORY "https://github.com/cmake-tools/cmmm.git" GIT_TAG "v1.0") + FetchContent_MakeAvailable(CMMM) + cmmm() + cmmm_modules_list(URL "https://raw.githubusercontent.com/flagarde/CMakeCM/main/ModulesList.cmake") endif() project(Khaos VERSION 0.0.1.0 DESCRIPTION "A C/C++ library to simplify cross-platform programming" HOMEPAGE_URL "https://github.com/flagarde/Khaos" LANGUAGES C CXX) add_subdirectory(src) -if(BUILD_DOCS) +if(KHAOS_BUILD_DOCS) add_subdirectory(docs) endif() -if(BUILD_TESTS) +if(KHAOS_BUILD_TESTS) enable_testing() add_subdirectory(tests) endif()