diff options
author | Brad King <brad.king@kitware.com> | 2019-07-03 11:30:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-03 11:30:43 (GMT) |
commit | 1f389b4498e0f096eb1ad60ebf62c871179ff7fa (patch) | |
tree | 23f0b9a22a2ec393c6e973f1c41e0acc80a550fd | |
parent | 581e011cefefea4a5ad826aac6bcbd66b4b68f3b (diff) | |
parent | d21b890a4c3d6c6d9a7457906fe8b1629eed41b0 (diff) | |
download | CMake-1f389b4498e0f096eb1ad60ebf62c871179ff7fa.zip CMake-1f389b4498e0f096eb1ad60ebf62c871179ff7fa.tar.gz CMake-1f389b4498e0f096eb1ad60ebf62c871179ff7fa.tar.bz2 |
Merge branch 'FindPostgreSQL-lib-dir' into release-3.15
Merge-request: !3505
-rw-r--r-- | Modules/FindPostgreSQL.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 433eae7..dfece22 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -172,14 +172,21 @@ endfunction() # any PostgreSQL_LIBRARY that is already specified and skip the search. if(PostgreSQL_LIBRARY) set(PostgreSQL_LIBRARIES "${PostgreSQL_LIBRARY}") + get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY}" PATH) else() __postgresql_find_library(PostgreSQL_LIBRARY_RELEASE ${PostgreSQL_LIBRARY_TO_FIND}) __postgresql_find_library(PostgreSQL_LIBRARY_DEBUG ${PostgreSQL_LIBRARY_TO_FIND}d) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) select_library_configurations(PostgreSQL) mark_as_advanced(PostgreSQL_LIBRARY_RELEASE PostgreSQL_LIBRARY_DEBUG) + if(PostgreSQL_LIBRARY_RELEASE) + get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY_RELEASE}" PATH) + elseif(PostgreSQL_LIBRARY_DEBUG) + get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY_DEBUG}" PATH) + else() + set(PostgreSQL_LIBRARY_DIR "") + endif() endif() -get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH) if (PostgreSQL_INCLUDE_DIR) # Some platforms include multiple pg_config.hs for multi-lib configurations |