From a13d31296a8cbe7b0d9e5e2ad440e826e8a3b553 Mon Sep 17 00:00:00 2001 From: ThomasDuvinage Date: Mon, 25 Nov 2024 16:49:13 +0900 Subject: [PATCH] [ros2] update package path to find package description --- src/mc_rtcMacros.in.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mc_rtcMacros.in.cmake b/src/mc_rtcMacros.in.cmake index b51f256194..e59ec2be63 100644 --- a/src/mc_rtcMacros.in.cmake +++ b/src/mc_rtcMacros.in.cmake @@ -235,10 +235,14 @@ macro(find_description_package PACKAGE) find_package(${PACKAGE} REQUIRED) if("${${PACKAGE}_INSTALL_PREFIX}" STREQUAL "") if("${${PACKAGE}_SOURCE_PREFIX}" STREQUAL "") - message( - FATAL_ERROR - "Your ${PACKAGE} does not define where to find the data, please update." - ) + if("${${PACKAGE}_DIR}" STREQUAL "") + message( + FATAL_ERROR + "Your ${PACKAGE} does not define where to find the data, please update." + ) + else() + set(${PACKAGE_PATH_VAR} "${${PACKAGE}_DIR}/..") + endif() else() set(${PACKAGE_PATH_VAR} "${${PACKAGE}_SOURCE_PREFIX}") endif()