From efba50c83c73ac770851c2c12b1a26e0df6f8511 Mon Sep 17 00:00:00 2001
From: mazmazz <mar.marcoz@outlook.com>
Date: Sun, 7 Jun 2020 23:57:15 -0400
Subject: [PATCH] CMAKE: Add SRB2_DEBUG_INSTALL to toggle *.debug in
 install/package

---
 src/sdl/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt
index 1e3d0f7a6a..481f1a426f 100644
--- a/src/sdl/CMakeLists.txt
+++ b/src/sdl/CMakeLists.txt
@@ -295,10 +295,13 @@ if(${SDL2_FOUND})
 			RUNTIME DESTINATION .
 		)
 		if ((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo))
-			install(FILES $<TARGET_FILE:SRB2SDL2>.debug
-				DESTINATION .
-				OPTIONAL
-			)
+			set(SRB2_DEBUG_INSTALL OFF CACHE BOOL "Insert *.debug file into the install directory or package.")
+			if (${SRB2_DEBUG_INSTALL})
+				install(FILES $<TARGET_FILE:SRB2SDL2>.debug
+					DESTINATION .
+					OPTIONAL
+				)
+			endif()
 		endif()
 	endif()
 
-- 
GitLab