From 4b38800ab7eba3db99935b5aa3d79c02395cfc95 Mon Sep 17 00:00:00 2001 From: cen1 Date: Fri, 18 Apr 2025 15:28:40 +0200 Subject: - modernize CMake by adding target_ where missing, split add_library and sources (target_sources), some reordering - make tests it's own CMake project - add CMake option to override hardcoded test data paths - improve CMake documentation, document all options - add basic CI build for Debian, Fedora and Windows - add release pipeline to create .deb, .rpm and Windows li/dll archives --- test/CMakeLists.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/CMakeLists.txt (limited to 'test/CMakeLists.txt') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..b646613 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.10) + +set(TEST_SRC_FILES + StormTest.cpp +) + +# Option to use the legacy hardcoded paths +option(STORMTEST_USE_OLD_PATHS "Use hardcoded OS-specific default paths for WORK_PATH_ROOT" ON) + +if(NOT STORMTEST_USE_OLD_PATHS) + set(WORK_PATH_ROOT "${CMAKE_CURRENT_BINARY_DIR}/work") + add_compile_definitions(WORK_PATH_ROOT="${WORK_PATH_ROOT}") +endif() + +find_package(ALSA REQUIRED) +add_executable(StormLib_test ${TEST_SRC_FILES}) +target_link_libraries(StormLib_test storm ${ALSA_LIBRARIES}) +install(TARGETS StormLib_test RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +add_test(NAME StormLib_test COMMAND StormLib_test) \ No newline at end of file -- cgit v1.2.3