cmake_minimum_required (VERSION 3.13) cmake_policy(SET CMP0077 NEW) project (rbdlsim VERSION 0.0.1 LANGUAGES CXX C) find_package(Threads) # RBDL set(RBDL_USE_SIMPLE_MATH On) add_subdirectory (3rdparty/rbdl) # libccd set(ENABLE_DOUBLE_PRECISION On) add_subdirectory (3rdparty/libccd) # 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) # Tracy add_library(TracyClient) target_compile_definitions(TracyClient PRIVATE TRACY_ENABLE=1) target_include_directories( TracyClient PUBLIC $) target_sources(TracyClient PRIVATE 3rdparty/tracy/TracyClient.cpp) target_link_libraries(TracyClient PUBLIC ${CMAKE_THREAD_LIBS_INIT} "-ldl") # Library add_library(${PROJECT_NAME}) target_include_directories( ${PROJECT_NAME} PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ ) target_compile_definitions(${PROJECT_NAME} PRIVATE TRACY_ENABLE=1) target_link_libraries(${PROJECT_NAME} rbdl ccd TracyClient) target_sources(${PROJECT_NAME} PRIVATE src/rbdlsim.cc src/utils.cc) # Simulator Executable add_executable(runsim) target_include_directories( runsim PUBLIC $ PUBLIC $ PUBLIC $) target_link_libraries(runsim ${PROJECT_NAME}) target_sources(runsim PRIVATE src/main.cc src/utils.cc) # Visualization add_executable(vissim) target_include_directories( vissim PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ ) target_compile_definitions(vissim PUBLIC TRACY_ENABLE=1) target_link_libraries(vissim ${PROJECT_NAME} glfw) target_sources(vissim PRIVATE src/srender.c 3rdparty/glfw/deps/glad_gl.c 3rdparty/imgui/imgui.cpp 3rdparty/imgui/imgui_draw.cpp 3rdparty/imgui/imgui_widgets.cpp 3rdparty/imgui/imgui_demo.cpp 3rdparty/imgui/backends/imgui_impl_glfw.cpp 3rdparty/imgui/backends/imgui_impl_opengl3.cpp 3rdparty/ImGuizmo/ImGuizmo.cpp src/vissim.cc src/sthstry.c src/simulator.cc src/render_utils.c ) # Tests add_executable(runtests) target_sources(runtests PRIVATE tests/runtests.cc tests/CollisionTests.cc src/utils.cc src/sconvcol.c tests/sconvcolTests.cc) target_include_directories( runtests PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ PUBLIC $ ) target_link_libraries(runtests ${PROJECT_NAME})