CMakeLists.txt
changeset 11901 e4d03d8733f3
parent 11852 c3fc99758ad2
child 11904 43dbca2813e1
     1.1 --- a/CMakeLists.txt	Sat Feb 24 08:58:22 2018 -0800
     1.2 +++ b/CMakeLists.txt	Sat Feb 24 08:59:58 2018 -0800
     1.3 @@ -340,6 +340,7 @@
     1.4  set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
     1.5  
     1.6  dep_option(SDL_STATIC_PIC      "Static version of the library should be built with Position Independent Code" OFF "SDL_STATIC" OFF)
     1.7 +set_option(SDL_TEST            "Build the test directory" OFF)
     1.8  
     1.9  # General source files
    1.10  file(GLOB SOURCE_FILES
    1.11 @@ -1746,6 +1747,15 @@
    1.12    target_include_directories(SDL2-static PUBLIC $<INSTALL_INTERFACE:include>)
    1.13  endif()
    1.14  
    1.15 +##### Tests #####
    1.16 +
    1.17 +if(SDL_TEST)
    1.18 +  file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
    1.19 +  add_library(SDL2_test STATIC ${TEST_SOURCES})
    1.20 +  
    1.21 +  add_subdirectory(test)
    1.22 +endif()
    1.23 +
    1.24  ##### Installation targets #####
    1.25  install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
    1.26    LIBRARY DESTINATION "lib${LIB_SUFFIX}"