I'm using a Ubuntu 16.04 and CMake's ExternalProject_Add
to install both the software PCL and PDAL for my own project.
I want to link PDAL and PCL as PDAL have an option to build PCL as an plugin. Basically my CMake script for PCL will execute first to install PCL under at a specific path (example) build/src/pcl
. Then PDAL will install next and look for PCL to link as plugin. My CMake script for PDAL is
set(_proj_name pdal)
set(_SB_BINARY_DIR "${SB_BINARY_DIR}/${_proj_name}")
ExternalProject_Add(${_proj_name}
DEPENDS pcl
PREFIX ${_SB_BINARY_DIR}
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
URL https://github.com/PDAL/PDAL/archive/1.7.2.tar.gz
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name}
CMAKE_ARGS
-DBUILD_PLUGIN_PCL=ON
-DBUILD_PLUGIN_PGPOINTCLOUD=OFF
-DBUILD_PLUGIN_CPD=OFF
-DBUILD_PLUGIN_GREYHOUND=OFF
-DBUILD_PLUGIN_ICEBRIDGE=OFF
-DBUILD_PLUGIN_SQLITE=OFF
-DBUILD_PLUGIN_RIVLIB=OFF
-DBUILD_PLUGIN_PYTHON=OFF
-DENABLE_CTEST=OFF
-DWITH_APPS=ON
-DWITH_LAZPERF=OFF
-DWITH_TESTS=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_DIR}
#--Build step-----------------
BINARY_DIR ${_SB_BINARY_DIR}
#--Install step---------------
INSTALL_DIR ${SB_INSTALL_DIR}
)
The PDAL CMake script was able to detect that the option of building PCL plugin is enabled, but it tried to look for the PCL functions and library under usr/lib/
or usr/share/local
.
What other CMake arguments can I include to get the PDAL CMake script to look for the PCL under build/src/pcl
instead?
I have tried to include DPCL_DIR = build/src/pcl
and DCMAKE_PREFIX_PATH = build/src/pcl
but to no avail. Any help or guidance towards the right direction is appreciated!