From 5f7a8d8e70239cdd470fa3ce16bf1cc3d6175343 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Thu, 6 Jul 2023 16:22:31 +0200 Subject: [PATCH] test-input: Update CMakeLists for updated CMake path Also adds the subdirectory to the project with the updated CMake path, as it was missed originally. --- CMakeLists.txt | 3 +++ test/test-input/CMakeLists.txt | 20 ++++++++++++-------- test/test-input/cmake/legacy.cmake | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 test/test-input/cmake/legacy.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d034f9e31..17c0f6d2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,9 @@ if(CMAKE_HOST_SYSTEM_NAME MATCHES "(Darwin)" OR OBS_CMAKE_VERSION VERSION_GREATE endif() add_subdirectory(libobs-opengl) add_subdirectory(plugins) + + add_subdirectory(test/test-input) + add_subdirectory(UI) message_configuration() diff --git a/test/test-input/CMakeLists.txt b/test/test-input/CMakeLists.txt index 24e75544b..0a03319e0 100644 --- a/test/test-input/CMakeLists.txt +++ b/test/test-input/CMakeLists.txt @@ -1,6 +1,16 @@ -project(test-input) +cmake_minimum_required(VERSION 3.24...3.25) + +legacy_check() + +option(ENABLE_TEST_INPUT "Build test sources" OFF) + +if(NOT ENABLE_TEST_INPUT) + target_disable(test-input) + return() +endif() add_library(test-input MODULE) +add_library(OBS::test-input ALIAS test-input) target_sources( test-input @@ -15,10 +25,4 @@ target_sources( target_link_libraries(test-input PRIVATE OBS::libobs) -if(MSVC) - target_link_libraries(test-input PRIVATE OBS::w32-pthreads) -endif() - -set_target_properties(test-input PROPERTIES FOLDER "tests and examples") - -setup_plugin_target(test-input) +set_target_properties_obs(test-input PROPERTIES FOLDER "Tests and Examples" PREFIX "") diff --git a/test/test-input/cmake/legacy.cmake b/test/test-input/cmake/legacy.cmake new file mode 100644 index 000000000..24e75544b --- /dev/null +++ b/test/test-input/cmake/legacy.cmake @@ -0,0 +1,24 @@ +project(test-input) + +add_library(test-input MODULE) + +target_sources( + test-input + PRIVATE test-filter.c + test-input.c + test-sinewave.c + sync-async-source.c + sync-audio-buffering.c + sync-pair-vid.c + sync-pair-aud.c + test-random.c) + +target_link_libraries(test-input PRIVATE OBS::libobs) + +if(MSVC) + target_link_libraries(test-input PRIVATE OBS::w32-pthreads) +endif() + +set_target_properties(test-input PROPERTIES FOLDER "tests and examples") + +setup_plugin_target(test-input)