When script reach return() https://github.com/PointCloudLibrary/pcl/blob/f9cbe14c9d0ccf07401606b3d3482066e2a5efda/PCLConfig.cmake.in#L475
it skipes cmake_policy(POP) at the end of script - producing this error when building cloudcompare:
/usr/share/pcl-1.9/PCLConfig.cmake(523): if(NOT PCL_TO_FIND_COMPONENTS )
/usr/share/pcl-1.9/PCLConfig.cmake(524): return()
/usr/share/pcl-1.9/PCLConfig.cmake(9999): CGAL_run_at_the_end_of_configuration(CMAKE_CURRENT_LIST_DIR MODIFIED_ACCESS /build/cloudcompare-git/src/cloudcompare/plugins/core/qPCL/PclUtils /build/cloudcompare-git/src/cloudcompare/plugins/core/qPCL/PclUtils/CMakeLists.txt /build/cloudcompare-git/src/cloudcompare/plugins/core/qPCL/PclUtils/CMakeLists.txt;/usr/share/pcl-1.9/PCLConfig.cmake )
/usr/lib/cmake/CGAL/CGAL_enable_end_of_configuration_hook.cmake(17): if(NOT access STREQUAL MODIFIED_ACCESS OR value )
/usr/lib/cmake/CGAL/CGAL_enable_end_of_configuration_hook.cmake(20): return()
CMake Error in /usr/share/pcl-1.9/PCLConfig.cmake:
cmake_policy PUSH without matching POP
Call Stack (most recent call first):
plugins/core/qPCL/PclUtils/CMakeLists.txt:4 (find_package)
_Originally posted by @bartoszek in https://github.com/PointCloudLibrary/pcl/pull/2454#issuecomment-439631730_
Just insert cmake_policy(POP) before each return() and it's done.
@PointCloudLibrary/maintainers it's probably a good idea to push a 1.9.1 with this fix.
@SergioRAgostinho I was going to suggest the same. Good that we haven't activated C++14 yet.
I was only thinking cherry picking this commit but I understand your comment now. All commits since release have been on CMake only so in theory we can release a patch version with the current master.
I'll open the release issue.
Most helpful comment
Just insert
cmake_policy(POP)before eachreturn()and it's done.