Skip to content

Support pkg-config when mapnik-config is not available #60

@sebastic

Description

@sebastic

The CMake build of Mapnik 4.0.0 doesn't provide mapnik-config, it does provide pkg-config support.

This patch is used in the Debian package to use pkg-config unconditionally:

--- a/backend-mapnik/Makefile
+++ b/backend-mapnik/Makefile
@@ -1,8 +1,7 @@
 INSTALLOPTS=-g root -o root
-CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-CXXFLAGS = `mapnik-config --cflags` $(CFLAGS)
+CXXFLAGS += `pkg-config --cflags libmapnik` -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 CXXFLAGS += -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast
-LDFLAGS= `mapnik-config --libs --ldflags --dep-libs`
+LDFLAGS += `pkg-config --libs libmapnik` -lboost_filesystem

 backend-mapnik: renderd.o metatilehandler.o networklistener.o networkmessage.o networkrequest.o networkresponse.o debuggable.o requesthandler.o
        $(CXX) -o $@ $^ $(LDFLAGS)

Some heuristics to determine which to use might be in order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions