Header Search Paths in CMake?

Hi. This could be a total gibberish question because I’m still getting a feel for the CMake/JUCE integration.

I’m running into a problem where there’s a SharedLibrary folder of code in the parent directory of my project and I seem to be able to get the SharedLibrary code added as part of the target_sources but all the references to the shared header files from inside my project seem to fail on compilation.

I’m able to get the shared code into the build using
target_sources(App1
PRIVATE
…/SharedLibrary/dsp.h
…/SharedLibrary/dsp.cpp
)

so I’m starting to wonder if the equivalent to the “Header Search Paths” in Projucer needs to be replicated inside my CMakeLists.txt
Is that possible? If so, how can I set that up?

You probably want to add your source/ directory to target_include_directories.

1 Like

Thanks! I’ll give that a shot.

I think I got it working by adding include_directories("${PROJECT_SOURCE_DIR}/SharedLibrary") in my root CMakeLists.txt but I’ll try your suggestion too.