File: 10_sfmlconfig_policy.patch

package info (click to toggle)
libsfml 3.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 13,704 kB
  • sloc: cpp: 52,754; ansic: 24,944; objc: 668; sh: 172; xml: 25; makefile: 18
file content (24 lines) | stat: -rw-r--r-- 971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Set cmake_policy in SFMLConfig.cmake
 `SFMLConfig.cmake` uses the `if(... IN_LIST` feature which requires
 policy `CMP0057` to be enabled (added in CMake 3.3). If an application
 uses `find_package(SFML)` with a minimum CMake version set to less
 than `3.3`, the `IN_LIST` lines cause a CMake error.
 .
 Fix this by setting the minimum CMake policy we require in
 `SFMLConfig.cmake`. CMake keeps a policy stack so this does not affect
 the application's policy.
Author: James Cowgill <jcowgill@debian.org>
Forwarded: https://github.com/SFML/SFML/pull/3511
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/cmake/SFMLConfig.cmake.in
+++ b/cmake/SFMLConfig.cmake.in
@@ -63,6 +63,8 @@
 #   add_executable(myapp ...)
 #   target_link_libraries(myapp PRIVATE SFML::Graphics SFML::Audio)
 
+cmake_policy(VERSION 3.22...3.31)
+
 if(NOT SFML_FIND_COMPONENTS)
     message(FATAL_ERROR "find_package(SFML) called with no component")
 endif()