summaryrefslogtreecommitdiff
path: root/Tests/CMakeCommands/link_directories/CMakeLists.txt
blob: 60c07b6384b9594ef8d4183177727ba2701cce1e (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
26
27
28
29
30
cmake_minimum_required(VERSION 3.12)

project(link_directories LANGUAGES C)


link_directories(/A)
link_directories(BEFORE /B)

set(CMAKE_LINK_DIRECTORIES_BEFORE ON)
link_directories(/C)

get_directory_property(result LINK_DIRECTORIES)
if (NOT result MATCHES "/C;/B;/A")
  message(SEND_ERROR "link_directories not populated the LINK_DIRECTORIES directory property")
endif()


add_executable(link_directories EXCLUDE_FROM_ALL LinkDirectoriesExe.c)

get_target_property(result link_directories LINK_DIRECTORIES)
if (NOT result MATCHES "/C;/B;/A")
  message(SEND_ERROR "link_directories not populated the LINK_DIRECTORIES target property")
endif()


add_library(imp UNKNOWN IMPORTED)
get_target_property(result imp LINK_DIRECTORIES)
if (result)
  message(FATAL_ERROR "link_directories populated the LINK_DIRECTORIES target property")
endif()