Added SDL dependencies as Git submodules

This commit is contained in:
abdelrahman committed 2022-09-08 23:44:36 +01:00
1 parent 9cd658a1d3
commit d402e0da04
10 files changed
+95

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.10)
project(Engine)
# VARIABLES
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(BUILD_SHARED_LIBS ON)
if(CMAKE_HOST_WIN32)
# Export both *.lib and *.dll on Windows
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
set(CMAKE_INSTALL_BINDIR bin)
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_INCLUDEDIR include)
set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../lib")
# TARGETS
add_library(${PROJECT_NAME} SHARED src/engine.c)
target_include_directories(${PROJECT_NAME} PUBLIC
include
extern/SDL2/SDL/include
extern/SDL2/SDL_mixer/include
extern/SDL2/SDL_image
extern/SDL2/SDL_ttf
)
target_link_libraries(${PROJECT_NAME} PUBLIC
SDL2
SDL2_image
SDL2_mixer
SDL2_ttf
)
install(TARGETS ${PROJECT_NAME}
CONFIGURATIONS Release
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# SUB-DIRECTORIES
add_subdirectory(extern)