Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindSDL2.cmake is obsolete, please rely on the CMake config-file package #23

Closed
apoleon opened this issue Feb 27, 2020 · 1 comment
Closed

Comments

@apoleon
Copy link

apoleon commented Feb 27, 2020

blockattack has a FindSDL2.cmake "find-module". Blockattack assumes that the CFLAGS necessary to find SDL.h are also sufficient to find SDL_mixer.h. This will cause a build failure when this assumption is not true. I am attaching a patch by Simon McVittie that solves the problem.

Blockattack should ideally also drop FindSDL2.cmake and rely on the
CMake support in SDL2 >= 2.0.4 (it is now a "config-file package" in CMake
terminology), similar to JACoders/OpenJK#1033.

This is Debian bug https://bugs.debian.org/951943

Patch:

From: Simon McVittie smcv@debian.org
Date: Sun, 23 Feb 2020 14:28:29 +0000
Subject: build: Add include directories for all SDL2_foo modules

The build system assumed that SDL2 and all the SDL2_foo libraries were
installed with the same ${includedir}, but this is not guaranteed:
we could be using a system copy of SDL2 in conjunction with SDL2_foo
libraries in a non-standard prefix.

This also fixes a build regression with recent Debian SDL2 packages, in
which the SDL2 headers are installed in an architecture-dependent
directory but the SDL2_foo headers are not.

Signed-off-by: Simon McVittie smcv@debian.org
Bug-Debian: https://bugs.debian.org/951943

CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4d7644..91bdcbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,8 +60,11 @@ include_directories(${SDL2_INCLUDE_DIR})
#Setup things that use pkg-config
find_package(PkgConfig REQUIRED)
pkg_search_module(SDL2MIXER REQUIRED SDL2_mixer)
+include_directories(${SDL2MIXER_INCLUDE_DIRS})
pkg_search_module(SDL2IMAGE REQUIRED SDL2_image)
+include_directories(${SDL2IMAGE_INCLUDE_DIRS})
pkg_search_module(SDL2TTF REQUIRED SDL2_ttf)
+include_directories(${SDL2TTF_INCLUDE_DIRS})

find_package(Boost COMPONENTS program_options REQUIRED)

sago007 added a commit that referenced this issue Aug 15, 2020
@sago007
Copy link
Member

sago007 commented Jan 11, 2022

Ubuntu 16.04 is no longer supported, so FindSDL2.cmake is no longer needed.

This was done in commit: 00a2e90

I am closing this issue.

@sago007 sago007 closed this as completed Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants