CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.89k stars 1.38k forks source link

compile pointmatch wrapper #5346

Closed 821736960 closed 3 years ago

821736960 commented 3 years ago

Sorry to bother.

Issue Details

I have installed CGAL 5.1.1 through vcpkg, openGR, libpointmatcher. And I want to compile the example: CGAL-5.1.2-examples-Point_set_processing_3.

For OpenGR wrapper, I just set OpenGR_DIR(at cmake-gui) as E:/OpenGR/build and the examples related to OpenGR can run well.

But for Libpointmatcher wrapper, I set (actually it set itself automatically) libpointmatcher_DIR(at cmake-gui) as E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build , and the complile is failed.

Source Code

Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
Visual Leak Detector (VLD) is not found.
Using header-only CGAL
Targetting Visual Studio 16 2019
Target build enviroment supports auto-linking
Using VC toolset 142.
Generator uses intermediate configuration directory: $(Configuration)
Boost include dirs: E:/vcpkg/installed/x64-windows/include
Boost libraries:    
USING DEBUG CXXFLAGS   = '/DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1'
USING DEBUG EXEFLAGS   = '/machine:x64 /debug /INCREMENTAL'
USING RELEASE CXXFLAGS = '/DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG'
USING RELEASE EXEFLAGS = '/machine:x64 /INCREMENTAL:NO'
NOTICE : the LAS reader test requires LASlib and will not be compiled.
CMake Error at E:/vcpkg/installed/x64-windows/share/cgal/CGAL_pointmatcher_support.cmake:3 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  CMakeLists.txt:94 (include)

Configuring incomplete, errors occurred!
See also "E:/CGAL-5.1.2-examples/CGAL-5.1.2/examples/Point_set_processing_3/tt/CMakeFiles/CMakeOutput.log".
See also "E:/CGAL-5.1.2-examples/CGAL-5.1.2/examples/Point_set_processing_3/tt/CMakeFiles/CMakeError.log".

Environment

Operating system (Windows/64 bits): Compiler: VS 2019, Cmake CGAL version: 5.1.1

sgiraudot commented 3 years ago

@maxGimeno just has just spend some time on this and could not reproduce the issue.

What version of CMake do you use? Also, can you show the content of the generated libpointmatcherConfig.cmake in the build dir of pointmatcher?

821736960 commented 3 years ago

@maxGimeno just has just spend some time on this and could not reproduce the issue.

What version of CMake do you use? Also, can you show the content of the generated libpointmatcherConfig.cmake in the build dir of pointmatcher?

My cmake version is 3.17.2. And I install libpointmatcher following its official instructions in github. And the CMAKE_CONFIGURATION_TYPES is RelWithDebInfo The content of libpointmatcherConfig.cmake is

# - Config file for the libpointmatcher package
# It defines the following variables
#  libpointmatcher_INCLUDE_DIRS - include directories for pointmatcher
#  libpointmatcher_LIBRARIES    - libraries to link against

