summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_path/REMOVE_FILENAME.cmake
blob: 385dcd0fd9376c0738e354bea9ff1c0e25b8de1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)

set (path "a/b/c.e.f")
cmake_path (REMOVE_FILENAME path)
if (NOT path STREQUAL "a/b/")
  list (APPEND errors "'${path}' instead of 'a/b/'")
endif()

cmake_path (REMOVE_FILENAME path)
if (NOT path STREQUAL "a/b/")
  list (APPEND errors "'${path}' instead of 'a/b/'")
endif()

set (path "a/b/c.e.f")
cmake_path (REMOVE_FILENAME path OUTPUT_VARIABLE output)
if (NOT path STREQUAL "a/b/c.e.f")
  list (APPEND errors "input changed unexpectedly")
endif()
if (NOT output STREQUAL "a/b/")
  list (APPEND errors "'${output}' instead of 'a/b/'")
endif()

check_errors (REMOVE_FILENAME ${errors})