Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Right order for unset
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Mar 1, 2024
1 parent b53ab18 commit c90950f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drake-extras.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
# installed under the root of the ROS installation + /opt/drake
# (i.e /opt/ros/rolling/opt/drake ).

# drake_DIR will return the absolute path to the ROS package
# of drake (share/drake/cmake under the ROS root installation)
# The relative path should drive us to the root of the drake
# upstream installation done under ROS.
set(drake_path "${drake_DIR}/../../../opt/drake")


# Since the upstream installation has the same CMake module name
# than the ROS package we need to unset the cache variable
# that points to the ROS package to be sure to force the
# find_package to find the drake config module under the
# paths
unset(drake_DIR CACHE)

# drake_DIR will return the absolute path to the ROS package
# of drake (share/drake/cmake under the ROS root installation)
# The relative path should drive us to the root of the drake
# upstream installation done under ROS.
set(drake_path "${drake_DIR}/../../../opt/drake")

message(STATUS "drake_path: ${drake_path}")
get_filename_component(abs_path ${drake_path} ABSOLUTE)
message(STATUS "Absolute path of drake_path: ${abs_path}")
find_package(drake PATHS ${drake_path} NO_DEFAULT_PATH)

0 comments on commit c90950f

Please sign in to comment.