Can't include JUCE with cmake

Hi !

I am trying to setup my first audio plugin.

OS: Ubuntu 26.04.1 LTS.

Juce version: 9.0.0

Cmake file:

cmake_minimum_required(VERSION 3.24)
project(FistSynth)
find_package(Freetype)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(JUCE)

error message:

[main] Configuring project: FirstSynth 
[proc] Executing command: /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/home/etienne/Documents/CodeArchive/FirstSynth/out/install/g++-15 -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S /home/etienne/Documents/CodeArchive/FirstSynth -B /home/etienne/Documents/CodeArchive/FirstSynth/out/build/g++-15 -G "Unix Makefiles"
[cmake] -- Checking for modules 'freetype2;fontconfig'
[cmake] --   Package 'freetype2' not found
[cmake] --   Package 'fontconfig' not found
[cmake] -- Checking for module 'libcurl'
[cmake] --   Package 'libcurl' not found
[cmake] -- Checking for modules 'webkit2gtk-4.0;gtk+-x11-3.0'
[cmake] --   Package 'webkit2gtk-4.0' not found
[cmake] --   Package 'gtk+-x11-3.0' not found
[cmake] -- Configuring juceaide
[cmake] -- Building juceaide
[cmake] CMake Error at JUCE/extras/Build/juceaide/CMakeLists.txt:158 (message):
[cmake]   Failed to build juceaide
[cmake] 
[cmake]   [ 6%] Building CXX object
[cmake]   extras/Build/juceaide/CMakeFiles/juceaide.dir/Main.cpp.o
[cmake] 
[cmake]   [ 13%] Building CXX object
[cmake]   extras/Build/juceaide/CMakeFiles/juceaide.dir/__/juce_build_tools/juce_build_tools.cpp.o
[cmake] 
[cmake]   [ 20%] Building CXX object
[cmake]   extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_graphics/juce_graphics.cpp.o
[cmake] 
[cmake]   
[cmake]   /home/etienne/Documents/CodeArchive/FirstSynth/JUCE/modules/juce_graphics/juce_graphics.cpp:121:11:
[cmake]   fatal error: ft2build.h: Aucun fichier ou dossier de ce nom
[cmake] 
[cmake]     121 |  #include <ft2build.h>
[cmake]         |           ^~~~~~~~~~~~
[cmake] 
[cmake]   compilation terminated.
[cmake] 
[cmake]   gmake[2]: ***
[cmake]   [extras/Build/juceaide/CMakeFiles/juceaide.dir/build.make:107:
[cmake]   extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_graphics/juce_graphics.cpp.o]
[cmake]   Error 1
[cmake] 
[cmake]   gmake[1]: *** [CMakeFiles/Makefile2:148:
[cmake]   extras/Build/juceaide/CMakeFiles/juceaide.dir/all] Error 2
[cmake] 
[cmake]   gmake: *** [Makefile:136: all] Error 2
[cmake] 
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/home/etienne/Documents/CodeArchive/FirstSynth/out/install/g++-15 -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S /home/etienne/Documents/CodeArchive/FirstSynth -B /home/etienne/Documents/CodeArchive/FirstSynth/out/build/g++-15 -G "Unix Makefiles" exited with code: 1

Thanks for your help

You’ll need to install the dependencies:

1 Like

silly me, all the docs are in the repo :person_facepalming: