Fixed bug 4594 - Fix install location of CMake targets on Apple platforms
authorSam Lantinga
Sat, 08 Jun 2019 14:34:38 -0700
changeset 1279174a69d4d9e9a
parent 12790 5196f7a4d659
child 12792 4063a5ebe39b
Fixed bug 4594 - Fix install location of CMake targets on Apple platforms

tschwinger

Followup to #3651

As already noted by Ryan, no framework is being built, so we better install to lib/cmake.

That code was originally part of a patch submitted by David Demelier, whose credit BTW got lost (I combined his patch for #3572 with fixes for #2576 and #3613 resulting in #3651 because things started to depend on another).

I tested that the configuration files are found correctly in the new location on MacOS X based on a hint to the root (see https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure).
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Sat Jun 08 14:32:19 2019 -0700
     1.2 +++ b/CMakeLists.txt	Sat Jun 08 14:34:38 2019 -0700
     1.3 @@ -1831,9 +1831,7 @@
     1.4    RUNTIME DESTINATION bin)
     1.5  
     1.6  ##### Export files #####
     1.7 -if (APPLE)
     1.8 -  set(PKG_PREFIX "SDL2.framework/Resources")
     1.9 -elseif (WINDOWS)
    1.10 +if (WINDOWS)
    1.11    set(PKG_PREFIX "cmake")
    1.12  else ()
    1.13    set(PKG_PREFIX "lib/cmake/SDL2")