find_package()-ing in Visual Studio does not discover include directories

Viewed 54

In my project I am using:

find_package(PCL REQUIRED COMPONENTS common io search features registration)
include_directories(${PCL_INCLUDE_DIRS})

CMAKE-ing the project finds installed PCL and ${PCL_INCLUDE_DIRS} contains "C:/Program Files/PCL 1.9.1/include/pcl-1.9".

But when I then try to compile, the included header files are not found.

9>c:\...\runregistration.cpp(5): fatal error C1083: Cannot open include file: 'pcl/point_types.h': No such file or directory

This only happens in Visual Studio. When I cmake&compile through command line, the pcl headers are found.

What am I doing wrong, what can be different in VS? Is there some configuration I don't know about?

Thanks.


Edit:

The command line commands I am using are

cmake -G "Visual Studio 15 2017 Win64" ..
cmake --build . --target Target --config Release -- /m:8 /p:CL_MPCount=16

I have the Visual Studio project open as a directory, navigating to the Project's Properties does not display anything. I have cleared the cache and rebuilt the project, the cmake command VS uses is

cmake.exe"  -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX:PATH="C:\...\install\x64-Release" -Wno-dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_TOOLCHAIN_FILE="C:/Users/matus/vcpkg/scripts/buildsystems/vcpkg.cmake" "PROJECT_DIR"

I haven't downloaded pcl by vcpkg so I am assuming that nothing collides there.

0 Answers
Related