CMakeLists.txt
author Ryan C. Gordon <icculus@icculus.org>
Mon, 18 Feb 2019 00:26:53 -0500
changeset 69 a2c5f6a01a55
parent 45 2c4484212926
permissions -rw-r--r--
Fill in a default palette for 8-bit screen surfaces.
     1 cmake_minimum_required(VERSION 3.0.0)
     2 project(sdl12_compat)
     3 
     4 add_library(SDL SHARED "src/SDL12_compat.c")
     5 
     6 target_include_directories(SDL PUBLIC "/usr/local/include/SDL2")  # !!! FIXME
     7 target_include_directories(SDL PUBLIC "/usr/X11/include")  # !!! FIXME
     8 add_definitions("-D_THREAD_SAFE")  # !!! FIXME
     9 
    10 if(APPLE)
    11     set_target_properties(SDL PROPERTIES
    12         MACOSX_RPATH 1
    13         OUTPUT_NAME "SDL-1.2.0"
    14     )
    15 elseif(UNIX AND NOT ANDROID)
    16     set_target_properties(SDL PROPERTIES
    17         VERSION "1.2.50"
    18         SOVERSION "0"
    19         OUTPUT_NAME "SDL-1.2")
    20 else()
    21     set_target_properties(SDL PROPERTIES
    22         VERSION "1.2.50"
    23         SOVERSION "0"
    24       OUTPUT_NAME "SDL")
    25 endif()
    26 
    27 if(MSVC)
    28     # Don't try to link with the default set of libraries.
    29     set_target_properties(SDL PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
    30     set_target_properties(SDL PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
    31     set_target_properties(SDL PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
    32 endif()
    33 
    34 
    35 # test programs...
    36 macro(test_program _NAME _SRCS)
    37     add_executable(${_NAME} ${_SRCS})
    38     target_include_directories(${_NAME} PUBLIC "/usr/local/include/SDL")  # !!! FIXME
    39     target_include_directories(${_NAME} PUBLIC "/usr/X11/include")  # !!! FIXME
    40     target_link_libraries(${_NAME} SDL)
    41 endmacro()
    42 
    43 test_program(testsprite "test/testsprite.c")