testdiff2/SpiriQGC/libs/sdl2/CMakeLists.txt
2023-12-21 08:03:49 -05:00

16 lines
831 B
CMake

set(SDL2_LIB_BASE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/msvc/lib)
add_library(sdl2 SHARED IMPORTED GLOBAL)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bits
set(SDL2_LIB_BASE_PATH ${SDL2_LIB_BASE_PATH}/x64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
set(SDL2_LIB_BASE_PATH ${SDL2_LIB_BASE_PATH}/x86)
endif()
target_link_libraries(sdl2 INTERFACE ${SDL2_LIB_BASE_PATH}/SDL2.lib)
target_include_directories(sdl2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/msvc/include)
set_property(TARGET sdl2 PROPERTY IMPORTED_IMPLIB_RELEASE "${SDL2_LIB_BASE_PATH}/SDL2.lib")
set_property(TARGET sdl2 PROPERTY IMPORTED_LOCATION_RELEASE "${SDL2_LIB_BASE_PATH}/SDL2.dll")
set_property(TARGET sdl2 PROPERTY IMPORTED_IMPLIB_DEBUG "${SDL2_LIB_BASE_PATH}/SDL2.lib")
set_property(TARGET sdl2 PROPERTY IMPORTED_LOCATION_DEBUG "${SDL2_LIB_BASE_PATH}/SDL2.dll")