AnimTestbed/CMakeLists.txt

113 lines
3.4 KiB
CMake

cmake_minimum_required(VERSION 3.13)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
project(AnimTestbed
VERSION 0.0.1
LANGUAGES CXX C)
find_package(Threads)
find_package(OpenGL REQUIRED)
# glfw
set(GLFW_BUILD_DOCS Off)
set(GLFW_BUILD_EXAMPLES Off)
set(GLFW_BUILD_TESTS Off)
set(GLFW_BUILD_INSTALL Off)
add_subdirectory(3rdparty/glfw)
# ozz
set(ozz_build_tools ON)
set(ozz_build_fbx OFF CACHE BOOL "")
set(ozz_build_gltf ON)
set(ozz_build_data OFF CACHE BOOL "")
set(ozz_build_samples OFF CACHE BOOL "")
set(ozz_build_howtos OFF CACHE BOOL "")
set(ozz_build_tests ON CACHE BOOL "")
set(ozz_build_simd_ref OFF CACHE BOOL "")
set(ozz_build_msvc_rt_dll OFF CACHE BOOL "")
add_subdirectory(3rdparty/ozz-animation)
set(ThirdPartyIncludeDeps
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glfw/deps>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glfw/deps>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/Handmade-Math>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/imgui>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/imnodes>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/ozz-animation/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/sokol>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/vectorial/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>
)
# Shared code by main executable and tests
add_library(AnimTestbedCode OBJECT
src/Camera.c
src/SkinnedMesh.cc
src/SkinnedMesh.h
src/SyncTrack.cc
src/SyncTrack.h
src/AnimNode.cc
src/AnimNodes/AnimSamplerNode.cc
src/AnimNodes/SpeedScaleNode.cc
src/AnimNodes/BlendSpace1D.cc
src/AnimNodes/BlendNode.cc
src/AnimNodes/LockTranslationNode.cc
src/AnimationController.cc
src/ozzutils.cc
3rdparty/imgui/imgui.cpp
3rdparty/imgui/imgui_draw.cpp
3rdparty/imgui/imgui_widgets.cpp
3rdparty/imnodes/imnodes.cpp
src/AnimGraphResource.cc
src/AnimGraphResource.h src/AnimGraphEditor.cc src/AnimGraphEditor.h)
target_include_directories(
AnimTestbedCode
PUBLIC
src
${ThirdPartyIncludeDeps}
)
target_compile_features(AnimTestbedCode PRIVATE cxx_std_17)
# AnimTestbed Executable
add_executable(AnimTestbed)
target_include_directories(
AnimTestbed
PUBLIC
${ThirdPartyIncludeDeps}
)
target_sources(AnimTestbed PRIVATE
src/main.cc
src/SkinnedMeshRenderer.cc
3rdparty/glfw/deps/glad_gl.c
3rdparty/imgui/imgui_demo.cpp
3rdparty/imgui/backends/imgui_impl_glfw.cpp
3rdparty/imgui/backends/imgui_impl_opengl3.cpp
)
target_link_libraries(AnimTestbed AnimTestbedCode glfw ozz_base ozz_geometry ozz_animation ${OPENGL_LIBRARIES})
# Tests
add_executable(runtests)
target_sources(runtests PRIVATE
tests/AnimGraphResourceTests.cc
tests/AnimSampleNodeTests.cc
tests/SyncTrackTests.cc
tests/main.cc
)
target_include_directories(
runtests
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
${ThirdPartyIncludeDeps}
)
target_compile_features(runtests PRIVATE cxx_std_17)
target_link_libraries(runtests AnimTestbedCode glfw ozz_base ozz_geometry ozz_animation)