CMake project -> VS project: JuceHeader.h include search path not taken over?

I’ve created a CMake project where I uncommented juce_generate_juce_header(myProject) in CMakeLists.txt.
When opening the CMake project directly in VisualStudio, doing #include <JuceHeader.h> works fine (it finds the header file).

However when creating a VisualStudio project from it using cmake -B cmake-build-vs2019 -G "Visual Studio 16 2019" -A x64 and opening that, the header file is not found.

Is this supposed to work or should I resolve the path to JuceHeader.h manually in my VS project?

(using JUCE latest development branch)

That header isn’t generated until build time, so you may need to actually run the build before trying to jump to the header. If that still doesn’t work, that might indicate a bug in JUCE’s CMake support.

2 Likes

Ah, you’re right.
I added the #include <JuceHeader.h> line directly after opening the VS project for the first time and noticed it couldn’t resolve.
But commenting out/building/uncommenting works fine indeed.

Thanks.