find_package(GTest) include(GoogleTest) set(SOURCES Ecs/CatalogueTest.cpp Ecs/ComponentBufferMemoryContainerTest.cpp Ecs/ComponentBufferTest.cpp Ecs/ComponentCacheTest.cpp Ecs/ComponentViewTest.cpp Ecs/EntityCacheTest.cpp Ecs/EntityGraphViewTest.cpp Ecs/LinkedEntityListViewTest.cpp Ecs/SparseSetTest.cpp Ecs/SystemSchedulerTest.cpp Ecs/SparseSetMemoryContainerTest.cpp $<$:Interop/NovelRTInteropUtilsTest.cpp> $<$:Interop/Ecs/NrtCatalogueTest.cpp> $<$:Interop/Ecs/NrtComponentBufferMemoryContainerTest.cpp> $<$:Interop/Ecs/NrtComponentCacheTest.cpp> $<$:Interop/Ecs/NrtEntityCacheTest.cpp> $<$:Interop/Ecs/NrtSparseSetMemoryContainerTest.cpp> $<$:Interop/Ecs/NrtSystemSchedulerTest.cpp> $<$:Interop/Maths/GeoBoundsTest.cpp> $<$:Interop/Maths/GeoMatrix4x4Test.cpp> $<$:Interop/Maths/GeoVector2FTest.cpp> $<$:Interop/Maths/GeoVector3FTest.cpp> $<$:Interop/Maths/GeoVector4FTest.cpp> $<$:Interop/Maths/QuadTreePointTest.cpp> $<$:Interop/Maths/QuadTreeTest.cpp> $<$:Interop/ResourceManagement/BinaryMemberMetadataTest.cpp> $<$:Interop/Timing/NovelRTTimestampTest.cpp> Maths/GeoBoundsTest.cpp Maths/GeoMatrix4x4Test.cpp Maths/GeoVector2Test.cpp Maths/GeoVector3Test.cpp Maths/GeoVector4Test.cpp Maths/QuadTreeTest.cpp Maths/UtilitiesTest.cpp Persistence/ChapterTest.cpp Timing/TimestampTest.cpp Utilities/BitCastTest.cpp Utilities/BitflagsTest.cpp Utilities/EventTest.cpp main.cpp ) include(${PROJECT_SOURCE_DIR}/cmake/CopyBuildProducts.cmake) if(APPLE) add_executable(Engine_Tests MACOSX_BUNDLE ${SOURCES}) set_target_properties(Engine_Tests PROPERTIES BUNDLE True MACOSX_BUNDLE_GUI_IDENTIFIER dev.novelrt.samples.Engine_Tests MACOS_BUNDLE_BUNDLE_NAME Engine_Tests MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}" MACOSX_BUNDLE_SHORT_VERION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" ) else() add_executable(Engine_Tests ${SOURCES}) endif() target_compile_options(Engine_Tests PRIVATE $<$:/W4> $<$:/WX> $<$:/wd4611> $<$:/MP> $<$:-pedantic> $<$:-pedantic-errors> $<$:-Wall> $<$:-Wextra> $<$:-Werror> $<$:-Wno-float-equal> $<$:-Wno-padded> $<$:-pedantic> $<$:-pedantic-errors> $<$:-Wall> $<$:-Wextra> $<$:-Werror> $<$:-Wno-c++98-compat> $<$:-Wno-c++98-compat-pedantic> $<$:-Wno-float-equal> $<$:-Wno-padded> $<$:-Wno-reserved-id-macro> $<$:-Wno-nullability-extension> $<$:-pedantic> $<$:-pedantic-errors> $<$:-Wall> $<$:-Wextra> $<$:-Werror> $<$:-Wno-c++98-compat> $<$:-Wno-c++98-compat-pedantic> $<$:-Wno-float-equal> $<$:-Wno-padded> $<$:-Wno-reserved-id-macro> $<$:-Wno-nullability-extension> ) if(MSVC) set_property(TARGET Engine_Tests PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) get_target_property(opts Engine_Tests COMPILE_OPTIONS) endif() if(NOVELRT_BUILD_INTEROP) copy_runtime_dependencies(Engine_Tests DEPENDENCY Engine DEPENDENCY Interop ) else() copy_runtime_dependencies(Engine_Tests DEPENDENCY Engine ) endif() if(APPLE) copy_runtime_dependencies(Engine_Tests LIBRARY GTest::gtest_main LIBRARY GTest::gtest LIBRARY Vulkan::MoltenVK LIBRARY Vorbis::vorbisenc LIBRARY Vorbis::vorbis LIBRARY FLAC::FLAC LIBRARY Opus::opus LIBRARY Ogg::ogg LIBRARY ZLIB::zlib ) endif() target_link_libraries(Engine_Tests PUBLIC Engine $<$:Interop> GTest::gtest_main ) gtest_discover_tests(Engine_Tests EXTRA_ARGS "--gtest_output=xml:${CMAKE_CURRENT_BINARY_DIR}/../results/" DISCOVERY_MODE PRE_TEST)