We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3862 - Install is broken when adding SDL2 to an existing CMake project
Summary: Install is broken when adding SDL2 to an existing CMake project
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 2.0.6
Hardware: x86 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-05 04:56 UTC by Steve Robinson
Modified: 2017-10-06 23:42 UTC (History)
0 users

See Also:


Attachments
Patched SDL2 CMakeLists.txt file (61.26 KB, text/plain)
2017-10-05 04:56 UTC, Steve Robinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Robinson 2017-10-05 04:56:37 UTC
Created attachment 2967 [details]
Patched SDL2 CMakeLists.txt file

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

I've attached a copy of the CMakeLists.txt file with the change.
Comment 1 Sam Lantinga 2017-10-06 23:42:53 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/3a026cc340a7