Hi, I downloaded a JUCE Cmake project and was trying to build it in VSCode on my OSX machine
I followed the instructions for setting up a JUCE project with CMake that I found here, specifically those for the find package method:
Using
find_package
To install JUCE globally on your system, you’ll need to tell CMake where to place the installed files.
# Go to JUCE directory cd /path/to/clone/JUCE # Configure build with library components only cmake -B cmake-build-install -DCMAKE_INSTALL_PREFIX=/path/to/JUCE/install # Run the installation cmake --build cmake-build-install --target install
In your project which consumes JUCE, make sure the project CMakeLists.txt contains the line
find_package(JUCE CONFIG REQUIRED)
. This will make the JUCE modules and CMake helper functions available for use in the rest of your build. Then, run the build like so:# Go to project directory cd /path/to/my/project # Configure build, passing the JUCE install path you used earlier cmake -B cmake-build -DCMAKE_PREFIX_PATH=/path/to/JUCE/install # Build the project cmake --build cmake-build
They seem to have worked until I reach the final build step in VSCode. When I run build it still says that the JUCE modules aren’t found. I get the following error message:
CMake Error at CMakeLists.txt:7 (find_package):Could not find a package configuration file provided by "JUCE" with any of
the following names:
JUCEConfig.cmake
juce-config.cmake
Add the installation prefix of "JUCE" to CMAKE_PREFIX_PATH or set
"JUCE_DIR" to a directory containing one of the above files. If "JUCE"
provides a separate development package or SDK, be sure it has been
installed.
Does anybody know how I can fix this and get the project to build in VSCode?