aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@hamburg.de>2019-08-08 14:22:53 +0200
committerAlexander Neumann <alexander.neumann@hamburg.de>2019-08-08 14:22:53 +0200
commitb72fa4561f31c4ea6cdc733094cebf72bedff854 (patch)
tree4ddf455310e3c801425cb425c06d834952d7974e
parent6eaf7f0f977e62b07515cb17676dcf5d383d357d (diff)
downloadvcpkg-b72fa4561f31c4ea6cdc733094cebf72bedff854.tar.gz
vcpkg-b72fa4561f31c4ea6cdc733094cebf72bedff854.zip
use it in vcpkg_add_to_path.
-rw-r--r--scripts/cmake/vcpkg_add_to_path.cmake12
-rw-r--r--scripts/cmake/vcpkg_common_definitions.cmake4
2 files changed, 4 insertions, 12 deletions
diff --git a/scripts/cmake/vcpkg_add_to_path.cmake b/scripts/cmake/vcpkg_add_to_path.cmake
index 7ab08c88e..05763b2ef 100644
--- a/scripts/cmake/vcpkg_add_to_path.cmake
+++ b/scripts/cmake/vcpkg_add_to_path.cmake
@@ -29,19 +29,11 @@ function(vcpkg_add_to_path)
if(NOT "${ARGC}" STREQUAL "2")
message(FATAL_ERROR "Expected second argument.")
endif()
- if(CMAKE_HOST_WIN32)
- set(ENV{PATH} "${ARGV1};$ENV{PATH}")
- else()
- set(ENV{PATH} "${ARGV1}:$ENV{PATH}")
- endif()
+ set(ENV{PATH} "${ARGV1}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PATH}")
else()
if(NOT "${ARGC}" STREQUAL "1")
message(FATAL_ERROR "Unexpected second argument: ${ARGV1}")
endif()
- if(CMAKE_HOST_WIN32)
- set(ENV{PATH} "$ENV{PATH};${ARGV0}")
- else()
- set(ENV{PATH} "$ENV{PATH}:${ARGV0}")
- endif()
+ set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${ARGV0}")
endif()
endfunction() \ No newline at end of file
diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake
index f9221f946..f43780959 100644
--- a/scripts/cmake/vcpkg_common_definitions.cmake
+++ b/scripts/cmake/vcpkg_common_definitions.cmake
@@ -15,10 +15,10 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
endif()
#Helper variable to identify the host path seperator.
-if(WIN32)
+if(CMAKE_HOST_WIN32)
set(VCPKG_HOST_PATH_SEPARATOR ";")
set(VCPKG_HOST_PATH_SEPARATOR_ESCAPED "\\;") #sometimes needed to differentiate between the cmake list separator
-elseif(UNIX)
+elseif(CMAKE_HOST_UNIX)
set(VCPKG_HOST_PATH_SEPARATOR ":")
set(VCPKG_HOST_PATH_SEPARATOR_ESCAPED ":")
endif() \ No newline at end of file