-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
62 lines (50 loc) · 2.03 KB
/
CMakeLists.txt
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
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.8)
project(rig_reconfigure)
set(CMAKE_CXX_STANDARD 20)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
# Download imgui
include(FetchContent)
FetchContent_Declare(imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.89.8-docking
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
)
FetchContent_MakeAvailable(imgui)
add_library(imgui STATIC
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
${imgui_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp
)
target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends)
find_package(glfw3 3.3 REQUIRED)
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
target_link_libraries(imgui PUBLIC glfw OpenGL::GL)
add_executable(${PROJECT_NAME} src/rig_reconfigure.cpp src/service_wrapper.cpp src/parameter_tree.cpp
src/utils.cpp src/node_window.cpp src/parameter_window.cpp external/lodepng/lodepng.cpp)
# uncomment for checking the executable with tsan
#target_compile_options(${PROJECT_NAME} PRIVATE -g -fsanitize=thread)
#target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=thread)
target_include_directories(${PROJECT_NAME} PRIVATE include external/lodepng)
target_link_libraries(${PROJECT_NAME} imgui rclcpp::rclcpp ament_index_cpp::ament_index_cpp)
install(TARGETS ${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME}
)
install(FILES resource/rig_reconfigure.png resource/rig_reconfigure_text.png
DESTINATION share/${PROJECT_NAME}/resource
)
install(FILES resource/rig_reconfigure.svg
DESTINATION share/icons/hicolor/scalable/apps
)
install(FILES resource/rig_reconfigure.desktop
DESTINATION share/applications
)
ament_package()