When I build Example Code , a cmake errors occur !!!
$ cmake .. && make it can run with correcrt ! but run: $ cmake .. -DBUILD_EXAMPLES=ON && make
appear error : CMake Error at CMakeLists.txt:75 (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.
my env: g++& gcc 7.50 ,cmake 3.25, ubuntu18.04 with ros-melodic.
Maybe the version of cmake is too old. I recommend upgrading your ubuntu as Ubuntu 18.04 is no longer supported and it is dangerous to keep using it.
OK I will try. & Thanks you for the reply.
Have you solved the problem?
I've came across same error with 20.04 & gcc 9.4.0
I've came across same error with 20.04 & gcc 9.4.0
This question was solved by upgrade the version of PCL, I tested PCL1.13.1 which was working properly.
Just to make other people's lives easier, I had to change the CMakeLists.txt a bit to get this to work after I installed pcl from source (because I think the newest version of PCL is not available through apt). It was pretty simple though, I just changed the find_package line that was supposed to find PCL to: find_package(PCL 1.13.0.99 EXACT REQUIRED)