31 lines
788 B
CMake
31 lines
788 B
CMake
cmake_minimum_required(VERSION 3.14)
|
|
project(mons_gltf LANGUAGES C)
|
|
set(CMAKE_C_STANDARD 99)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
add_library(mons_gltf
|
|
SHARED
|
|
./src/gltf.c
|
|
)
|
|
|
|
target_include_directories(mons_gltf PUBLIC
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/include"
|
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
|
)
|
|
target_compile_options(mons_gltf PRIVATE -coverage)
|
|
target_link_options(mons_gltf PRIVATE -coverage)
|
|
target_link_libraries(mons_gltf PUBLIC mons_json mons_3d)
|
|
|
|
include(CTest)
|
|
|
|
function(TESTCASE NAME)
|
|
add_executable(test_${NAME} ./tests/${NAME}.c)
|
|
target_link_libraries(test_${NAME} PUBLIC mons_gltf)
|
|
add_test(
|
|
NAME ${NAME}
|
|
COMMAND $<TARGET_FILE:test_${NAME}>
|
|
)
|
|
endfunction()
|
|
|