2

I'm trying to compile MapServer 7 with:

  • Proj 6
  • Geos 3.7
  • Gdal 2.4
  • PostGIS 2.5
  • PostgreSQL 10

But for some reason it complaining about pg_config not found, I usually insert the path /usr/pgsql-10/bin/pg_config to compile software that need the same file but with MapServer 7 I can't

Here my cmake :

cmake -DCMAKE_INSTALL_PREFIX=/opt \
        -DCMAKE_PREFIX_PATH=/usr/pgsql-10/bin:/usr/local/src/postgis-2.5.2:/usr/local:/opt:/usr/local/src \
        -DWITH_CLIENT_WFS=ON \
        -DWITH_CLIENT_WMS=ON \
        -DWITH_CURL=ON \
        -DWITH_SOS=ON \
        -DWITH_FCGI=0 \
        -DWITH_PERL=0 \
        -DWITH_RUBY=0 \
        -DWITH_JAVA=0 \
        -DWITH_CSHARP=0 \
        -DWITH_PYTHON=0 \
        -DWITH_SVGCAIRO=0 \
        -DWITH_FRIBIDI=0 \
        -DWITH_PROTOBUFC=0 \
        -DWITH_CAIRO=0 \
        -DWITH_HARFBUZZ=0 \
        -DWITH_ORACLESPATIAL=0 \
        -DWITH_MSSQL2008=0 \
        ../ >../configure.out.txt

I don't really understand why I can compile other software correctly and MapServer no, I don't even understand what should I put in the path as looking at this code (supposedly responsible for the check)

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

this is the first error that appear:

Cmake Warning at cmake/FindPostgreSQL.cmake:21 (message)
Pg_config not found, will try some defaults
Call stacks (most recent call first):
cMakeLists.txt:755 (find_package)

and the second one is:

cMake error at CmakeLists.txt:73 (messages)
POSTGIS library/components/dependency could not be found.

HINTS:

-disable postgis...
- add cmake_prefix_path...
Call stack (most recent call firsts)
CMakeLists.txt:590 (report_optional_not_found)

How can I compile it with PostGIS support?

2
  • Note that a pattern of posting and deleting downvoted questions can result in suspension of your SE account.
    – Vince
    Commented Jun 19, 2019 at 12:14
  • Ok, sorry I will bear it in mind.
    – DevWizard
    Commented Jun 19, 2019 at 15:37

1 Answer 1

3

I got the answer from the mapserver-users list in the end.

cmake3 -DINSTALL_LIB_DIR:PATH=/usr/lib64 \
       -DCMAKE_PREFIX_PATH="/usr/lib64;/usr/pgsql-10" \
       -DWITH_CLIENT_WFS=ON \
       -DWITH_CLIENT_WMS=ON \
       -DWITH_POSTGIS=ON \
       -DWITH_CURL=ON \
       -DWITH_PROJ=ON \
       -DWITH_GEOS=ON \
       -DWITH_SOS=0 \
       -DWITH_FCGI=0 \
       -DWITH_PERL=0 \
       -DWITH_RUBY=0 \
       -DWITH_JAVA=0 \
       -DWITH_CSHARP=0 \
       -DWITH_PYTHON=0 \
       -DWITH_SVGCAIRO=0 \
       -DWITH_FRIBIDI=0 \
       -DWITH_PROTOBUFC=0 \
       -DWITH_CAIRO=0 \
       -DWITH_HARFBUZZ=0 \
       -DWITH_ORACLESPATIAL=0 \
       -DWITH_MSSQL2008=0 \
       ../ >../configure.out.txt

to notice the path in the -DCMAKE_PREFIX_PATH= are surrounded by "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.