# libSDL_prizm: build system cmake_minimum_required(VERSION 3.16) project(LibSDL_prizm VERSION 1.2.15 LANGUAGES C) # Libraries that libexample depends on find_package(Gint 2.7.1 REQUIRED) # Turn include/config.h.in into a proper config.h where the @VAR@ have # been replaced; this is how version numbers are maintained. libexample_VERSION # is set to "1.0" by the project() command. # Note that the input (config.h.in) is relative to the source dir, but the # output (config.h) is in the build dir, so it doesn't pollute the Git repo. 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" "${PROJECT_BINARY_DIR}/include" "${FXSDK_COMPILER_INSTALL}/include/SDL" "${FXSDK_COMPILER_INSTALL}/include/openlibm") add_compile_options(-Os -lm -m4-nofpu -mb -std=c11 -ffreestanding -nostdlib -Wa,--dsp) # Target name is "SDL_prizm", output file is "libSDL_prizm.a" (by default) add_library(SDL_prizm STATIC ${SOURCES}) # After building, install the target (that is, libSDL_prizm.a) in the compiler install(TARGETS SDL_prizm DESTINATION "${FXSDK_COMPILER_INSTALL}") # 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_COMPILER_INSTALL}/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_COMPILER_INSTALL}/include/SDL") # Install FindSDL_prizm.cmake so that users can do find_package(LibSDL_prizm) install(FILES cmake/FindSDL_prizm.cmake DESTINATION "${FXSDK_CMAKE_MODULE_PATH}")