Skip to content

Commit

Permalink
Migrate install dirs
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed May 20, 2022
1 parent 4237dd7 commit 6b0ec66
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ ign_find_package(IgnBullet

message(STATUS "-------------------------------------------\n")

set(IGNITION_PHYSICS_RESOURCE_DIR "${CMAKE_SOURCE_DIR}/resources")
set(GZ_PHYSICS_RESOURCE_DIR "${CMAKE_SOURCE_DIR}/resources")

# Plugin install dirs
set(IGNITION_PHYSICS_ENGINE_INSTALL_DIR
set(GZ_PHYSICS_ENGINE_INSTALL_DIR
${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/ign-${IGN_DESIGNATION}-${PROJECT_VERSION_MAJOR}/engine-plugins
)

Expand Down
12 changes: 6 additions & 6 deletions bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ target_link_libraries(${bullet_plugin}
ignition-math${IGN_MATH_VER}::eigen3)

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${bullet_plugin} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# Install redirection headers
install(
Expand All @@ -41,14 +41,14 @@ if (WIN32)
# disable MSVC inherit via dominance warning
target_compile_options(${bullet_plugin} PUBLIC "/wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})
endif()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# Testing
ign_build_tests(
Expand All @@ -67,7 +67,7 @@ foreach(test ${tests})
target_compile_definitions(${test} PRIVATE
"bullet_plugin_LIB=\"$<TARGET_FILE:${bullet_plugin}>\""
"TEST_WORLD_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/worlds/\""
"IGNITION_PHYSICS_RESOURCE_DIR=\"${IGNITION_PHYSICS_RESOURCE_DIR}\"")
"GZ_PHYSICS_RESOURCE_DIR=\"${GZ_PHYSICS_RESOURCE_DIR}\"")

endforeach()

Expand Down
10 changes: 5 additions & 5 deletions dartsim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ else()
endif()

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${dartsim_plugin} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
install(TARGETS ${dartsim_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# The library created by `ign_add_component` includes the ign-physics version
# (i.e. libignition-physics1-name-plugin.so), but for portability,
Expand All @@ -70,11 +70,11 @@ if (WIN32)
# disable MSVC inherit via dominance warning
target_compile_options(${dartsim_plugin} PUBLIC "/wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})
endif()

# Testing
Expand All @@ -96,7 +96,7 @@ foreach(test ${tests})
target_compile_definitions(${test} PRIVATE
"dartsim_plugin_LIB=\"$<TARGET_FILE:${dartsim_plugin}>\""
"TEST_WORLD_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/worlds/\""
"IGNITION_PHYSICS_RESOURCE_DIR=\"${IGNITION_PHYSICS_RESOURCE_DIR}\"")
"GZ_PHYSICS_RESOURCE_DIR=\"${GZ_PHYSICS_RESOURCE_DIR}\"")

if (DART_HAS_CONTACT_SURFACE_HEADER)
target_compile_definitions(${test} PRIVATE DART_HAS_CONTACT_SURFACE)
Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/Collisions_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ TEST_P(Collisions_TEST, MeshAndPlane)
if (library.empty())
return;

const std::string meshFilename = IGNITION_PHYSICS_RESOURCE_DIR "/chassis.dae";
const std::string meshFilename = GZ_PHYSICS_RESOURCE_DIR "/chassis.dae";
auto &meshManager = *gz::common::MeshManager::Instance();
auto *mesh = meshManager.Load(meshFilename);

Expand Down
6 changes: 3 additions & 3 deletions dartsim/src/EntityManagement_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
meshLink->AttachFixedJoint(child, "fixed");

const std::string meshFilename = gz::common::joinPaths(
IGNITION_PHYSICS_RESOURCE_DIR, "chassis.dae");
GZ_PHYSICS_RESOURCE_DIR, "chassis.dae");
auto &meshManager = *gz::common::MeshManager::Instance();
auto *mesh = meshManager.Load(meshFilename);

Expand Down Expand Up @@ -211,7 +211,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
heightmapLink->AttachFixedJoint(child, "heightmap_joint");

auto heightmapFilename = gz::common::joinPaths(
IGNITION_PHYSICS_RESOURCE_DIR, "heightmap_bowl.png");
GZ_PHYSICS_RESOURCE_DIR, "heightmap_bowl.png");
gz::common::ImageHeightmap data;
EXPECT_EQ(0, data.Load(heightmapFilename));

Expand All @@ -238,7 +238,7 @@ TEST(EntityManagement_TEST, ConstructEmptyWorld)
demLink->AttachFixedJoint(child, "dem_joint");

auto demFilename = gz::common::joinPaths(
IGNITION_PHYSICS_RESOURCE_DIR, "volcano.tif");
GZ_PHYSICS_RESOURCE_DIR, "volcano.tif");
gz::common::Dem dem;
EXPECT_EQ(0, dem.Load(demFilename));

Expand Down
2 changes: 1 addition & 1 deletion include/gz/physics/config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define GZ_PHYSICS_VERSION "${PROJECT_VERSION}"
#define GZ_PHYSICS_VERSION_FULL "${PROJECT_VERSION_FULL}"

#define GZ_PHYSICS_ENGINE_INSTALL_DIR "${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}"
#define GZ_PHYSICS_ENGINE_INSTALL_DIR "${GZ_PHYSICS_ENGINE_INSTALL_DIR}"

#define GZ_PHYSICS_VERSION_HEADER "Gazebo Physics, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2017 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"

Expand Down
2 changes: 1 addition & 1 deletion test/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endforeach()
if (DART_FOUND)
target_link_libraries(MockDoublePendulum PUBLIC ${DART_LIBRARIES})
target_compile_definitions(MockDoublePendulum PRIVATE
"IGNITION_PHYSICS_RESOURCE_DIR=\"${IGNITION_PHYSICS_RESOURCE_DIR}\"")
"GZ_PHYSICS_RESOURCE_DIR=\"${GZ_PHYSICS_RESOURCE_DIR}\"")
if (MSVC)
# needed by DART, see https://github.com/dartsim/dart/issues/753
target_compile_options(MockDoublePendulum PUBLIC "/permissive-")
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/DARTDoublePendulum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace mock
lastId(0)
{
::dart::utils::DartLoader loader;
this->robot = loader.parseSkeleton(IGNITION_PHYSICS_RESOURCE_DIR "/rrbot.xml");
this->robot = loader.parseSkeleton(GZ_PHYSICS_RESOURCE_DIR "/rrbot.xml");
this->world->addSkeleton(this->robot);

this->joint1 = this->robot->getJoint("joint1");
Expand Down
10 changes: 5 additions & 5 deletions tpe/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ target_link_libraries(${tpe_plugin}
)

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${tpe_plugin} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
install(TARGETS ${tpe_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# The library created by `ign_add_component` includes the ign-physics version
# (i.e. libignition-physics1-name-plugin.so), but for portability,
Expand All @@ -43,11 +43,11 @@ if (WIN32)
# disable MSVC inherit via dominance warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${IGNITION_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_PHYSICS_ENGINE_INSTALL_DIR})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})
endif()

ign_build_tests(
Expand All @@ -67,6 +67,6 @@ foreach(test ${tests})
target_compile_definitions(${test} PRIVATE
"tpe_plugin_LIB=\"$<TARGET_FILE:${tpe_plugin}>\""
"TEST_WORLD_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/worlds/\""
"IGNITION_PHYSICS_RESOURCE_DIR=\"${IGNITION_PHYSICS_RESOURCE_DIR}\"")
"GZ_PHYSICS_RESOURCE_DIR=\"${GZ_PHYSICS_RESOURCE_DIR}\"")

endforeach()

0 comments on commit 6b0ec66

Please sign in to comment.