42 lines
1.1 KiB
CMake
42 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.14)
|
|
project(mons_3d LANGUAGES C)
|
|
set(CMAKE_C_STANDARD 99)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
add_library(mons_3d
|
|
SHARED
|
|
./src/mesh.c
|
|
./src/color.c
|
|
./src/model.c
|
|
./src/shader.c
|
|
./src/texture.c
|
|
./src/transform.c
|
|
./src/projection.c
|
|
./external/glad/src/gl.c
|
|
./external/glad/src/glx.c
|
|
./external/mikktspace/src/mikktspace.c
|
|
)
|
|
|
|
target_include_directories(mons_3d PUBLIC
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/include"
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/external/glad/include"
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/external/mikktspace/include"
|
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
|
)
|
|
target_compile_options(mons_3d PRIVATE -coverage)
|
|
target_link_options(mons_3d PRIVATE -coverage)
|
|
target_link_libraries(mons_3d PUBLIC mons_collections mons_math mons_image)
|
|
|
|
include(CTest)
|
|
|
|
function(TESTCASE NAME)
|
|
add_executable(test_${NAME} ./tests/${NAME}.c)
|
|
target_link_libraries(test_${NAME} PUBLIC mons_3d)
|
|
add_test(
|
|
NAME ${NAME}
|
|
COMMAND $<TARGET_FILE:test_${NAME}>
|
|
)
|
|
endfunction()
|
|
|