rbdlsim/CMakeLists.txt

105 lines
3.4 KiB
CMake
Raw Normal View History

2020-10-16 11:08:26 +02:00
cmake_minimum_required (VERSION 3.13)
2020-10-03 22:55:14 +02:00
cmake_policy(SET CMP0077 NEW)
project (rbdlsim
VERSION 0.0.1
LANGUAGES CXX C)
2020-10-03 22:55:14 +02:00
2021-08-06 12:10:32 +02:00
find_package(Threads)
# RBDL
2020-10-03 22:55:14 +02:00
set(RBDL_USE_SIMPLE_MATH On)
add_subdirectory (3rdparty/rbdl)
# libccd
set(ENABLE_DOUBLE_PRECISION On)
2020-10-03 22:55:14 +02:00
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)
2021-08-06 12:10:32 +02:00
# Tracy
add_library(TracyClient)
target_compile_definitions(TracyClient
PRIVATE TRACY_ENABLE=1)
target_include_directories(
TracyClient
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tracy>)
target_sources(TracyClient PRIVATE 3rdparty/tracy/TracyClient.cpp)
target_link_libraries(TracyClient PUBLIC ${CMAKE_THREAD_LIBS_INIT} "-ldl")
2020-10-03 22:55:14 +02:00
# Library
add_library(${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/rbdl/include>
2021-08-06 12:10:32 +02:00
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tracy>
)
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)
2020-10-03 22:55:14 +02:00
# Simulator Executable
add_executable(runsim)
target_include_directories(
runsim
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/rbdl/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/include>)
target_link_libraries(runsim ${PROJECT_NAME})
2020-11-25 17:05:29 +01:00
target_sources(runsim PRIVATE src/main.cc src/utils.cc)
2020-10-03 22:55:14 +02:00
# Visualization
add_executable(vissim)
target_include_directories(
vissim
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/rbdl/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glfw/deps>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/imgui>
2020-10-17 22:09:41 +02:00
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/vectorial/include>
2021-08-06 12:10:32 +02:00
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tracy>
)
target_compile_definitions(vissim PUBLIC TRACY_ENABLE=1)
target_link_libraries(vissim ${PROJECT_NAME} glfw)
target_sources(vissim PRIVATE
2020-10-17 22:09:41 +02:00
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
src/vissim.cc
src/sthstry.c
2020-11-02 21:07:26 +01:00
src/simulator.cc
)
2020-10-03 22:55:14 +02:00
# Tests
add_executable(runtests)
target_sources(runtests PRIVATE tests/runtests.cc tests/CollisionTests.cc
src/utils.cc src/sconvcol.c tests/sconvcolTests.cc)
2020-10-03 22:55:14 +02:00
target_include_directories(
runtests
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
2020-11-08 12:49:43 +01:00
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
2020-10-03 22:55:14 +02:00
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/rbdl/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/vectorial/include>
)
2020-10-03 22:55:14 +02:00
target_link_libraries(runtests ${PROJECT_NAME})