CMakeLists.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. cmake_minimum_required(VERSION 3.0...3.5)
  2. project(SDL2_test)
  3. include(CheckCCompilerFlag)
  4. include(CMakeParseArguments)
  5. include(CMakePushCheckState)
  6. set(SDL_TEST_EXECUTABLES)
  7. set(SDL_TESTS_NONINTERACTIVE)
  8. set(SDL_TESTS_NEEDS_ESOURCES)
  9. macro(add_sdl_test_executable TARGET)
  10. cmake_parse_arguments(AST "NONINTERACTIVE;NEEDS_RESOURCES" "" "" ${ARGN})
  11. add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS})
  12. list(APPEND SDL_TEST_EXECUTABLES ${TARGET})
  13. if(AST_NONINTERACTIVE)
  14. list(APPEND SDL_TESTS_NONINTERACTIVE ${TARGET})
  15. endif()
  16. if(AST_NEEDS_RESOURCES)
  17. list(APPEND SDL_TESTS_NEEDS_ESOURCES ${TARGET})
  18. endif()
  19. if(HAVE_GCC_WDOCUMENTATION)
  20. target_compile_options(${TARGET} PRIVATE "-Wdocumentation")
  21. if(HAVE_GCC_WERROR_DOCUMENTATION)
  22. target_compile_options(${TARGET} PRIVATE "-Werror=documentation")
  23. endif()
  24. endif()
  25. if(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND)
  26. if(SDL_WERROR)
  27. if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
  28. target_compile_options(${TARGET} PRIVATE "-Werror=documentation-unknown-command")
  29. endif()
  30. endif()
  31. target_compile_options(${TARGET} PRIVATE "-Wdocumentation-unknown-command")
  32. endif()
  33. if(HAVE_GCC_COMMENT_BLOCK_COMMANDS)
  34. target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=threadsafety")
  35. target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=deprecated")
  36. else()
  37. if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
  38. target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=threadsafety")
  39. target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=deprecated")
  40. endif()
  41. endif()
  42. if(USE_GCC OR USE_CLANG)
  43. check_c_compiler_flag(-fno-fast-math HAVE_GCC_FNO_FAST_MATH)
  44. if(HAVE_GCC_FNO_FAST_MATH)
  45. target_compile_options(${TARGET} PRIVATE -fno-fast-math)
  46. endif()
  47. endif()
  48. endmacro()
  49. if(NOT TARGET SDL2::SDL2-static)
  50. find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test)
  51. endif()
  52. enable_testing()
  53. if(SDL_INSTALL_TESTS)
  54. include(GNUInstallDirs)
  55. endif()
  56. if(N3DS)
  57. link_libraries(SDL2::SDL2main)
  58. endif()
  59. if(PSP)
  60. link_libraries(
  61. SDL2::SDL2main
  62. SDL2::SDL2test
  63. SDL2::SDL2-static
  64. GL
  65. pspvram
  66. pspvfpu
  67. pspdisplay
  68. pspgu
  69. pspge
  70. pspaudio
  71. pspctrl
  72. psphprm
  73. psppower
  74. )
  75. elseif(PS2)
  76. link_libraries(
  77. SDL2main
  78. SDL2_test
  79. SDL2-static
  80. patches
  81. gskit
  82. dmakit
  83. ps2_drivers
  84. )
  85. else()
  86. link_libraries(SDL2::SDL2test SDL2::SDL2-static)
  87. endif()
  88. if(WINDOWS)
  89. # mingw32 must come before SDL2main to link successfully
  90. if(MINGW OR CYGWIN)
  91. link_libraries(mingw32)
  92. endif()
  93. # CET support was added in VS 16.7
  94. if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")
  95. link_libraries(-CETCOMPAT)
  96. endif()
  97. # FIXME: Parent directory CMakeLists.txt only sets these for mingw/cygwin,
  98. # but we need them for VS as well.
  99. link_libraries(SDL2main)
  100. add_definitions(-Dmain=SDL_main)
  101. endif()
  102. # CMake incorrectly detects opengl32.lib being present on MSVC ARM64
  103. if(NOT MSVC OR NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
  104. # Prefer GLVND, if present
  105. set(OpenGL_GL_PREFERENCE GLVND)
  106. find_package(OpenGL)
  107. endif()
  108. if (OPENGL_FOUND)
  109. add_definitions(-DHAVE_OPENGL)
  110. endif()
  111. add_sdl_test_executable(checkkeys checkkeys.c)
  112. add_sdl_test_executable(checkkeysthreads checkkeysthreads.c)
  113. add_sdl_test_executable(loopwave NEEDS_RESOURCES loopwave.c testutils.c)
  114. add_sdl_test_executable(loopwavequeue NEEDS_RESOURCES loopwavequeue.c testutils.c)
  115. add_sdl_test_executable(testsurround testsurround.c)
  116. add_sdl_test_executable(testresample NEEDS_RESOURCES testresample.c)
  117. add_sdl_test_executable(testaudioinfo testaudioinfo.c)
  118. file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c)
  119. add_sdl_test_executable(testautomation NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES})
  120. add_sdl_test_executable(testmultiaudio NEEDS_RESOURCES testmultiaudio.c testutils.c)
  121. add_sdl_test_executable(testaudiohotplug NEEDS_RESOURCES testaudiohotplug.c testutils.c)
  122. add_sdl_test_executable(testaudiocapture testaudiocapture.c)
  123. add_sdl_test_executable(testatomic NONINTERACTIVE testatomic.c)
  124. add_sdl_test_executable(testintersections testintersections.c)
  125. add_sdl_test_executable(testrelative testrelative.c)
  126. add_sdl_test_executable(testhittesting testhittesting.c)
  127. add_sdl_test_executable(testdraw2 testdraw2.c)
  128. add_sdl_test_executable(testdrawchessboard testdrawchessboard.c)
  129. add_sdl_test_executable(testdropfile testdropfile.c)
  130. add_sdl_test_executable(testerror NONINTERACTIVE testerror.c)
  131. if(LINUX)
  132. add_sdl_test_executable(testevdev NONINTERACTIVE testevdev.c)
  133. endif()
  134. add_sdl_test_executable(testfile testfile.c)
  135. add_sdl_test_executable(testgamecontroller NEEDS_RESOURCES testgamecontroller.c testutils.c)
  136. add_sdl_test_executable(testgeometry testgeometry.c testutils.c)
  137. add_sdl_test_executable(testgesture testgesture.c)
  138. add_sdl_test_executable(testgl2 testgl2.c)
  139. add_sdl_test_executable(testgles testgles.c)
  140. add_sdl_test_executable(testgles2 testgles2.c)
  141. add_sdl_test_executable(testgles2_sdf NEEDS_RESOURCES testgles2_sdf.c testutils.c)
  142. add_sdl_test_executable(testhaptic testhaptic.c)
  143. add_sdl_test_executable(testhotplug testhotplug.c)
  144. add_sdl_test_executable(testrumble testrumble.c)
  145. add_sdl_test_executable(testthread NONINTERACTIVE testthread.c)
  146. add_sdl_test_executable(testiconv NEEDS_RESOURCES testiconv.c testutils.c)
  147. add_sdl_test_executable(testime NEEDS_RESOURCES testime.c testutils.c)
  148. add_sdl_test_executable(testjoystick testjoystick.c)
  149. add_sdl_test_executable(testkeys testkeys.c)
  150. add_sdl_test_executable(testloadso testloadso.c)
  151. add_sdl_test_executable(testlocale NONINTERACTIVE testlocale.c)
  152. add_sdl_test_executable(testlock testlock.c)
  153. add_sdl_test_executable(testmouse testmouse.c)
  154. if(APPLE)
  155. add_sdl_test_executable(testnative NEEDS_RESOURCES
  156. testnative.c
  157. testnativecocoa.m
  158. testnativex11.c
  159. testutils.c
  160. )
  161. cmake_push_check_state(RESET)
  162. check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
  163. cmake_pop_check_state()
  164. if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
  165. set_property(SOURCE "testnativecocoa.m" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-error=deprecated-declarations")
  166. endif()
  167. elseif(WINDOWS)
  168. add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativew32.c testutils.c)
  169. elseif(HAVE_X11)
  170. add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativex11.c testutils.c)
  171. target_link_libraries(testnative X11)
  172. elseif(OS2)
  173. add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativeos2.c testutils.c)
  174. endif()
  175. add_sdl_test_executable(testoverlay2 NEEDS_RESOURCES testoverlay2.c testyuv_cvt.c testutils.c)
  176. add_sdl_test_executable(testplatform NONINTERACTIVE testplatform.c)
  177. add_sdl_test_executable(testpower NONINTERACTIVE testpower.c)
  178. add_sdl_test_executable(testfilesystem NONINTERACTIVE testfilesystem.c)
  179. if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
  180. add_sdl_test_executable(testfilesystem_pre NONINTERACTIVE testfilesystem_pre.c)
  181. endif()
  182. add_sdl_test_executable(testrendertarget NEEDS_RESOURCES testrendertarget.c testutils.c)
  183. add_sdl_test_executable(testscale NEEDS_RESOURCES testscale.c testutils.c)
  184. add_sdl_test_executable(testsem testsem.c)
  185. add_sdl_test_executable(testsensor testsensor.c)
  186. add_sdl_test_executable(testshader NEEDS_RESOURCES testshader.c)
  187. add_sdl_test_executable(testshape NEEDS_RESOURCES testshape.c)
  188. add_sdl_test_executable(testsprite2 NEEDS_RESOURCES testsprite2.c testutils.c)
  189. add_sdl_test_executable(testspriteminimal NEEDS_RESOURCES testspriteminimal.c testutils.c)
  190. add_sdl_test_executable(teststreaming NEEDS_RESOURCES teststreaming.c testutils.c)
  191. add_sdl_test_executable(testtimer NONINTERACTIVE testtimer.c)
  192. add_sdl_test_executable(testurl testurl.c)
  193. add_sdl_test_executable(testver NONINTERACTIVE testver.c)
  194. add_sdl_test_executable(testviewport NEEDS_RESOURCES testviewport.c testutils.c)
  195. add_sdl_test_executable(testwm2 testwm2.c)
  196. add_sdl_test_executable(testyuv NEEDS_RESOURCES testyuv.c testyuv_cvt.c)
  197. add_sdl_test_executable(torturethread torturethread.c)
  198. add_sdl_test_executable(testrendercopyex NEEDS_RESOURCES testrendercopyex.c testutils.c)
  199. add_sdl_test_executable(testmessage testmessage.c)
  200. add_sdl_test_executable(testdisplayinfo testdisplayinfo.c)
  201. add_sdl_test_executable(testqsort NONINTERACTIVE testqsort.c)
  202. add_sdl_test_executable(testbounds testbounds.c)
  203. add_sdl_test_executable(testcustomcursor testcustomcursor.c)
  204. add_sdl_test_executable(controllermap NEEDS_RESOURCES controllermap.c testutils.c)
  205. add_sdl_test_executable(testvulkan testvulkan.c)
  206. add_sdl_test_executable(testoffscreen testoffscreen.c)
  207. cmake_push_check_state(RESET)
  208. check_c_compiler_flag(-Wformat-overflow HAVE_WFORMAT_OVERFLOW)
  209. if(HAVE_WFORMAT_OVERFLOW)
  210. target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT_OVERFLOW)
  211. endif()
  212. check_c_compiler_flag(-Wformat HAVE_WFORMAT)
  213. if(HAVE_WFORMAT)
  214. target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT)
  215. endif()
  216. check_c_compiler_flag(-Wformat-extra-args HAVE_WFORMAT_EXTRA_ARGS)
  217. if(HAVE_WFORMAT_EXTRA_ARGS)
  218. target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT_EXTRA_ARGS)
  219. endif()
  220. cmake_pop_check_state()
  221. if(SDL_DUMMYAUDIO)
  222. list(APPEND SDL_TESTS_NONINTERACTIVE
  223. testaudioinfo
  224. testsurround
  225. )
  226. endif()
  227. if(SDL_DUMMYVIDEO)
  228. list(APPEND SDL_TESTS_NONINTERACTIVE
  229. testkeys
  230. testbounds
  231. testdisplayinfo
  232. )
  233. endif()
  234. if(OPENGL_FOUND)
  235. if(TARGET OpenGL::GL)
  236. target_link_libraries(testshader OpenGL::GL)
  237. target_link_libraries(testgl2 OpenGL::GL)
  238. else()
  239. if(EMSCRIPTEN AND OPENGL_gl_LIBRARY STREQUAL "nul")
  240. set(OPENGL_gl_LIBRARY GL)
  241. endif()
  242. # emscripten's FindOpenGL.cmake does not create OpenGL::GL
  243. target_link_libraries(testshader ${OPENGL_gl_LIBRARY})
  244. target_link_libraries(testgl2 ${OPENGL_gl_LIBRARY})
  245. endif()
  246. endif()
  247. if(EMSCRIPTEN)
  248. target_link_libraries(testshader -sLEGACY_GL_EMULATION)
  249. endif()
  250. file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt)
  251. file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  252. if(PSP)
  253. # Build EBOOT files if building for PSP
  254. set(BUILD_EBOOT
  255. ${SDL_TESTS_NEEDS_ESOURCES}
  256. testatomic
  257. testaudiocapture
  258. testaudioinfo
  259. testbounds
  260. testdisplayinfo
  261. testdraw2
  262. testdrawchessboard
  263. testerror
  264. testfile
  265. testfilesystem
  266. testgeometry
  267. testgl2
  268. testhittesting
  269. testiconv
  270. testintersections
  271. testjoystick
  272. testlock
  273. testmessage
  274. testoverlay2
  275. testplatform
  276. testpower
  277. testqsort
  278. testsem
  279. teststreaming
  280. testsurround
  281. testthread
  282. testtimer
  283. testver
  284. testviewport
  285. testwm2
  286. torturethread
  287. )
  288. foreach(APP IN LISTS BUILD_EBOOT)
  289. create_pbp_file(
  290. TARGET ${APP}
  291. TITLE SDL-${APP}
  292. ICON_PATH NULL
  293. BACKGROUND_PATH NULL
  294. PREVIEW_PATH NULL
  295. )
  296. add_custom_command(
  297. TARGET ${APP} POST_BUILD
  298. COMMAND ${CMAKE_COMMAND} -E make_directory
  299. $<TARGET_FILE_DIR:${ARG_TARGET}>/sdl-${APP}
  300. )
  301. add_custom_command(
  302. TARGET ${APP} POST_BUILD
  303. COMMAND ${CMAKE_COMMAND} -E rename
  304. $<TARGET_FILE_DIR:${ARG_TARGET}>/EBOOT.PBP
  305. $<TARGET_FILE_DIR:${ARG_TARGET}>/sdl-${APP}/EBOOT.PBP
  306. )
  307. if(${BUILD_PRX})
  308. add_custom_command(
  309. TARGET ${APP} POST_BUILD
  310. COMMAND ${CMAKE_COMMAND} -E copy
  311. $<TARGET_FILE_DIR:${ARG_TARGET}>/${APP}
  312. $<TARGET_FILE_DIR:${ARG_TARGET}>/sdl-${APP}/${APP}
  313. )
  314. add_custom_command(
  315. TARGET ${APP} POST_BUILD
  316. COMMAND ${CMAKE_COMMAND} -E rename
  317. $<TARGET_FILE_DIR:${ARG_TARGET}>/${APP}.prx
  318. $<TARGET_FILE_DIR:${ARG_TARGET}>/sdl-${APP}/${APP}.prx
  319. )
  320. endif()
  321. add_custom_command(
  322. TARGET ${APP} POST_BUILD
  323. COMMAND ${CMAKE_COMMAND} -E remove
  324. $<TARGET_FILE_DIR:${ARG_TARGET}>/PARAM.SFO
  325. )
  326. endforeach()
  327. endif()
  328. if(N3DS)
  329. set(ROMFS_DIR "${CMAKE_CURRENT_BINARY_DIR}/romfs")
  330. file(COPY ${RESOURCE_FILES} DESTINATION "${ROMFS_DIR}")
  331. foreach(APP IN LISTS SDL_TEST_EXECUTABLES)
  332. get_target_property(TARGET_BINARY_DIR ${APP} BINARY_DIR)
  333. set(SMDH_FILE "${TARGET_BINARY_DIR}/${APP}.smdh")
  334. ctr_generate_smdh("${SMDH_FILE}"
  335. NAME "SDL-${APP}"
  336. DESCRIPTION "SDL2 Test suite"
  337. AUTHOR "SDL2 Contributors"
  338. ICON "${CMAKE_CURRENT_SOURCE_DIR}/n3ds/logo48x48.png"
  339. )
  340. ctr_create_3dsx(
  341. ${APP}
  342. ROMFS "${ROMFS_DIR}"
  343. SMDH "${SMDH_FILE}"
  344. )
  345. endforeach()
  346. endif()
  347. if(RISCOS)
  348. set(SDL_TEST_EXECUTABLES_AIF)
  349. foreach(APP IN LISTS SDL_TEST_EXECUTABLES)
  350. target_link_options(${APP} PRIVATE -static)
  351. add_custom_command(
  352. OUTPUT ${APP},ff8
  353. COMMAND elf2aif ${APP} ${APP},ff8
  354. DEPENDS ${APP}
  355. )
  356. add_custom_target(${APP}-aif ALL DEPENDS ${APP},ff8)
  357. list(APPEND SDL_TEST_EXECUTABLES_AIF ${CMAKE_CURRENT_BINARY_DIR}/${APP},ff8)
  358. endforeach()
  359. endif()
  360. foreach(APP IN LISTS SDL_TESTS_NEEDS_RESOURCES)
  361. foreach(RESOURCE_FILE ${RESOURCE_FILES})
  362. if(PSP OR PS2)
  363. add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $<TARGET_FILE_DIR:${APP}>/sdl-${APP})
  364. else()
  365. add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $<TARGET_FILE_DIR:${APP}>)
  366. endif()
  367. endforeach(RESOURCE_FILE)
  368. if(APPLE)
  369. # Make sure resource files get installed into macOS/iOS .app bundles.
  370. target_sources(${APP} PRIVATE "${RESOURCE_FILES}")
  371. set_target_properties(${APP} PROPERTIES RESOURCE "${RESOURCE_FILES}")
  372. endif()
  373. endforeach()
  374. # Set Apple App ID / Bundle ID. This is needed to launch apps on some Apple
  375. # platforms (iOS, for example).
  376. if(APPLE)
  377. if(${CMAKE_VERSION} VERSION_LESS "3.7.0")
  378. # CMake's 'BUILDSYSTEM_TARGETS' property is only available in
  379. # CMake 3.7 and above.
  380. message(WARNING "Unable to set Bundle ID for Apple .app builds due to old CMake (pre 3.7).")
  381. else()
  382. get_property(TARGETS DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY BUILDSYSTEM_TARGETS)
  383. foreach(CURRENT_TARGET IN LISTS TARGETS)
  384. get_property(TARGET_TYPE TARGET ${CURRENT_TARGET} PROPERTY TYPE)
  385. if(TARGET_TYPE STREQUAL "EXECUTABLE")
  386. set_target_properties("${CURRENT_TARGET}" PROPERTIES
  387. MACOSX_BUNDLE_GUI_IDENTIFIER "org.libsdl.${CURRENT_TARGET}"
  388. MACOSX_BUNDLE_BUNDLE_VERSION "${SDL_VERSION}"
  389. MACOSX_BUNDLE_SHORT_VERSION_STRING "${SDL_VERSION}"
  390. )
  391. endif()
  392. endforeach()
  393. endif()
  394. endif()
  395. set(TESTS_ENVIRONMENT
  396. SDL_AUDIODRIVER=dummy
  397. SDL_VIDEODRIVER=dummy
  398. )
  399. foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE})
  400. add_test(
  401. NAME ${TESTCASE}
  402. COMMAND ${TESTCASE}
  403. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  404. )
  405. set_tests_properties(${TESTCASE}
  406. PROPERTIES
  407. ENVIRONMENT "${TESTS_ENVIRONMENT}"
  408. TIMEOUT 10
  409. )
  410. if(SDL_INSTALL_TESTS)
  411. set(exe ${TESTCASE})
  412. set(installedtestsdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/installed-tests/SDL2")
  413. configure_file(template.test.in "${exe}.test" @ONLY)
  414. install(
  415. FILES "${CMAKE_CURRENT_BINARY_DIR}/${exe}.test"
  416. DESTINATION ${CMAKE_INSTALL_DATADIR}/installed-tests/SDL2
  417. )
  418. endif()
  419. endforeach()
  420. set_tests_properties(testthread PROPERTIES TIMEOUT 40)
  421. set_tests_properties(testtimer PROPERTIES TIMEOUT 60)
  422. if(TARGET testfilesystem_pre)
  423. set_property(TEST testfilesystem_pre PROPERTY TIMEOUT 60)
  424. set_property(TEST testfilesystem APPEND PROPERTY DEPENDS testfilesystem_pre)
  425. endif()
  426. if(SDL_INSTALL_TESTS)
  427. if(RISCOS)
  428. install(
  429. FILES ${SDL_TEST_EXECUTABLES_AIF}
  430. DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2
  431. )
  432. else()
  433. install(
  434. TARGETS ${SDL_TEST_EXECUTABLES}
  435. DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2
  436. )
  437. endif()
  438. if(MSVC)
  439. foreach(test ${SDL_TEST_EXECUTABLES})
  440. install(FILES $<TARGET_PDB_FILE:${test}> DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2" OPTIONAL)
  441. endforeach()
  442. endif()
  443. install(
  444. FILES ${RESOURCE_FILES}
  445. DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2
  446. )
  447. endif()