Fix #2621: Set CMP0054 policy to NEW and appropriately quote ${PLATFORM} (#2622)

This commit is contained in:
archie2x
2022-08-09 00:52:56 -07:00
committed by GitHub
parent b0f3a2c217
commit e87caa2687
3 changed files with 32 additions and 20 deletions

View File

@ -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)