Pcl: cmake_policy(POP) occasionally skipped in PCLConfig.cmake

Created on 17 Nov 2018  路  4Comments  路  Source: PointCloudLibrary/pcl

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_

cmake

Most helpful comment

Just insert cmake_policy(POP) before each return() and it's done.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsravankumar1987 picture dsravankumar1987  路  4Comments

taketwo picture taketwo  路  3Comments

BjoB picture BjoB  路  4Comments

jacquelinekay picture jacquelinekay  路  5Comments

nh2 picture nh2  路  5Comments