From 3ef158469245e2c3b90c639f1dbb80c379423094 Mon Sep 17 00:00:00 2001 From: Sergio Agostinho Date: Tue, 4 Jul 2017 13:13:01 +0100 Subject: [PATCH 1/2] fix issue with finding pcl deployed out of path --- PCLConfig.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in index f3089dfec1b..612061cfaf2 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in @@ -717,7 +717,11 @@ if(WIN32 AND NOT MINGW) get_filename_component(PCL_ROOT "${PCL_DIR}" PATH) else(WIN32 AND NOT MINGW) # PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y - set(PCL_ROOT "@CMAKE_INSTALL_PREFIX@") + if("${PCL_DIR}" STREQUAL "") + set(PCL_ROOT "@CMAKE_INSTALL_PREFIX@") + else("${PCL_DIR}" STREQUAL "") + get_filename_component(PCL_ROOT "${PCL_DIR}/../.." ABSOLUTE) + endif("${PCL_DIR}" STREQUAL "") endif(WIN32 AND NOT MINGW) # check whether PCLConfig.cmake is found into a PCL installation or in a build tree From 6974db396e4f20e9156ad060d34348606c835ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Agostinho?= Date: Tue, 4 Jul 2017 14:47:21 +0100 Subject: [PATCH 2/2] The path is set relative to PCLConfig.cmake --- PCLConfig.cmake.in | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in index 612061cfaf2..f4ef6a0ffd2 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in @@ -717,11 +717,7 @@ if(WIN32 AND NOT MINGW) get_filename_component(PCL_ROOT "${PCL_DIR}" PATH) else(WIN32 AND NOT MINGW) # PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y - if("${PCL_DIR}" STREQUAL "") - set(PCL_ROOT "@CMAKE_INSTALL_PREFIX@") - else("${PCL_DIR}" STREQUAL "") - get_filename_component(PCL_ROOT "${PCL_DIR}/../.." ABSOLUTE) - endif("${PCL_DIR}" STREQUAL "") + get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) endif(WIN32 AND NOT MINGW) # check whether PCLConfig.cmake is found into a PCL installation or in a build tree