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()