-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (58 loc) · 2.21 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
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.16)
project(QMuJoCoSim
VERSION 0.1.0
DESCRIPTION "A simple MuJoCo simulator implemented in Qt"
HOMEPAGE_URL "https://github.com/hesic73/QMuJoCoSim"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_path(MUJOCO_INCLUDE_DIR NAMES mujoco/mujoco.h HINTS ${CMAKE_PREFIX_PATH}/include)
if (NOT MUJOCO_INCLUDE_DIR)
message(FATAL_ERROR "MuJoCo headers not found. Please specify the MuJoCo directory using -DCMAKE_PREFIX_PATH.")
endif ()
# Find MuJoCo Library
find_library(MUJOCO_LIBRARY NAMES mujoco libmujoco HINTS ${CMAKE_PREFIX_PATH}/lib)
if (NOT MUJOCO_LIBRARY)
message(FATAL_ERROR "MuJoCo library not found. Please specify the MuJoCo directory using -DCMAKE_PREFIX_PATH.")
endif ()
# Include the MuJoCo headers
include_directories(${MUJOCO_INCLUDE_DIR}
src)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets OpenGL OpenGLWidgets)
qt_standard_project_setup()
qt_add_executable(QMuJoCoSim
src/main.cpp
src/mainwindow.hpp
src/mujoco_opengl_window.hpp
src/my_window_container.hpp
src/panel_sections/collapsible_section.h
src/panel_sections/collapsible_section.cpp
src/control_panel.hpp
src/panel_sections/rendering_section.hpp
src/custom_widgets/toggling_button.hpp
src/core/simulation_worker.hpp
src/core/history_buffer.hpp
src/panel_sections/simulation_section.hpp
src/custom_widgets/label_slider.hpp
src/settings_dialog.hpp
src/custom_widgets/directory_selector.hpp
src/core/profiler.hpp
src/utils.cpp
src/utils.h
)
qt_add_resources(QMuJoCoSim "resources" # This is an arbitrary identifier
PREFIX "/" # This is the prefix you'll use to access the resources
FILES assets/icon.png) # List of files to add; adjust paths as necessary
target_link_libraries(QMuJoCoSim PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::OpenGL
Qt6::OpenGLWidgets
${MUJOCO_LIBRARY}
)
enable_testing()
# Assuming Catch2 is a submodule or already present in your project
add_subdirectory(Catch2)
# Add test subdirectory
add_subdirectory(test)