mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 19:42:46 +08:00
use it in vcpkg_add_to_path.
This commit is contained in:
parent
6eaf7f0f97
commit
b72fa4561f
@ -29,19 +29,11 @@ function(vcpkg_add_to_path)
|
|||||||
if(NOT "${ARGC}" STREQUAL "2")
|
if(NOT "${ARGC}" STREQUAL "2")
|
||||||
message(FATAL_ERROR "Expected second argument.")
|
message(FATAL_ERROR "Expected second argument.")
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_HOST_WIN32)
|
set(ENV{PATH} "${ARGV1}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PATH}")
|
||||||
set(ENV{PATH} "${ARGV1};$ENV{PATH}")
|
|
||||||
else()
|
|
||||||
set(ENV{PATH} "${ARGV1}:$ENV{PATH}")
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
if(NOT "${ARGC}" STREQUAL "1")
|
if(NOT "${ARGC}" STREQUAL "1")
|
||||||
message(FATAL_ERROR "Unexpected second argument: ${ARGV1}")
|
message(FATAL_ERROR "Unexpected second argument: ${ARGV1}")
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_HOST_WIN32)
|
set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${ARGV0}")
|
||||||
set(ENV{PATH} "$ENV{PATH};${ARGV0}")
|
|
||||||
else()
|
|
||||||
set(ENV{PATH} "$ENV{PATH}:${ARGV0}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
@ -15,10 +15,10 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
#Helper variable to identify the host path seperator.
|
#Helper variable to identify the host path seperator.
|
||||||
if(WIN32)
|
if(CMAKE_HOST_WIN32)
|
||||||
set(VCPKG_HOST_PATH_SEPARATOR ";")
|
set(VCPKG_HOST_PATH_SEPARATOR ";")
|
||||||
set(VCPKG_HOST_PATH_SEPARATOR_ESCAPED "\\;") #sometimes needed to differentiate between the cmake list 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 ":")
|
||||||
set(VCPKG_HOST_PATH_SEPARATOR_ESCAPED ":")
|
set(VCPKG_HOST_PATH_SEPARATOR_ESCAPED ":")
|
||||||
endif()
|
endif()
|
Loading…
Reference in New Issue
Block a user