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