🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
5.0 KiB

  1. cmake_minimum_required(VERSION 2.8.11)
  2. project(SDL2 C)
  3. # Global settings for all of the test targets
  4. # FIXME: is this wrong?
  5. remove_definitions(-DUSING_GENERATED_CONFIG_H)
  6. link_libraries(SDL2_test SDL2-static)
  7. # FIXME: Parent directory CMakeLists.txt only sets these for mingw/cygwin,
  8. # but we need them for VS as well.
  9. if(WINDOWS)
  10. link_libraries(SDL2main)
  11. add_definitions(-Dmain=SDL_main)
  12. endif()
  13. add_executable(checkkeys checkkeys.c)
  14. add_executable(loopwave loopwave.c)
  15. add_executable(loopwavequeue loopwavequeue.c)
  16. add_executable(testresample testresample.c)
  17. add_executable(testaudioinfo testaudioinfo.c)
  18. file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c)
  19. add_executable(testautomation ${TESTAUTOMATION_SOURCE_FILES})
  20. add_executable(testmultiaudio testmultiaudio.c)
  21. add_executable(testaudiohotplug testaudiohotplug.c)
  22. add_executable(testaudiocapture testaudiocapture.c)
  23. add_executable(testatomic testatomic.c)
  24. add_executable(testintersections testintersections.c)
  25. add_executable(testrelative testrelative.c)
  26. add_executable(testhittesting testhittesting.c)
  27. add_executable(testdraw2 testdraw2.c)
  28. add_executable(testdrawchessboard testdrawchessboard.c)
  29. add_executable(testdropfile testdropfile.c)
  30. add_executable(testerror testerror.c)
  31. add_executable(testfile testfile.c)
  32. add_executable(testgamecontroller testgamecontroller.c)
  33. add_executable(testgesture testgesture.c)
  34. add_executable(testgl2 testgl2.c)
  35. add_executable(testgles testgles.c)
  36. add_executable(testgles2 testgles2.c)
  37. add_executable(testhaptic testhaptic.c)
  38. add_executable(testhotplug testhotplug.c)
  39. add_executable(testrumble testrumble.c)
  40. add_executable(testthread testthread.c)
  41. add_executable(testiconv testiconv.c)
  42. add_executable(testime testime.c)
  43. add_executable(testjoystick testjoystick.c)
  44. add_executable(testkeys testkeys.c)
  45. add_executable(testloadso testloadso.c)
  46. add_executable(testlock testlock.c)
  47. if(APPLE)
  48. add_executable(testnative testnative.c
  49. testnativecocoa.m
  50. testnativex11.c)
  51. elseif(WINDOWS)
  52. add_executable(testnative testnative.c testnativew32.c)
  53. elseif(UNIX)
  54. add_executable(testnative testnative.c testnativex11.c)
  55. endif()
  56. add_executable(testoverlay2 testoverlay2.c testyuv_cvt.c)
  57. add_executable(testplatform testplatform.c)
  58. add_executable(testpower testpower.c)
  59. add_executable(testfilesystem testfilesystem.c)
  60. add_executable(testrendertarget testrendertarget.c)
  61. add_executable(testscale testscale.c)
  62. add_executable(testsem testsem.c)
  63. add_executable(testshader testshader.c)
  64. add_executable(testshape testshape.c)
  65. add_executable(testsprite2 testsprite2.c)
  66. add_executable(testspriteminimal testspriteminimal.c)
  67. add_executable(teststreaming teststreaming.c)
  68. add_executable(testtimer testtimer.c)
  69. add_executable(testver testver.c)
  70. add_executable(testviewport testviewport.c)
  71. add_executable(testwm2 testwm2.c)
  72. add_executable(testyuv testyuv.c testyuv_cvt.c)
  73. add_executable(torturethread torturethread.c)
  74. add_executable(testrendercopyex testrendercopyex.c)
  75. add_executable(testmessage testmessage.c)
  76. add_executable(testdisplayinfo testdisplayinfo.c)
  77. add_executable(testqsort testqsort.c)
  78. add_executable(testbounds testbounds.c)
  79. add_executable(testcustomcursor testcustomcursor.c)
  80. add_executable(controllermap controllermap.c)
  81. add_executable(testvulkan testvulkan.c)
  82. # HACK: Dummy target to cause the resource files to be copied to the build directory.
  83. # Need to make it an executable so we can use the TARGET_FILE_DIR generator expression.
  84. # This is needed so they get copied to the correct Debug/Release subdirectory in Xcode.
  85. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/resources_dummy.c "int main(int argc, const char **argv){ return 1; }\n")
  86. add_executable(SDL2_test_resoureces ${CMAKE_CURRENT_BINARY_DIR}/resources_dummy.c)
  87. file(GLOB RESOURCE_FILES *.bmp *.wav)
  88. foreach(RESOURCE_FILE ${RESOURCE_FILES})
  89. add_custom_command(TARGET SDL2_test_resoureces POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $<TARGET_FILE_DIR:SDL2_test_resoureces>)
  90. endforeach(RESOURCE_FILE)
  91. file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  92. # TODO: Might be easier to make all targets depend on the resources...?
  93. add_dependencies(testscale SDL2_test_resoureces)
  94. add_dependencies(testrendercopyex SDL2_test_resoureces)
  95. add_dependencies(controllermap SDL2_test_resoureces)
  96. add_dependencies(testyuv SDL2_test_resoureces)
  97. add_dependencies(testgamecontroller SDL2_test_resoureces)
  98. add_dependencies(testshape SDL2_test_resoureces)
  99. add_dependencies(testshader SDL2_test_resoureces)
  100. add_dependencies(testnative SDL2_test_resoureces)
  101. add_dependencies(testspriteminimal SDL2_test_resoureces)
  102. add_dependencies(testautomation SDL2_test_resoureces)
  103. add_dependencies(testcustomcursor SDL2_test_resoureces)
  104. add_dependencies(testrendertarget SDL2_test_resoureces)
  105. add_dependencies(testsprite2 SDL2_test_resoureces)
  106. add_dependencies(loopwave SDL2_test_resoureces)
  107. add_dependencies(loopwavequeue SDL2_test_resoureces)
  108. add_dependencies(testresample SDL2_test_resoureces)
  109. add_dependencies(testaudiohotplug SDL2_test_resoureces)
  110. add_dependencies(testmultiaudio SDL2_test_resoureces)