Make cmake work on windows
This commit is contained in:
+22
-1
@@ -5,7 +5,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
project(libsdlpp)
|
||||
|
||||
add_library(sdlpp STATIC
|
||||
list(APPEND SDLPPFiles
|
||||
sdlpp_circlecolider.cpp
|
||||
sdlpp_circlerenderer.cpp
|
||||
sdlpp_collision.cpp
|
||||
@@ -23,3 +23,24 @@ add_library(sdlpp STATIC
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user