aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorcen1 <cen.is.imba@gmail.com>2025-04-18 15:28:40 +0200
committercen1 <cen.is.imba@gmail.com>2025-05-25 19:42:45 +0200
commit4b38800ab7eba3db99935b5aa3d79c02395cfc95 (patch)
treeb93af75e349e1644dbf02186125f3e20095775fa /test/CMakeLists.txt
parentda046e71d9cfdfc0e143b6be0e496fddb9c6bab9 (diff)
- 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
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
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