This commit is contained in:
Martin Slachta
2026-07-18 14:31:15 +02:00
commit a04f0dc262
3343 changed files with 1140208 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# Reusable option macros for CMake projects
#
# Usage:
# set_option(OPTION_NAME "Help text" ON/OFF) - for boolean options
# set_option_value(VAR_NAME "Help text" "value") - for value options (CACHE STRING)
# Boolean options (ON/OFF)
macro(set_option option help value)
option(${option} ${help} ${value})
if(${option})
message(STATUS "${option}: ON")
else()
message(STATUS "${option}: OFF")
endif()
endmacro()
# Value options (strings, numbers, etc.)
macro(set_option_value var help default)
set(${var} ${default} CACHE STRING "${help}")
if(${var})
message(STATUS "${var}: ${${var}}")
else()
message(STATUS "${var}: (not set)")
endif()
endmacro()