I am building a demo cross-platform application (Windows + Raspberry Pi) in C++. I am using vcpkg package manager for libraries.
When I create project only for Windows (without cmake) things work perfectly.
I am now trying to build for Windows using cmake I am getting the bellow mentioned error for libraries installed via vcpkg package manager. I have confirmed that libraies are installed and are working properly when used with normal Windows console application.
During installation of vcpkg the following line was returned to enable vcpkg support in cmake.
"-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
Cmake FIle
# Set to C++20 standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_BUILD_TYPE debug)
# Set to C17 standard
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Set vcpkg library path
set(CMAKE_TOOLCHAIN_FILE C:/vcpkg/scripts/buildsystems/vcpkg.cmake)
# Add source to this project's executable.
add_executable (Test main.cpp)
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET Test PROPERTY CXX_STANDARD 20)
endif()
Error
fatal error C1083: Cannot open include file: 'boost/asio.hpp': No such file or directory
fatal error C1083: Cannot open include file: 'boost/asio.hpp': No such file or directory
fatal error C1083: Cannot open include file: 'mqtt/async_client.h': No such file or directory
fatal error C1083: Cannot open include file: 'plog/Log.h': No such file or directory