[Build] Onnxruntime C++ samples do not build off Cmake installed onnxruntime
Describe the issue
Build and install onnxruntime from source with CMAKE_PREFIX defined
Install it and trying building samples. Imagenet main.cc fails to include cpu_provider.h because it is not installed my cmake install process.
Urgency
No response
Target platform
Windows
Build script
.\build.bat --build_dir .\cpu_build --config Debug --cmake_generator "Visual Studio 17 2022" --build_shared_lib --parallel 11 --skip_submodule_sync --cmake_extra_defines CMAKE_INSTALL_PREFIX=D:\dev\oss\onnxruntime_debug
Error / output
1>D:\dev\onnxruntime-inference-examples\c_cxx\include\providers.h(5,10): fatal error C1083: Cannot open include file: 'cpu_provider_factory.h': No such file or directory
Visual Studio Version
2022
GCC / Compiler Version
No response
Cmake install does install cpu_provider_factory.h. It's in C:\Users\prs\work_projects\ort_install\include\onnxruntime\core\providers\cpu. Running msbuild with /p:IncludePath=C:\Users\prs\work_projects\ort_install\include\onnxruntime\core\providers\cpu\ fixes this particular build error. How did this work before?