From 04f7422552e397187c9c8d237f67b978ab8a8ab6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 19 Aug 2014 21:13:07 -0700 Subject: [PATCH] Fixed bug 2691 - Disabling shared library prevent cmake configuration hotgloupi Configuring using "cmake -DSDL_STATIC=1 -DSDL_SHARED=0" generate and error in CMakeLists.txt at line 1334: CMake Error at CMakeLists.txt:1334 (install): install TARGETS given target "SDL2" which does not exist in this directory. This install rule shouldn't be present when the DLL has been disabled --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fc2b396f8448..bbcb87b1fb75a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1331,7 +1331,9 @@ if(NOT WINDOWS OR CYGWIN) # TODO: what about the .spec file? Is it only needed for RPM creation? install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") else() - install(TARGETS SDL2 RUNTIME DESTINATION bin) + if(SDL_SHARED) + install(TARGETS SDL2 RUNTIME DESTINATION bin) + endif() endif() ##### Uninstall target #####