CMakeLists.txt
changeset 11940 bfb936894a9d
parent 11927 6e61fc35c129
child 11941 4d843a32d74e
equal deleted inserted replaced
11939:69afb0599152 11940:bfb936894a9d
   208 # Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config,
   208 # Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config,
   209 # etc. are created correctly.
   209 # etc. are created correctly.
   210 set(SDL_LIBS "-lSDL2")
   210 set(SDL_LIBS "-lSDL2")
   211 set(SDL_CFLAGS "")
   211 set(SDL_CFLAGS "")
   212 
   212 
   213 # Emscripten toolchain has a nonempty default value for this, and the checks 
   213 # Emscripten toolchain has a nonempty default value for this, and the checks
   214 # in this file need to change that, so remember the original value, and 
   214 # in this file need to change that, so remember the original value, and
   215 # restore back to that afterwards. For check_function_exists() to work in
   215 # restore back to that afterwards. For check_function_exists() to work in
   216 # Emscripten, this value must be at its default value.
   216 # Emscripten, this value must be at its default value.
   217 set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
   217 set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
   218 
   218 
   219 if(CYGWIN)
   219 if(CYGWIN)
   242 # All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
   242 # All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so
   243 #  you only need to have a platform override them if they are disabling.
   243 #  you only need to have a platform override them if they are disabling.
   244 set(OPT_DEF_ASM TRUE)
   244 set(OPT_DEF_ASM TRUE)
   245 if(EMSCRIPTEN)
   245 if(EMSCRIPTEN)
   246   # Set up default values for the currently supported set of subsystems:
   246   # Set up default values for the currently supported set of subsystems:
   247   # Emscripten/Javascript does not have assembly support, a dynamic library 
   247   # Emscripten/Javascript does not have assembly support, a dynamic library
   248   # loading architecture, low-level CPU inspection or multithreading.
   248   # loading architecture, low-level CPU inspection or multithreading.
   249   set(OPT_DEF_ASM FALSE)
   249   set(OPT_DEF_ASM FALSE)
   250   set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
   250   set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
   251   set(SDL_ATOMIC_ENABLED_BY_DEFAULT OFF)
   251   set(SDL_ATOMIC_ENABLED_BY_DEFAULT OFF)
   252   set(SDL_THREADS_ENABLED_BY_DEFAULT OFF)
   252   set(SDL_THREADS_ENABLED_BY_DEFAULT OFF)
   999 
   999 
  1000     check_c_source_compiles("
  1000     check_c_source_compiles("
  1001         #include <linux/kd.h>
  1001         #include <linux/kd.h>
  1002         #include <linux/keyboard.h>
  1002         #include <linux/keyboard.h>
  1003 
  1003 
  1004         int main(int argc, char **argv) 
  1004         int main(int argc, char **argv)
  1005         {
  1005         {
  1006             struct kbentry kbe;
  1006             struct kbentry kbe;
  1007             kbe.kb_table = KG_CTRL;
  1007             kbe.kb_table = KG_CTRL;
  1008             ioctl(0, KDGKBENT, &kbe);
  1008             ioctl(0, KDGKBENT, &kbe);
  1009         }" HAVE_INPUT_KD)
  1009         }" HAVE_INPUT_KD)
  1759 ##### Tests #####
  1759 ##### Tests #####
  1760 
  1760 
  1761 if(SDL_TEST)
  1761 if(SDL_TEST)
  1762   file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
  1762   file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
  1763   add_library(SDL2_test STATIC ${TEST_SOURCES})
  1763   add_library(SDL2_test STATIC ${TEST_SOURCES})
  1764   
  1764 
  1765   add_subdirectory(test)
  1765   add_subdirectory(test)
  1766 endif()
  1766 endif()
  1767 
  1767 
  1768 ##### Installation targets #####
  1768 ##### Installation targets #####
  1769 install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
  1769 install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
  1816         set(SOEXT "so")
  1816         set(SOEXT "so")
  1817     endif()
  1817     endif()
  1818     if(NOT ANDROID)
  1818     if(NOT ANDROID)
  1819         install(CODE "
  1819         install(CODE "
  1820           execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1820           execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
  1821           \"libSDL2-2.0.${SOEXT}\" \"libSDL2.${SOEXT}\")")
  1821             \"${SDL2_BINARY_DIR}/libSDL2-2.0${SDL_CMAKE_DEBUG_POSTFIX}.${SOEXT}\" \"${SDL2_BINARY_DIR}/libSDL2.${SOEXT}\")")
  1822         install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
  1822         install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
  1823     endif()
  1823     endif()
  1824   endif()
  1824   endif()
  1825   if(FREEBSD)
  1825   if(FREEBSD)
  1826     # FreeBSD uses ${PREFIX}/libdata/pkgconfig
  1826     # FreeBSD uses ${PREFIX}/libdata/pkgconfig