PERSISTENCE: check the libpq path that was detected by cmake
parent
1155c84daa
commit
fc04257643
|
@ -21,3 +21,5 @@
|
||||||
#cmakedefine OPENCL_LIBRARY "@OPENCL_LIBRARY@"
|
#cmakedefine OPENCL_LIBRARY "@OPENCL_LIBRARY@"
|
||||||
#cmakedefine BASE_URL "@BASE_URL@"
|
#cmakedefine BASE_URL "@BASE_URL@"
|
||||||
#cmakedefine DB_PW "@DB_PW@"
|
#cmakedefine DB_PW "@DB_PW@"
|
||||||
|
|
||||||
|
#cmakedefine POSTGRESQL_LIBS "@POSTGRESQL_LIBS@"
|
||||||
|
|
|
@ -50,6 +50,7 @@ else()
|
||||||
message(WARNING "No postgres was found on your system. Make sure to have libpq and pg_type.h installed on your system")
|
message(WARNING "No postgres was found on your system. Make sure to have libpq and pg_type.h installed on your system")
|
||||||
endif()
|
endif()
|
||||||
set(HAVE_POSTGRES ${PostgreSQL_FOUND} CACHE BOOL "Found postgres" FORCE)
|
set(HAVE_POSTGRES ${PostgreSQL_FOUND} CACHE BOOL "Found postgres" FORCE)
|
||||||
|
set(POSTGRESQL_LIBS "${PostgreSQL_LIBRARIES}" CACHE STRING "PostgreSQL libraries" FORCE)
|
||||||
|
|
||||||
message(STATUS "Postgresql include dirs: ${PostgreSQL_INCLUDE_DIRS}")
|
message(STATUS "Postgresql include dirs: ${PostgreSQL_INCLUDE_DIRS}")
|
||||||
message(STATUS "Postgresql libs: ${PostgreSQL_LIBRARIES}")
|
message(STATUS "Postgresql libs: ${PostgreSQL_LIBRARIES}")
|
||||||
|
|
|
@ -67,7 +67,11 @@ bool postgresInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj == nullptr) {
|
if (obj == nullptr) {
|
||||||
const char *searchPaths[] = {"libpq.so", nullptr};
|
const char *searchPaths[] = {
|
||||||
|
#ifdef POSTGRESQL_LIBS
|
||||||
|
POSTGRESQL_LIBS
|
||||||
|
#endif
|
||||||
|
"libpq.so", nullptr};
|
||||||
for (const char **searchPath = searchPaths; *searchPath; ++searchPath) {
|
for (const char **searchPath = searchPaths; *searchPath; ++searchPath) {
|
||||||
obj = SDL_LoadObject(*searchPath);
|
obj = SDL_LoadObject(*searchPath);
|
||||||
if (obj != nullptr) {
|
if (obj != nullptr) {
|
||||||
|
|
Loading…
Reference in New Issue