Add support for pkg-config configured libs

This commit is contained in:
benn 2025-08-25 11:45:52 +02:00
parent cfc49155ac
commit c3502ad4cc

View file

@ -64,6 +64,13 @@ endif
# #
OS := $(shell uname -s) OS := $(shell uname -s)
#
# PKGCONFIG
#
# Add the names of pkg-config development packages required to build your project
# The appropriate headers an libraries will be added to the build
PKGCONFIG :=
# #
# Targets: # Targets:
# check1 uses cppcheck # check1 uses cppcheck
@ -158,6 +165,13 @@ CXXFLAGS = -std=c++17 $(NETBEANSBUILD) $(DBG_REL) -I./include/ $(_CXXFLAGS) $(
_APP_LIBS = _APP_LIBS =
LIBS = $(NETBEANSBUILD) $(_APP_LIBS) LIBS = $(NETBEANSBUILD) $(_APP_LIBS)
ifneq ($(PKGCONFIG),)
CXXFLAGS += $(shell pkg-config --cflags $(PKGCONFIG))
LIBS += $(shell pkg-config --libs $(PKGCONFIG))
endif
debug release: DIRS $(APP) debug release: DIRS $(APP)
.PHONY: check1 check2 .PHONY: check1 check2