Fix the include path in the installed CMake target import file
authorBastien Bouclet <bastien.bouclet@gmail.com>
Wed, 11 Apr 2018 06:16:23 +0200
changeset 119414d843a32d74e
parent 11940 bfb936894a9d
child 11942 2ad9729d3975
Fix the include path in the installed CMake target import file

Previously the include path was {INSTALL_PREFIX}/include,
it is now {INSTALL_PREFIX}/include/SDL2 to be consistent with
the other build and package configuration systems.

Fixes #4128.
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Tue Apr 10 08:03:54 2018 -0700
     1.2 +++ b/CMakeLists.txt	Wed Apr 11 06:16:23 2018 +0200
     1.3 @@ -1695,7 +1695,7 @@
     1.4  
     1.5  # Always build SDLmain
     1.6  add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
     1.7 -target_include_directories(SDL2main PUBLIC $<INSTALL_INTERFACE:include>)
     1.8 +target_include_directories(SDL2main PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
     1.9  set(_INSTALL_LIBS "SDL2main")
    1.10  if (NOT ANDROID)
    1.11    set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
    1.12 @@ -1724,7 +1724,7 @@
    1.13    endif()
    1.14    set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
    1.15    target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
    1.16 -  target_include_directories(SDL2 PUBLIC $<INSTALL_INTERFACE:include>)
    1.17 +  target_include_directories(SDL2 PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
    1.18    if (NOT ANDROID)
    1.19      set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
    1.20    endif()
    1.21 @@ -1750,7 +1750,7 @@
    1.22    # libraries - do we need to consider this?
    1.23    set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
    1.24    target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
    1.25 -  target_include_directories(SDL2-static PUBLIC $<INSTALL_INTERFACE:include>)
    1.26 +  target_include_directories(SDL2-static PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
    1.27    if (NOT ANDROID)
    1.28      set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
    1.29    endif()