vcpkgpcl

How do I build PCL with VCPKG without it defining PCL_ONLY_CORE_POINT_TYPES


The CMakeLists.txt in the .\vcpkg\buildtrees\pcl\src\pcl-1.13.1-38090574eb.clean folder defines PCL_ONLY_CORE_POINT_TYPES by default, for both MSVC and MINGW. But I need to build PCL for all point types.

If I edit the CMakeLists.txt file to remove the declaration...

  add_definitions("-DBOOST_ALL_NO_LIB -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX ${SSE_DEFINITIONS}")
  #add_definitions("-DBOOST_ALL_NO_LIB -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -DPCL_ONLY_CORE_POINT_TYPES ${SSE_DEFINITIONS}")

...and run VCPKG using the --editable option...

.\vcpkg install pcl[vtk]:x64-windows --featurepackages --recurse --editable pcl

...I get the following build error...

-- Configuring x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: C:/dev/vcpkg/downloads/tools/cmake-3.27.1-windows/cmake-3.27.1-windows-i386/bin/cmake.exe --build . --config Debug --target install -- -v -j17
    Working Directory: C:/dev/vcpkg/buildtrees/pcl/x64-windows-dbg
    See logs for more information:
      C:\dev\vcpkg\buildtrees\pcl\install-x64-windows-dbg-out.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/pcl/portfile.cmake:74 (vcpkg_cmake_install)
  scripts/ports.cmake:168 (include)

How do I get around this problem?


Solution

  • You did not post install-x64-windows-dbg-out.log mentioned in the error message, so I can't say for sure, but it might be that there are too many symbols to handle for the MSVC linker. Related: https://github.com/PointCloudLibrary/pcl/issues/5928
    Why do you need to build PCL for all point types? I.e. which point type do you need that is not contained in the library otherwise? Using #define PCL_NO_PRECOMPILE might be a solution for you.