mirror of https://github.com/libsdl-org/SDL
cmake: assume autotools static libraries with lib prefix and .a suffix
This commit is contained in:
parent
4f94da5c53
commit
20c2fa18fe
|
@ -64,7 +64,7 @@ if(_sdl2_libraries MATCHES ".*SDL2main.*")
|
|||
list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main)
|
||||
endif()
|
||||
|
||||
set(_sdl2main_library ${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(_sdl2main_library ${SDL2_LIBDIR}/libSDL2main.a)
|
||||
if(EXISTS "${_sdl2main_library}")
|
||||
set(SDL2MAIN_LIBRARY SDL2::SDL2main)
|
||||
if(NOT TARGET SDL2::SDL2main)
|
||||
|
@ -103,8 +103,8 @@ set(_sdl2_link_libraries ${_sdl2_libraries})
|
|||
list(REMOVE_ITEM _sdl2_link_libraries SDL2 SDL2main mingw32 cygwin)
|
||||
|
||||
if(WIN32)
|
||||
set(_sdl2_implib "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set(_sdl2_dll "${SDL2_BINDIR}/SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set(_sdl2_implib "${SDL2_LIBDIR}/libSDL2.dll.a")
|
||||
set(_sdl2_dll "${SDL2_BINDIR}/SDL2.dll")
|
||||
if(EXISTS "${_sdl2_implib}" AND EXISTS "${_sdl2_dll}")
|
||||
if(NOT TARGET SDL2::SDL2)
|
||||
add_library(SDL2::SDL2 SHARED IMPORTED)
|
||||
|
@ -124,7 +124,7 @@ if(WIN32)
|
|||
unset(_sdl2_implib)
|
||||
unset(_sdl2_dll)
|
||||
else()
|
||||
set(_sdl2_shared "${SDL2_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set(_sdl2_shared "${SDL2_LIBDIR}/libSDL2${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
if(EXISTS "${_sdl2_shared}")
|
||||
if(NOT TARGET SDL2::SDL2)
|
||||
add_library(SDL2::SDL2 SHARED IMPORTED)
|
||||
|
@ -143,7 +143,7 @@ else()
|
|||
unset(_sdl2_shared)
|
||||
endif()
|
||||
|
||||
set(_sdl2_static "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set(_sdl2_static "${SDL2_LIBDIR}/libSDL2.a")
|
||||
if(EXISTS "${_sdl2_static}")
|
||||
if(NOT TARGET SDL2::SDL2-static)
|
||||
add_library(SDL2::SDL2-static STATIC IMPORTED)
|
||||
|
@ -164,7 +164,7 @@ unset(_sdl2_static)
|
|||
|
||||
unset(_sdl2_link_libraries)
|
||||
|
||||
set(_sdl2test_library "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_test${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set(_sdl2test_library "${SDL2_LIBDIR}/libSDL2_test.a")
|
||||
if(EXISTS "${_sdl2test_library}")
|
||||
if(NOT TARGET SDL2::SDL2test)
|
||||
add_library(SDL2::SDL2test STATIC IMPORTED)
|
||||
|
|
Loading…
Reference in New Issue