CMakeLists.txt
author Ryan C. Gordon <icculus@icculus.org>
Wed, 06 Mar 2019 02:56:23 -0500
changeset 102 d45dadba9ff2
parent 45 2c4484212926
permissions -rw-r--r--
A bunch of work on getting alpha blending more correct.
     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")