Skip to content

Commit 9670949

Browse files
committed
Change root CMakeLists, add RSP_ENABLE_ANSI output option
Project will now enable or disable ANSI output, depending on the option. Defaults to false.
1 parent 093bc03 commit 9670949

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
cmake_minimum_required(VERSION 3.30)
66

77
option(RSP_CMAKE_SCRIPTS_BUILD_TESTS "Build tests for the RSP CMake Scripts project" off)
8+
option(RSP_ENABLE_ANSI "Enable ANSI output" false)
89

910
# -------------------------------------------------------------------------------------------------------------- #
1011
# Setup
@@ -65,17 +66,25 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
6566
include("dev-dependencies.cmake")
6667
endif()
6768

69+
# -------------------------------------------------------------------------------------------------------------- #
70+
# Toggle ANSI output
71+
# -------------------------------------------------------------------------------------------------------------- #
72+
73+
include("rsp/output")
74+
75+
if (RSP_ENABLE_ANSI)
76+
enable_ansi()
77+
else ()
78+
disable_ansi()
79+
endif ()
80+
6881
# -------------------------------------------------------------------------------------------------------------- #
6982
# Post-dependencies project setup
7083
# -------------------------------------------------------------------------------------------------------------- #
7184

7285
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
7386
include("rsp/debug")
74-
include("rsp/output")
7587
include("rsp/logging")
76-
77-
enable_ansi()
78-
# disable_ansi()
7988
endif()
8089

8190
# -------------------------------------------------------------------------------------------------------------- #
@@ -91,5 +100,13 @@ endif ()
91100
# Misc.
92101
# -------------------------------------------------------------------------------------------------------------- #
93102

103+
log(
104+
NOTICE_LEVEL "Assets build completed"
105+
CONTEXT
106+
CMAKE_BINARY_DIR
107+
PROJECT_NAME
108+
CMAKE_PROJECT_NAME
109+
)
110+
94111
# output_ansi_demo()
95112
# dump(CMAKE_MODULE_PATH FOO BAR PROJECT_NAME)

0 commit comments

Comments
 (0)