mirror of
https://github.com/encounter/SDL.git
synced 2025-12-10 05:57:44 +00:00
cmake: Prefix all options with "SDL_"
This makes it clear which options came from SDL's CMake project when building SDL as a subdirectory of a parent CMake project. Fixes #4139.
This commit is contained in:
@@ -42,12 +42,18 @@ macro(MESSAGE_TESTED_OPTION _NAME)
|
||||
if(${ARGC} EQUAL 2)
|
||||
set(_PAD ${ARGV1})
|
||||
endif()
|
||||
if(NOT HAVE_${_NAME})
|
||||
set(HAVE_${_NAME} OFF)
|
||||
elseif("${HAVE_${_NAME}}" MATCHES "1|TRUE|YES|Y")
|
||||
set(HAVE_${_NAME} ON)
|
||||
string(SUBSTRING "${_NAME}" 0 4 _NAMESTART)
|
||||
if(_NAMESTART STREQUAL "SDL_")
|
||||
string(SUBSTRING "${_NAME}" 4 -1 _STRIPPEDNAME)
|
||||
else()
|
||||
set(_STRIPPEDNAME "${_NAME}")
|
||||
endif()
|
||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_NAME}}")
|
||||
if(NOT HAVE_${_STRIPPEDNAME})
|
||||
set(HAVE_${_STRIPPEDNAME} OFF)
|
||||
elseif("${HAVE_${_STRIPPEDNAME}}" MATCHES "1|TRUE|YES|Y")
|
||||
set(HAVE_${_STRIPPEDNAME} ON)
|
||||
endif()
|
||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
||||
endmacro()
|
||||
|
||||
macro(LISTTOSTR _LIST _OUTPUT)
|
||||
|
||||
Reference in New Issue
Block a user