You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see that sample2 and sample3 are irrelevant to each other, but when I compile it shows the below compilation error
In file included from /usr/include/pcl-1.8/pcl/common/common.h:41:0,
from /home/hypevr/test/sample3/Sample3.cpp:3:
/usr/include/pcl-1.8/pcl/pcl_base.h:49:10: fatal error: Eigen/StdVector: No such file or directory
#include <Eigen/StdVector>
^~~~~~~~~~~~~~~~~
compilation terminated.
sample3/CMakeFiles/sample3.dir/build.make:62: recipe for target 'sample3/CMakeFiles/sample3.dir/Sample3.cpp.o' failed
However, if I comment out the add_subdirectory(sample2) in the head CMakeLists so it becomes like this
It actually compiles as it should be. So for some reason sample2 is still affecting sample3 even though they are irrelevant. Can someone please fix it?
The text was updated successfully, but these errors were encountered:
There is a fundamental question, actually. Should our imported targets be marked GLOBAL or not? In other words, should the PCL libs found by "sample2" subproject be visible/usable in "sample3"? At the moment we have inconsistency, our targets are marked global and are visible, however the PCL_LIBRARIES variable which includes all the target library names is not global. Further, thinking about how it was before, none of the variables created by the config script were set global, so the found PCL was not shared across subprojects. So I'm inclined to think that we shouldn't make our targets global.
I believe the standard practice is not to mark them global. If eventually PCL migrates to the modern CMake way of doing things like pcl::pcl and export the auto generated config file and targets file does not mark the imported targets as global.
Your Environment
Context
This is the minimal example to recreate the problem
CMakeLists.txt
sample2/CMakeLists.txt
sample2/Sample2.h
sample2/Sample2.cpp
sample3/CMakeLists.txt
sample3/Sample3.h
sample3/Sample3.cpp
You can see that sample2 and sample3 are irrelevant to each other, but when I compile it shows the below compilation error
However, if I comment out the
add_subdirectory(sample2)
in the head CMakeLists so it becomes like thisIt actually compiles as it should be. So for some reason sample2 is still affecting sample3 even though they are irrelevant. Can someone please fix it?
The text was updated successfully, but these errors were encountered: