1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

CMake: Fix package resolution on Linux

This change ensures that instructions are straightforward on
Ubuntu 24.04 and 22.04.
This commit is contained in:
attila 2024-06-24 15:12:36 +02:00
parent cb439c51b8
commit c057c0d55e
3 changed files with 20 additions and 4 deletions

View file

@ -32,7 +32,11 @@ or
- libcurl4-openssl-dev (unless `JUCE_USE_CURL=0`)
#### juce_graphics
- libfreetype6-dev (unless `JUCE_USE_FREETYPE=0`)
- libfontconfig1-dev (unless `JUCE_USE_FONTCONFIG=0`)
- libfreetype-dev (unless `JUCE_USE_FREETYPE=0`)
These packages are available on Ubuntu 22 and 24. If libfreetype-dev is not
available you could try installing the libfreetype6-dev package.
#### juce_gui_basics
- libx11-dev
@ -63,7 +67,7 @@ The full command is as follows:
sudo apt install libasound2-dev libjack-jackd2-dev \
ladspa-sdk \
libcurl4-openssl-dev \
libfreetype6-dev \
libfreetype-dev libfontconfig1-dev \
libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev \
libwebkit2gtk-4.1-dev \
libglu1-mesa-dev mesa-common-dev

View file

@ -93,9 +93,21 @@ define_property(TARGET PROPERTY JUCE_COPY_PLUGIN_AFTER_BUILD INHERITED
FULL_DOCS "Whether or not plugins should be copied after building")
set_property(GLOBAL PROPERTY JUCE_COPY_PLUGIN_AFTER_BUILD FALSE)
function(_juce_available_pkgconfig_module_or_else out package alternative_package)
find_package(PkgConfig REQUIRED)
pkg_check_modules(package_to_be_found ${package} QUIET)
if(package_to_be_found_FOUND)
set(${out} ${package} PARENT_SCOPE)
else()
set(${out} ${alternative_package} PARENT_SCOPE)
endif()
endfunction()
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
_juce_create_pkgconfig_target(JUCE_CURL_LINUX_DEPS libcurl)
_juce_create_pkgconfig_target(JUCE_BROWSER_LINUX_DEPS webkit2gtk-4.0 gtk+-x11-3.0)
_juce_available_pkgconfig_module_or_else(webkit_package_name webkit2gtk-4.1 webkit2gtk-4.0)
_juce_create_pkgconfig_target(JUCE_BROWSER_LINUX_DEPS ${webkit_package_name} gtk+-x11-3.0)
endif()
# We set up default/fallback copy dirs here. If you need different copy dirs, use

View file

@ -123,7 +123,7 @@
#elif (JUCE_LINUX || JUCE_BSD) && JUCE_WEB_BROWSER
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant", "-Wparentheses", "-Wdeprecated-declarations")
// If you're missing this header, you need to install the webkit2gtk-4.0 package
// If you're missing this header, you need to install the webkit2gtk-4.1 or webkit2gtk-4.0 package
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <glib-unix.h>