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) list(APPEND SDLPPFiles 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 ) 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()