Fixed bug 2691 - Disabling shared library prevent cmake configuration
authorSam Lantinga <slouken@libsdl.org>
Tue, 19 Aug 2014 21:13:07 -0700
changeset 909361d1cd95698e
parent 9092 8110b8a073f6
child 9094 65a23b7b43c7
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
     1.1 --- a/CMakeLists.txt	Mon Aug 18 18:44:08 2014 -0700
     1.2 +++ b/CMakeLists.txt	Tue Aug 19 21:13:07 2014 -0700
     1.3 @@ -1331,7 +1331,9 @@
     1.4    # TODO: what about the .spec file? Is it only needed for RPM creation?
     1.5    install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal")
     1.6  else()
     1.7 -  install(TARGETS SDL2 RUNTIME DESTINATION bin)
     1.8 +  if(SDL_SHARED)
     1.9 +    install(TARGETS SDL2 RUNTIME DESTINATION bin)
    1.10 +  endif()
    1.11  endif()
    1.12  
    1.13  ##### Uninstall target #####