rbdlsim/CMakeLists.txt

83 lines
2.5 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
# 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)
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>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/include>)
target_link_libraries(${PROJECT_NAME} rbdl ccd)
target_sources(${PROJECT_NAME} PRIVATE src/rbdlsim.cc)
# 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})
target_sources(runsim PRIVATE src/main.cc)
# 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>
)
target_link_libraries(vissim ${PROJECT_NAME} glfw)
target_sources(vissim PRIVATE
src/utils.cc
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
)
2020-10-03 22:55:14 +02:00
# Tests
add_executable(runtests)
target_sources(runtests PRIVATE tests/runtests.cc tests/CollisionTests.cc)
target_include_directories(
runtests
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(runtests ${PROJECT_NAME})