File: CMakeLists.txt

package info (click to toggle)
dart 6.12.1%2Bdfsg4-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 57,000 kB
  • sloc: cpp: 269,461; python: 3,911; xml: 1,273; sh: 404; makefile: 30
file content (49 lines) | stat: -rw-r--r-- 1,275 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.10.2)

get_filename_component(example_name ${CMAKE_CURRENT_LIST_DIR} NAME)

project(${example_name})

set(TinyDNN_USE_SERIALIZER ON)
find_package(TinyDNN QUIET)
if(NOT TinyDNN_FOUND)
  if(DART_VERBOSE OR NOT DART_IN_SOURCE_BUILD)
    message(STATUS "Failed to find TinyDNN. glut_human_joint_limits is disabled.")
  endif()
  return()
endif()

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads QUIET)
if(NOT Threads_FOUND)
  if(DART_VERBOSE OR NOT DART_IN_SOURCE_BUILD)
    message(STATUS "Failed to find Threads. glut_human_joint_limits is disabled.")
  endif()
  return()
endif()

set(required_components utils-urdf gui collision-ode collision-bullet)
set(required_libraries
  dart
  dart-utils-urdf
  dart-gui
  dart-collision-ode
  dart-collision-bullet
  ${TinyDNN_LIBRARIES}
  Threads::Threads
)

if(DART_IN_SOURCE_BUILD)
  dart_build_example_in_source(${example_name}
    LINK_LIBRARIES ${required_libraries}
    COMPILE_FEATURES cxx_std_14
  )
  return()
endif()

find_package(DART 6.6.0 REQUIRED COMPONENTS ${required_components} CONFIG)

file(GLOB srcs "*.cpp" "*.hpp")
add_executable(${example_name} ${srcs})
target_link_libraries(${example_name} PUBLIC ${required_libraries})
target_compile_features(dart PUBLIC cxx_std_14)