From 827e9850414feb8552de73f005bb2439b9664710 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 6 Oct 2017 16:42:43 -0700 Subject: [PATCH] Fixed bug 3862 - Install is broken when adding SDL2 to an existing CMake project Steve Robinson In my existing CMake project, I use add_subdirectory to add the source for SDL2. This worked fine in 2.0.5, but now in 2.0.6 when I build the INSTALL CMake target, I get this error: file INSTALL cannot find "D:/path/to/SDL2Config.cmake". Call Stack (most recent call first): 3rdparty/SDL2/cmake_install.cmake:32 (include) 3rdparty/cmake_install.cmake:36 (include) cmake_install.cmake:32 (include) To fix this, I changed line 1770 from this: ${CMAKE_SOURCE_DIR}/SDL2Config.cmake To this: ${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33a3f6c5c..9d363aec0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1767,7 +1767,7 @@ install(EXPORT SDL2Targets ) install( FILES - ${CMAKE_SOURCE_DIR}/SDL2Config.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake ${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake DESTINATION ${PKG_PREFIX} COMPONENT Devel