CMake updates for Studio integration
PiperOrigin-RevId: 929809674 Change-Id: Iabe670ced44f09fc1ea6d8dcde4b3c9ea4ad270a
This commit is contained in:
committed by
Copybara-Service
parent
edbe6a6f74
commit
6f6a72f66b
@@ -130,6 +130,66 @@ if(NOT TARGET mujoco)
|
||||
add_library(mujoco::mujoco ALIAS mujoco)
|
||||
endif()
|
||||
|
||||
# =================== MUJOCO PLATFORM STATIC LIBRARY ==========================
|
||||
if(NOT TARGET mujoco::platform)
|
||||
find_library(
|
||||
MUJOCO_PLATFORM_LIBRARY mujoco_platform HINTS ${MUJOCO_LIBRARY_DIR}
|
||||
)
|
||||
if(MUJOCO_PLATFORM_LIBRARY)
|
||||
message(STATUS "Found mujoco_platform library at ${MUJOCO_PLATFORM_LIBRARY}")
|
||||
add_library(mujoco_platform STATIC IMPORTED GLOBAL)
|
||||
set_target_properties(mujoco_platform PROPERTIES IMPORTED_LOCATION "${MUJOCO_PLATFORM_LIBRARY}")
|
||||
add_library(mujoco::platform ALIAS mujoco_platform)
|
||||
|
||||
set_target_properties(mujoco_platform PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${MUJOCO_INCLUDE};${MUJOCO_INCLUDE}/mujoco;${MUJOCO_INCLUDE}/SDL2"
|
||||
)
|
||||
target_compile_features(mujoco_platform INTERFACE cxx_std_20)
|
||||
|
||||
set(PLATFORM_DEPS)
|
||||
foreach(dep_lib IN ITEMS
|
||||
mujoco_filament
|
||||
dear_imgui
|
||||
implot
|
||||
filament
|
||||
backend
|
||||
SDL2
|
||||
glfw3
|
||||
image
|
||||
ktxreader
|
||||
utils
|
||||
math
|
||||
bluegl
|
||||
bluevk
|
||||
filabridge
|
||||
filaflat
|
||||
filamat
|
||||
matlang
|
||||
shaders
|
||||
smol-v
|
||||
glslang
|
||||
SPIRV
|
||||
SPIRV-Tools
|
||||
SPIRV-Tools-opt
|
||||
basis_encoder
|
||||
basis_transcoder
|
||||
zstd
|
||||
z
|
||||
)
|
||||
find_library(DEP_PATH_${dep_lib} ${dep_lib} HINTS ${MUJOCO_LIBRARY_DIR})
|
||||
if(DEP_PATH_${dep_lib})
|
||||
list(APPEND PLATFORM_DEPS "${DEP_PATH_${dep_lib}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
list(APPEND PLATFORM_DEPS pthread dl rt)
|
||||
endif()
|
||||
|
||||
set_target_properties(mujoco_platform PROPERTIES INTERFACE_LINK_LIBRARIES "${PLATFORM_DEPS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ==================== ABSEIL ==================================================
|
||||
set(MUJOCO_PYTHON_ABSL_TARGETS absl::core_headers absl::flat_hash_map absl::span)
|
||||
findorfetch(
|
||||
@@ -271,6 +331,7 @@ target_sources(
|
||||
structs.h
|
||||
)
|
||||
set_target_properties(structs_header PROPERTIES PUBLIC_HEADER structs.h)
|
||||
target_include_directories(structs_header INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(
|
||||
structs_header
|
||||
INTERFACE absl::flat_hash_map
|
||||
|
||||
Reference in New Issue
Block a user