FindPostgreSQL.cmake won't work on ubuntu

前端 未结 4 1382
抹茶落季
抹茶落季 2021-02-07 14:44
  • Ubuntu 12.04
  • CMake 2.8.9
  • Postgresql 9.2.2

I\'m trying to get the FindPostgreSQL module to find /usr/include/postgre

4条回答
  •  鱼传尺愫
    2021-02-07 15:28

    After a bit more debugging I figured out that it's getting stuck trying to find pg_type.h

    This file is located in /usr/include/postgresql/catalog/pg_types.h but the module is expecting to find it in /usr/include/postgresql/server/catalog/pg_types.h

    find_path(PostgreSQL_TYPE_INCLUDE_DIR
      NAMES catalog/pg_type.h
      PATHS
       # Look in other places.
       ${PostgreSQL_ROOT_DIRECTORIES}
      PATH_SUFFIXES
        pgsql/server
        postgresql/server
        include/server
      # Help the user find it if we cannot.
      DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
    )
    

    It works if I add postgresql to the PATH_SUFFIXES

    find_path(PostgreSQL_TYPE_INCLUDE_DIR
      NAMES catalog/pg_type.h
      PATHS
       # Look in other places.
       ${PostgreSQL_ROOT_DIRECTORIES}
      PATH_SUFFIXES
        postgresql
        pgsql/server
        postgresql/server
        include/server
      # Help the user find it if we cannot.
      DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
    )
    

提交回复
热议问题