Files
NukAnim/CMakeLists.txt
adminandClaude Opus 5.5 dfc020e618 Animation for Nuklear
NukAnim is one C99 header: a port of ImAnim by Soufiane KHIAT, with
ImAnimate's animate by Raidcore. It has tweens, easing, color spaces,
clips and timelines, motion paths, procedural motion, and the Nuklear
side: scrolling, style crossfades, text effects and an inspector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 13:30:48 +02:00

55 lines
1.8 KiB
CMake

cmake_minimum_required(VERSION 3.16)
project(NukAnim C)
add_library(nukanim INTERFACE)
target_include_directories(nukanim INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
return()
endif()
option(NUKANIM_SANITIZE "Build the tests with AddressSanitizer and UBSan" OFF)
enable_testing()
set(NUKLEAR ${CMAKE_CURRENT_SOURCE_DIR}/external/nuklear)
if(NOT EXISTS ${NUKLEAR}/nuklear.h)
message(FATAL_ERROR "Nuklear is missing: git submodule update --init")
endif()
if(MSVC)
set(STRICT /W4 /WX /wd5287)
set(QUIET /W1)
else()
set(STRICT -std=c99 -Wall -Wextra -pedantic -Werror)
set(QUIET -w)
find_library(MATH m)
endif()
add_library(nuklear_tests STATIC tests/nuklear.c)
target_include_directories(nuklear_tests PUBLIC ${NUKLEAR})
target_compile_options(nuklear_tests PRIVATE ${QUIET})
if(MATH)
target_link_libraries(nuklear_tests PUBLIC ${MATH})
endif()
foreach(test core clip path fx nk)
add_executable(test_${test} tests/${test}.c)
target_link_libraries(test_${test} PRIVATE nukanim nuklear_tests)
target_compile_options(test_${test} PRIVATE ${STRICT})
if(NUKANIM_SANITIZE)
target_compile_options(test_${test} PRIVATE -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer)
target_link_options(test_${test} PRIVATE -fsanitize=address,undefined)
endif()
add_test(NAME ${test} COMMAND test_${test})
endforeach()
add_library(nuklear_examples STATIC examples/nuklear.c)
target_include_directories(nuklear_examples PUBLIC ${NUKLEAR} examples)
target_compile_options(nuklear_examples PRIVATE ${QUIET})
if(MATH)
target_link_libraries(nuklear_examples PUBLIC ${MATH})
endif()
add_executable(clips examples/clips.c)
target_link_libraries(clips PRIVATE nukanim nuklear_examples)
target_compile_options(clips PRIVATE ${STRICT})