# Compute paths
get_filename_component(POINTMATCHER_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(libpointmatcher_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")
set(LIBPOINTMATCHER_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")
set(pointmatcher_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")
set(POINTMATCHER_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")

set(libpointmatcher_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")
set(LIBPOINTMATCHER_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")
set(pointmatcher_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")
set(POINTMATCHER_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")

# This causes catkin simple to link against these libraries
set(libpointmatcher_FOUND_CATKIN_PROJECT true)
set(LIBPOINTMATCHER_FOUND_CATKIN_PROJECT true)
set(pointmatcher_FOUND_CATKIN_PROJECT true)
set(POINTMATCHER_FOUND_CATKIN_PROJECT true)
maxGimeno commented 3 years ago

You could try building the shared libs instead of the default static libs. Try rerunning cmake with -DBUILD_SHARED_LIBS=ON and re-building libpointmatcher.

821736960 commented 3 years ago

You could try building the shared libs instead of the default static libs. Try rerunning cmake with -DBUILD_SHARED_LIBS=ON and re-building libpointmatcher.

I tried to add BUILD_SHARED_LIBS=ON at cmake-gui when compile libpointmatcher. But it even can not compile successfully.

maxGimeno commented 3 years ago

can you share the errors you get ?

821736960 commented 3 years ago

can you share the errors you get ?

I follow the steps strictly as the official instructions.https://github.com/ethz-asl/libpointmatcher/blob/master/doc/CompilationWindows.md. And then add BUILD_SHARED_LIBS=ON at cmake-gui,(Boost_USE_STATIC_LIBS=True still exists) The cmake results is as follows, the official instructions also has these warnings so I think it doesnot matter:

`Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363. libnabo found, version 1.0.7 (include=E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9 libs=E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib) CMake Warning (dev) at CMakeLists.txt:218 (get_property): Policy CMP0026 is not set: Disallow use of the LOCATION target property. Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

The LOCATION property should not be read from target "yaml-cpp-pm". Use the target name directly with add_custom_command, or use the generator expression $, as appropriate.

This warning is for project developers. Use -Wno-dev to suppress it.

-- using built-in yaml-cpp, version 0.3.0 -- text-based configuration enabled CMake Warning (dev) at CMakeLists.txt:259 (elseif): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Quoted variables like "MSVC" will no longer be dereferenced when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. This warning is for project developers. Use -Wno-dev to suppress it.

-- API Documentation (doxygen): disabled CMake Warning (dev) at CMakeLists.txt:460 (get_target_property): Policy CMP0026 is not set: Disallow use of the LOCATION target property. Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

The LOCATION property should not be read from target "pointmatcher". Use the target name directly with add_custom_command, or use the generator expression $, as appropriate.

This warning is for project developers. Use -Wno-dev to suppress it.

Configuring done`

Then I click generate and open it in VS 2019. when I try to build, it failed:

14>LINK : fatal error LNK1104: 无法打开文件“..\contrib\RelWithDebInfo\gtest.lib” 14>已完成生成项目“utest.vcxproj”的操作 - 失败。 15>------ 已启动全部重新生成: 项目: ALL_BUILD, 配置: RelWithDebInfo x64 ------ 15>Building Custom Rule E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/CMakeLists.txt 16>------ 已跳过全部重新生成: 项目: INSTALL, 配置: RelWithDebInfo x64 ------ 16>没有为此解决方案配置选中要生成的项目 ========== 全部重新生成: 成功 5 个,失败 9 个,跳过 2 个 ==========

By the way, I only compile and buid the libpointmatcher, not install it, does that matters?

maxGimeno commented 3 years ago

No, the installation doesn't matter.

maxGimeno commented 3 years ago

If I understand correctly your error, you are trying to build the target INSTALL, when you should be building ALL_BUILD

821736960 commented 3 years ago

If I understand correctly your error, you are trying to build the target INSTALL, when you should be building ALL_BUILD

I click at toolbar:build--build solutions. If not add BUILD_SHARED_LIBS=ON at cmake-gui, it could build successfully. If add BUILD_SHARED_LIBS=ON at cmake-gui, it failed. I also tried build--All_BUILD, it also failed. I think the error is about the "optimized" in libpointmatcherConfig.cmake.

# - Config file for the libpointmatcher package
# It defines the following variables
#  libpointmatcher_INCLUDE_DIRS - include directories for pointmatcher
#  libpointmatcher_LIBRARIES    - libraries to link against

# Compute paths
get_filename_component(POINTMATCHER_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(libpointmatcher_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")
set(LIBPOINTMATCHER_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")
set(pointmatcher_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")
set(POINTMATCHER_INCLUDE_DIRS "C:/local/boost_1_66_0;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libnabo-1.0.7/libnabo-1.0.7;E:/eigen-3.3.9-forlibnao/eigen-3.3.9;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/contrib/yaml-cpp-pm/include;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1")

set(libpointmatcher_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")
set(LIBPOINTMATCHER_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")
set(pointmatcher_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")
set(POINTMATCHER_LIBRARIES "E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/$(Configuration)/pointmatcher.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_thread-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_filesystem-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_system-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_program_options-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_date_time-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_chrono-vc141-mt-gd-x64-1_66.lib;optimized;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-x64-1_66.lib;debug;C:/local/boost_1_66_0/stage/lib/libboost_atomic-vc141-mt-gd-x64-1_66.lib;E:/libnabo-1.0.7/libnabo-1.0.7/build/RelWithDebInfo/nabo.lib;E:/libpointmatcher-1.3.1/libpointmatcher-1.3.1/build/contrib/yaml-cpp-pm/$(Configuration)/yaml-cpp-pm.lib")

# This causes catkin simple to link against these libraries
set(libpointmatcher_FOUND_CATKIN_PROJECT true)
set(LIBPOINTMATCHER_FOUND_CATKIN_PROJECT true)
set(pointmatcher_FOUND_CATKIN_PROJECT true)
set(POINTMATCHER_FOUND_CATKIN_PROJECT true)
maxGimeno commented 3 years ago

I think you are trying to build CGAL examples in debug, but feeding it releases libraries, or something like this. "optimized" is a keyword generated by visual tu specify it is a "release" version of a lib, as it is a multi configuration compiler. I don't think this keyword is used with shared libs, which is why I wanted you to try.

821736960 commented 3 years ago

I think you are trying to build CGAL examples in debug, but feeding it releases libraries, or something like this. "optimized" is a keyword generated by visual tu specify it is a "release" version of a lib, as it is a multi configuration compiler. I don't think this keyword is used with shared libs, which is why I wanted you to try.

I have compiled, built, installed the libpointmatcher, and done its tutorial. So probably it's not a libpointmatcher issue.

Note that when compile libnabo, , the Variable SHARED_LIBS is set to False.

When compile libpointmatcher, the CMAKE_BUILD_TYPE is set to Release, CMAKE_CONFIGURATION_TYPES is set to RelWithDebInfo.

When compile CGAL-5.1.2/examples/Point_set_processing_3, I dont see CMAKE_BUILD_TYPE, and CMAKE_CONFIGURATION_TYPES is set to Debug;Release;MinSizeRel;RelWithDebInfo.

maxGimeno commented 3 years ago

Is it possible for you to try with a more recent version of boost ? >1.70 preferably.

maxGimeno commented 3 years ago

Ok, I found out exactly what happens. Pointmatcher forwards the boost_libraries in its own pointmatcher_LIBRARIES, and as you are using an old version of Boost (<1.70), Find_boost generates the unwanted keywords, as documented in cmake. Our CGAL_pointmatcher_support.cmake script, that aims to gather all pointmatcher dependencies for use with CGAL, uses a syntax that doesn't allow such keywords, but as we all use modern boost we did not see the problem sooner. I'll produce a patch, but you might want to upgrade to boost 1.71 or 1.73 to not having to wait for several months untill the next bug fix release.

821736960 commented 3 years ago

Ok, I found out exactly what happens. Pointmatcher forwards the boost_libraries in its own pointmatcher_LIBRARIES, and as you are using an old version of Boost (<1.70), Find_boost generates the unwanted keywords, as documented in cmake. Our CGAL_pointmatcher_support.cmake script, that aims to gather all pointmatcher dependencies for use with CGAL, uses a syntax that doesn't allow such keywords, but as we all use modern boost we did not see the problem sooner. I'll produce a patch, but you might want to upgrade to boost 1.71 or 1.73 to not having to wait for several months untill the next bug fix release.

Thanks. Just now I update my boost version from 1.66 to 1.70 and compile libpointmatcher again. Unluckly, even libpointmatcher cannot work. So sad.

maxGimeno commented 3 years ago

I did it with boost 1.73 without problem. Maybe utest and gtest didn't build but you won't need them.

821736960 commented 3 years ago

I did it with boost 1.73 without problem. Maybe utest and gtest didn't build but you won't need them.

Note that when install libpointmatcher I installed boost with exe files rather than .zip file( with ./booststrap.bat, ./b2.exe command). Because if I use the latter method, the libpointmatcher won't work(I dont know why).

Today I have tried to install boost 1.71 with exe files, finally the libpointmatcher can work again. But when compiling with CGAL, the issue CMake Error at E:/vcpkg/installed/x64-windows/share/cgal/CGAL_pointmatcher_support.cmake:3 (set_target_properties): Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword "optimized".

still exists.

yskn-github commented 3 years ago

I had the same problem. I use cmake-gui to generate Visual Studio 2019 solution.

"optimized" apears in CMake variable (such as LibLZMA_LIBRARIES).

I found: https://stackoverflow.com/questions/55459078/cmake-cannot-open-file-optimized-lib-when-trying-to-add-boost-process This problem is similar to the above.

I searched for such usage cmake files under cgal root dirctory and found: cgal/Installation/cmake/modules/CGAL_pointmatcher_support.cmake: target_link_libraries(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_LIBRARIES}")

Removing double quote and building , it works.

This issue can affect the following example:

lrineau commented 3 years ago

Thanks @yskn-github. I think you have spotted the issue, and I agree with you that there should not be any quote around ${libpointmatcher_LIBRARIES}. I will submit a pull-request.

lrineau commented 3 years ago

@yskn-github @821736960 I hope this bug will be fixed by https://github.com/CGAL/cgal/pull/6007. Unfortunately, it is too late for the release series 5.1.x, that is closed. The fix will be available in 5.2.x and later releases.