game/sdlpp/CMakeLists.txt

47 lines
1.2 KiB
CMake
Raw Normal View History

2021-08-05 15:55:55 +00:00
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(libsdlpp)
2021-08-05 17:16:12 +00:00
list(APPEND SDLPPFiles
2021-08-05 15:55:55 +00:00
sdlpp_circlecolider.cpp
sdlpp_circlerenderer.cpp
sdlpp_collision.cpp
sdlpp_common.cpp
sdlpp_font.cpp
sdlpp_linerenderer.cpp
sdlpp_rectcolider.cpp
sdlpp_rectrenderer.cpp
sdlpp_renderer.cpp
sdlpp_renderobject.cpp
sdlpp_scene.cpp
sdlpp_textrenderer.cpp
sdlpp_texture.cpp
sdlpp_window.cpp
sdlpp_fontconfiguration.cpp
sdlpp_mouse.cpp
)
2021-08-05 17:16:12 +00:00
if(WIN32)
add_library(sdlpp SHARED
${SDLPPFiles}
)
add_library(SDL2 STATIC IMPORTED)
set_target_properties(SDL2 PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/SDL2.lib)
add_library(SDL2_ttf STATIC IMPORTED)
set_target_properties(SDL2_ttf PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/SDL2_ttf.lib)
add_library(SDL2_image STATIC IMPORTED)
set_target_properties(SDL2_image PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/SDL2_image.lib)
target_link_libraries(sdlpp SDL2 SDL2_ttf SDL2_image)
target_compile_definitions(sdlpp PUBLIC DLLEXPORT)
else()
add_library(sdlpp STATIC
${SDLPPFiles}
)
endif()