From 0b41a1b963cc08a50ceef701314ec08173acfe64 Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Mon, 29 Apr 2024 21:52:42 +0200 Subject: [PATCH] CMake: expose BUILD_TESTNG option, rename LOGGER to ENABLE_LOGGER --- CMakeLists.txt | 9 +++++---- README.md | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4a1fb9b..9362aac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,8 @@ project(Descent3 ) option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with ninja)." OFF) -option(LOGGER "Enable logging to the terminal" OFF) +option(ENABLE_LOGGER "Enable logging to the terminal" OFF) +option(BUILD_TESTING "Enable testing. Requires GTest." OFF) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -23,9 +24,9 @@ if(FORCE_COLORED_OUTPUT) set(CMAKE_COLOR_DIAGNOSTICS ON) else() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options (-fdiagnostics-color=always) + add_compile_options(-fdiagnostics-color=always) elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options (-fcolor-diagnostics) + add_compile_options(-fcolor-diagnostics) endif() endif() endif() @@ -134,7 +135,7 @@ add_compile_definitions($<$:_DEBUG>) find_package(ZLIB REQUIRED) -if(LOGGER) +if(ENABLE_LOGGER) message("Enabling Logging") add_compile_definitions(LOGGER) endif() diff --git a/README.md b/README.md index 0f7a2090..b49bd3d7 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,14 @@ setx PATH=%VCPKG_ROOT%;%PATH% Build Descent 3: ```sh -cmake --preset win -D LOGGER=[ON|OFF] +cmake --preset win -D ENABLE_LOGGER=[ON|OFF] cmake --build --preset win --config [Debug|Release] ``` #### Building - MacOS ```sh brew bundle install -cmake --preset mac -D LOGGER=[ON|OFF] +cmake --preset mac -D ENABLE_LOGGER=[ON|OFF] cmake --build --preset mac --config [Debug|Release] ``` @@ -53,7 +53,7 @@ cmake --build --preset mac --config [Debug|Release] sudo dpkg --add-architecture i386 sudo apt update sudo apt install -y --no-install-recommends ninja-build cmake g++ libsdl1.2-dev libsdl-image1.2-dev libncurses-dev libxext6:i386 zlib1g-dev -cmake --preset linux -D LOGGER=[ON|OFF] +cmake --preset linux -D ENABLE_LOGGER=[ON|OFF] cmake --build --preset linux --config [Debug|Release] ```