From f9e6efac2e0aed621f0c04bc8ce30ee91e1f7722 Mon Sep 17 00:00:00 2001 From: Peter Lama Date: Wed, 29 Oct 2014 21:23:23 -0700 Subject: [PATCH] Fix building FreeCAD with PCL PCLConfig also calls find_package for boost, but with different components --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index beb1a1685e91..4be157d65f1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,6 +161,7 @@ else(MSVC) set(FREECAD_USE_3DCONNEXION OFF) OPTION(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON) OPTION(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF) +OPTION(FREECAD_USE_PCL "Build the features that use PCL libs" OFF) endif(MSVC) # if this is set override some options @@ -389,7 +390,12 @@ else(FREECAD_LIBPACK_USE) MESSAGE("Python not found, install python!") ENDIF(NOT PYTHONLIBS_FOUND) - +# -------------------------------- pcl ---------------------------------- + #PCL needs to be found before boost because the PCLConfig also calls find_package(Boost ...), + #but with different components + if(FREECAD_USE_PCL) + find_package(PCL REQUIRED COMPONENTS common kdtree features surface io) + endif(FREECAD_USE_PCL) # -------------------------------- Boost -------------------------------- @@ -527,13 +533,6 @@ else(FREECAD_LIBPACK_USE) find_package(Eigen3) -# -------------------------------- pcl ---------------------------------- - - find_package(PCL QUIET COMPONENTS common kdtree features surface io) - if (NOT PCL_FOUND) - MESSAGE("-- pcl not found") - endif(NOT PCL_FOUND) - # -------------------------------- ODE ---------------------------------- # find_package(ODE)