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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
diff -Naur src.old/mujoco-3.2.2/cmake/MujocoDependencies.cmake src.new/mujoco-3.2.2/cmake/MujocoDependencies.cmake
--- src.old/mujoco-3.2.2/cmake/MujocoDependencies.cmake 2024-08-24 11:08:40.096456726 +0200
+++ src.new/mujoco-3.2.2/cmake/MujocoDependencies.cmake 2024-08-24 11:44:17.035325068 +0200
@@ -90,6 +90,7 @@
CACHE INTERNAL "Build SHARED libraries"
)
+find_package(lodepng REQUIRED)
if(NOT TARGET lodepng)
FetchContent_Declare(
lodepng
@@ -128,9 +129,9 @@
findorfetch(
USE_SYSTEM_PACKAGE
- OFF
+ ON
PACKAGE_NAME
- qhull
+ Qhull
LIBRARY_NAME
qhull
GIT_REPO
@@ -141,18 +142,23 @@
qhull
EXCLUDE_FROM_ALL
)
-# MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories.
-# Add it to the target.
-target_include_directories(
- qhullstatic_r INTERFACE $<BUILD_INTERFACE:${qhull_SOURCE_DIR}/src/libqhull_r>
-)
-target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
+if(NOT TARGET qhullstatic_r)
+ add_library(qhullstatic_r INTERFACE)
+ target_link_libraries(qhullstatic_r INTERFACE Qhull::qhull_r)
+ # Workaround as headers are installed in <prefix>/include/libqhull_r/something.h
+ # but mujoco include them as #include <something.h>
+ get_property(qhull_include_dirs TARGET Qhull::qhull_r PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ foreach(qhull_include_dir IN LISTS qhull_include_dirs)
+ target_include_directories(qhullstatic_r INTERFACE ${qhull_include_dirs}/libqhull_r)
+ endforeach()
+ target_include_directories(qhullstatic_r INTERFACE )
+endif()
+find_package(tinyxml2 REQUIRED)
set(tinyxml2_BUILD_TESTING OFF)
findorfetch(
USE_SYSTEM_PACKAGE
- OFF
+ ON
PACKAGE_NAME
tinyxml2
LIBRARY_NAME
@@ -165,8 +171,6 @@
tinyxml2
EXCLUDE_FROM_ALL
)
-target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
findorfetch(
USE_SYSTEM_PACKAGE
@@ -202,8 +206,6 @@
SdfLib
EXCLUDE_FROM_ALL
)
-target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
set(ENABLE_DOUBLE_PRECISION ON)
set(CCD_HIDE_ALL_SYMBOLS ON)
@@ -249,7 +251,7 @@
set(ABSL_BUILD_TESTING OFF)
findorfetch(
USE_SYSTEM_PACKAGE
- OFF
+ ON
PACKAGE_NAME
absl
LIBRARY_NAME
@@ -310,7 +312,7 @@
findorfetch(
USE_SYSTEM_PACKAGE
- OFF
+ ON
PACKAGE_NAME
benchmark
LIBRARY_NAME
@@ -329,6 +331,9 @@
if(MUJOCO_TEST_PYTHON_UTIL)
add_compile_definitions(EIGEN_MPL2_ONLY)
+ find_package(Eigen3 REQUIRED)
+ # Doing that so the next if is not triggered
+ add_library(eigen ALIAS Eigen3::Eigen)
if(NOT TARGET eigen)
# Support new IN_LIST if() operator.
set(CMAKE_POLICY_DEFAULT_CMP0057 NEW)
diff -Naur src.old/mujoco-3.2.2/sample/cmake/SampleDependencies.cmake src.new/mujoco-3.2.2/sample/cmake/SampleDependencies.cmake
--- src.old/mujoco-3.2.2/sample/cmake/SampleDependencies.cmake 2024-08-24 11:08:40.109789958 +0200
+++ src.new/mujoco-3.2.2/sample/cmake/SampleDependencies.cmake 2024-08-24 10:56:07.838915940 +0200
@@ -22,12 +22,12 @@
endif()
option(MUJOCO_SAMPLES_USE_SYSTEM_MUJOCO "Use installed MuJoCo version."
- ${DEFAULT_USE_SYSTEM_MUJOCO}
+ ON
)
unset(DEFAULT_USE_SYSTEM_MUJOCO)
-option(MUJOCO_SAMPLES_USE_SYSTEM_MUJOCO "Use installed MuJoCo version." OFF)
-option(MUJOCO_SAMPLES_USE_SYSTEM_GLFW "Use installed GLFW version." OFF)
+option(MUJOCO_SAMPLES_USE_SYSTEM_MUJOCO "Use installed MuJoCo version." ON)
+option(MUJOCO_SAMPLES_USE_SYSTEM_GLFW "Use installed GLFW version." ON)
set(MUJOCO_DEP_VERSION_glfw3
7482de6071d21db77a7236155da44c172a7f6c9e # 3.3.8
@@ -59,7 +59,7 @@
)
option(MUJOCO_EXTRAS_STATIC_GLFW
- "Link MuJoCo sample apps and simulate libraries against GLFW statically." ON
+ "Link MuJoCo sample apps and simulate libraries against GLFW statically." OFF
)
if(MUJOCO_EXTRAS_STATIC_GLFW)
set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
diff -Naur src.old/mujoco-3.2.2/simulate/cmake/SimulateDependencies.cmake src.new/mujoco-3.2.2/simulate/cmake/SimulateDependencies.cmake
--- src.old/mujoco-3.2.2/simulate/cmake/SimulateDependencies.cmake 2024-08-24 11:08:40.109789958 +0200
+++ src.new/mujoco-3.2.2/simulate/cmake/SimulateDependencies.cmake 2024-08-24 10:56:46.058614877 +0200
@@ -22,12 +22,12 @@
endif()
option(MUJOCO_SIMULATE_USE_SYSTEM_MUJOCO "Use installed MuJoCo version."
- ${DEFAULT_USE_SYSTEM_MUJOCO}
+ ON
)
unset(DEFAULT_USE_SYSTEM_MUJOCO)
-option(MUJOCO_SIMULATE_USE_SYSTEM_MUJOCO "Use installed MuJoCo version." OFF)
-option(MUJOCO_SIMULATE_USE_SYSTEM_GLFW "Use installed GLFW version." OFF)
+option(MUJOCO_SIMULATE_USE_SYSTEM_MUJOCO "Use installed MuJoCo version." ON)
+option(MUJOCO_SIMULATE_USE_SYSTEM_GLFW "Use installed GLFW version." ON)
set(MUJOCO_DEP_VERSION_glfw3
7482de6071d21db77a7236155da44c172a7f6c9e # 3.3.8
@@ -59,7 +59,7 @@
)
option(MUJOCO_EXTRAS_STATIC_GLFW
- "Link MuJoCo sample apps and simulate libraries against GLFW statically." ON
+ "Link MuJoCo sample apps and simulate libraries against GLFW statically." OFF
)
if(MUJOCO_EXTRAS_STATIC_GLFW)
set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
|