summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_path/call-cmake_path.cmake
blob: 70fd6f53f27e49695f9bd4f9759aae806fb83dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

cmake_minimum_required(VERSION 3.18...3.19)

# define input variable
set (path "")

separate_arguments(CMAKE_PATH_ARGUMENTS UNIX_COMMAND "${CMAKE_PATH_ARGUMENTS}")

if (CHECK_INVALID_OUTPUT)
  # special handling for CMAKE_PATH
  list(GET CMAKE_PATH_ARGUMENTS 0 command)
  if (command STREQUAL "CMAKE_PATH")
    cmake_path(CMAKE_PATH "" "input")
  else()
    cmake_path(${CMAKE_PATH_ARGUMENTS} "")
  endif()
else()
  cmake_path(${CMAKE_PATH_ARGUMENTS})
endif()