summaryrefslogtreecommitdiffstats
path: root/Modules/FindPostgreSQL.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-03-28 22:00:54 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2012-08-14 19:02:58 (GMT)
commitb04650e163320353762b6ec196afa9500345b5cd (patch)
tree1790b38ae7db75f232a27f4aa796d4441c68f009 /Modules/FindPostgreSQL.cmake
parentcd3bd23266a4a6c00595134a17a8bdaea9e28af5 (diff)
downloadCMake-b04650e163320353762b6ec196afa9500345b5cd.zip
CMake-b04650e163320353762b6ec196afa9500345b5cd.tar.gz
CMake-b04650e163320353762b6ec196afa9500345b5cd.tar.bz2
use the find_* functions ENV parameter
Instead of directly passing $ENV{SOMEVAR} to a find_* call pass in ENV SOMEVAR. This will make sure the paths will get correctly handled through different platforms, especially on Windows. Also fixes one place where paths with windows delimiters (\) were hardcoded to use forward slashes.
Diffstat (limited to 'Modules/FindPostgreSQL.cmake')
-rw-r--r--Modules/FindPostgreSQL.cmake7
1 files changed, 1 insertions, 6 deletions
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 699cd41..b9440a8 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -74,11 +74,6 @@ set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache e
set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
-set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT})
-if(PostgreSQL_ROOT_DIRECTORIES)
- file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES)
-endif()
-
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
"9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
@@ -89,7 +84,7 @@ if ( WIN32 )
endforeach()
endif()
set( PostgreSQL_ROOT_DIRECTORIES
- ${PostgreSQL_ROOT_DIRECTORIES}
+ ENV PostgreSQL_ROOT
${PostgreSQL_ROOT}
${PostgreSQL_ADDITIONAL_SEARCH_PATHS}
)