93 lines
2.7 KiB
CMake
93 lines
2.7 KiB
CMake
# libSDL: build system
|
|
cmake_minimum_required(VERSION 3.16)
|
|
project(cSDL VERSION 1.2.15 LANGUAGES C)
|
|
find_package(Gint 2.9.0 REQUIRED)
|
|
|
|
configure_file(./include/SDL_config.h.in include/SDL/SDL_config.h)
|
|
|
|
set(SOURCES
|
|
src/SDL.c
|
|
src/SDL_error.c
|
|
src/SDL_fatal.c
|
|
src/audio/SDL_audio.c
|
|
src/audio/SDL_audiocvt.c
|
|
src/cpuinfo/SDL_cpuinfo.c
|
|
src/events/SDL_active.c
|
|
src/events/SDL_events.c
|
|
src/events/SDL_expose.c
|
|
src/events/SDL_keyboard.c
|
|
src/events/SDL_mouse.c
|
|
src/events/SDL_quit.c
|
|
src/events/SDL_resize.c
|
|
src/file/SDL_rwops.c
|
|
src/joystick/SDL_joystick.c
|
|
src/stdlib/SDL_getenv.c
|
|
src/stdlib/SDL_iconv.c
|
|
src/stdlib/SDL_malloc.c
|
|
src/stdlib/SDL_qsort.c
|
|
src/stdlib/SDL_stdlib.c
|
|
src/stdlib/SDL_string.c
|
|
src/thread/SDL_thread.c
|
|
src/thread/generic/SDL_syscond.c
|
|
src/thread/generic/SDL_sysmutex.c
|
|
src/thread/generic/SDL_syssem.c
|
|
src/thread/generic/SDL_systhread.c
|
|
src/timer/SDL_timer.c
|
|
src/timer/prizm/SDL_systimer.c
|
|
src/video/SDL_blit.c
|
|
src/video/SDL_blit_0.c
|
|
src/video/SDL_blit_1.c
|
|
src/video/SDL_blit_A.c
|
|
src/video/SDL_blit_N.c
|
|
src/video/SDL_bmp.c
|
|
src/video/SDL_cursor.c
|
|
src/video/SDL_gamma.c
|
|
src/video/SDL_pixels.c
|
|
src/video/SDL_RLEaccel.c
|
|
src/video/SDL_stretch.c
|
|
src/video/SDL_surface.c
|
|
src/video/SDL_video.c
|
|
src/video/SDL_yuv.c
|
|
src/video/SDL_yuv_mmx.c
|
|
src/video/SDL_yuv_sw.c
|
|
src/video/prizm/SDL_prizmevents.c
|
|
src/video/prizm/SDL_prizmfonts.c
|
|
src/video/prizm/SDL_prizmnti.c
|
|
src/video/prizm/SDL_prizmutils.c
|
|
src/video/prizm/SDL_prizmvideo.c
|
|
src/gfx/SDL_framerate.c
|
|
src/gfx/SDL_gfxBlitFunc.c
|
|
src/gfx/SDL_gfxPrimitives.c
|
|
src/gfx/SDL_imageFilter.c
|
|
src/gfx/SDL_rotozoom.c
|
|
)
|
|
|
|
include_directories(
|
|
"${PROJECT_SOURCE_DIR}/include"
|
|
"${PROJECT_SOURCE_DIR}/include/SDL")
|
|
|
|
# Target name is "cSDL", output file is "libcSDL.a" (by default)
|
|
add_library(cSDL STATIC ${SOURCES})
|
|
target_compile_options(cSDL PRIVATE -Os -std=c11)
|
|
|
|
# After building, install the target (that is, libSDL_prizm.a) in the compiler
|
|
install(TARGETS cSDL
|
|
DESTINATION "${FXSDK_LIB}")
|
|
|
|
# Also install the headers (our include folder gets merged with the existing
|
|
# one in the compiler's install folder). Only install files matching *.h to
|
|
# exclude config.h.in.
|
|
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/SDL"
|
|
DESTINATION "${FXSDK_INCLUDE}"
|
|
FILES_MATCHING PATTERN "*.h")
|
|
# Slyvtt : replaced "*.h" with "*" as some headers are in the C++ style, without .h extension
|
|
|
|
# Install config.h from the build dir
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/SDL/SDL_config.h"
|
|
DESTINATION "${FXSDK_INCLUDE}/SDL")
|
|
|
|
# Install FindcSDL.cmake so that users can do find_package(LibcSDL)
|
|
install(FILES cmake/FindcSDL.cmake
|
|
DESTINATION "${FXSDK_CMAKE_MODULE_PATH}")
|
|
|