summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorarchie2x <[email protected]>2022-08-09 00:52:56 -0700
committerGitHub <[email protected]>2022-08-09 09:52:56 +0200
commite87caa268784e8947f76bf3f6b45699553337709 (patch)
tree3d18ef872e90f9bff290d2cb3ee006ef0fecb996 /CMakeLists.txt
parentb0f3a2c217a0f5cc775b8d249c3c508d2c6a1c12 (diff)
downloadraylib-e87caa268784e8947f76bf3f6b45699553337709.tar.gz
raylib-e87caa268784e8947f76bf3f6b45699553337709.zip
Fix #2621: Set CMP0054 policy to NEW and appropriately quote ${PLATFORM} (#2622)
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fe826df..be978d1f 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,18 @@
cmake_minimum_required(VERSION 3.0)
project(raylib)
+# Avoid excessive expansion of variables in conditionals. In particular, if
+# "PLATFORM" is "DRM" than:
+#
+# if (${PLATFORM} MATCHES "DRM")
+#
+# may expand e.g to:
+#
+# if (/usr/lib/aarch64-linux-gnu/libdrm.so MATCHES "DRM")
+#
+# See https://cmake.org/cmake/help/latest/policy/CMP0054.html
+cmake_policy(SET CMP0054 NEW)
+
# Directory for easier includes
# Anywhere you see include(...) you can check <root>/cmake for that file
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)