mirror of
https://github.com/glfw/glfw.git
synced 2024-11-14 02:31:46 +00:00
Simplify CMake if-statement variable references
Variables in CMake if-statements (and only in if-statements) do not need to be explicitly dereferenced; a thing I did not always know.
This commit is contained in:
parent
d7b7c3b12a
commit
daed5edd6e
@ -23,18 +23,18 @@ endif()
|
|||||||
|
|
||||||
file(STRINGS "${source_path}" lines)
|
file(STRINGS "${source_path}" lines)
|
||||||
foreach(line ${lines})
|
foreach(line ${lines})
|
||||||
if ("${line}" MATCHES "^[0-9a-fA-F].*$")
|
if (line MATCHES "^[0-9a-fA-F].*$")
|
||||||
if ("${line}" MATCHES "platform:Windows")
|
if (line MATCHES "platform:Windows")
|
||||||
if (GLFW_WIN32_MAPPINGS)
|
if (GLFW_WIN32_MAPPINGS)
|
||||||
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\n")
|
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\n")
|
||||||
endif()
|
endif()
|
||||||
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\"${line}\",")
|
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\"${line}\",")
|
||||||
elseif ("${line}" MATCHES "platform:Mac OS X")
|
elseif (line MATCHES "platform:Mac OS X")
|
||||||
if (GLFW_COCOA_MAPPINGS)
|
if (GLFW_COCOA_MAPPINGS)
|
||||||
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\n")
|
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\n")
|
||||||
endif()
|
endif()
|
||||||
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\"${line}\",")
|
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\"${line}\",")
|
||||||
elseif ("${line}" MATCHES "platform:Linux")
|
elseif (line MATCHES "platform:Linux")
|
||||||
if (GLFW_LINUX_MAPPINGS)
|
if (GLFW_LINUX_MAPPINGS)
|
||||||
set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\n")
|
set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\n")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user