-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (41 loc) · 1.62 KB
/
CMakeLists.txt
File metadata and controls
54 lines (41 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.21)
project(smooth_axis C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
# Include directories
include_directories(${CMAKE_SOURCE_DIR}/src)
# Library target
add_library(smooth_axis_lib src/smooth_axis.c)
# Test executables (individual, matching Makefile structure)
add_executable(ramp_test
tests/c_tests/ramp_response_test.c
src/smooth_axis.c)
add_executable(step_test
tests/c_tests/step_response_test.c
src/smooth_axis.c)
add_executable(test_api
tests/c_tests/test_api_sanity_enhanced.c
src/smooth_axis.c)
# Link math library to all tests
target_link_libraries(ramp_test PRIVATE m)
target_link_libraries(step_test PRIVATE m)
target_link_libraries(test_api PRIVATE m)
# Set release mode for test_api (matches Makefile: -DNDEBUG)
target_compile_definitions(test_api PRIVATE NDEBUG)
# Enable testing
enable_testing()
# Add tests with proper working directory (project root)
add_test(NAME ramp_test COMMAND ramp_test)
set_tests_properties(ramp_test PROPERTIES
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME step_test COMMAND step_test)
set_tests_properties(step_test PROPERTIES
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME test_api COMMAND test_api)
set_tests_properties(test_api PROPERTIES
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# Create test data directories in build tree (optional, for convenience)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/data/ramp_files)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/data/step_files)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests/data/renders)