From 0c84328f4549db8e00cac9a24fc7ea8d2997ae94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Agostinho?= Date: Sun, 25 Feb 2018 14:55:07 +0000 Subject: [PATCH] Prevent search for disabled optional dependencies in targets. --- cmake/pcl_pclconfig.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/pcl_pclconfig.cmake b/cmake/pcl_pclconfig.cmake index 60c16d7f157..777d049488b 100644 --- a/cmake/pcl_pclconfig.cmake +++ b/cmake/pcl_pclconfig.cmake @@ -37,7 +37,11 @@ foreach(_ss ${PCL_SUBSYSTEMS_MODULES}) if(_opt_deps) set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES}set(pcl_${_ss}_opt_dep ") foreach(_opt_dep ${_opt_deps}) - set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES}${_opt_dep} ") + string(TOUPPER "WITH_${_opt_dep}" _tmp) + string(REGEX REPLACE "-(.*)" "" _condition ${_tmp}) #libusb-1.0 case + if(${_condition}) + set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES}${_opt_dep} ") + endif() endforeach(_opt_dep) set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES})\n") endif(_opt_deps)