cmake: check if CMP0087 exists before setting it (#8613)

Fixes builds using < CMake 3.14
This commit is contained in:
CasualPokePlayer 2023-11-25 13:42:55 -08:00 committed by GitHub
parent 4339647d90
commit 0fb36f29a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,7 +126,9 @@ if(CMAKE_VERSION VERSION_LESS 3.13.0)
endif()
# CMP0087: install(CODE) and install(SCRIPT) support generator expressions.
cmake_policy(SET CMP0087 NEW)
if(POLICY CMP0087)
cmake_policy(SET CMP0087 NEW)
endif()
function(SDL_install_pdb TARGET DIRECTORY)
get_property(type TARGET ${TARGET} PROPERTY TYPE)
if(type MATCHES "^(SHARED_LIBRARY|EXECUTABLE)$")