diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-09-19 12:12:35 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2018-09-25 13:59:59 (GMT) |
commit | f9717725f9d4c7f4a1da52b0184365cd757bc076 (patch) | |
tree | ee805f2e0fbd53cc0b2b72728e08496f0df57372 /Tests/CMakeCommands | |
parent | b5915744ebccd086891f1fab0ae91af54deb3a86 (diff) | |
download | CMake-f9717725f9d4c7f4a1da52b0184365cd757bc076.zip CMake-f9717725f9d4c7f4a1da52b0184365cd757bc076.tar.gz CMake-f9717725f9d4c7f4a1da52b0184365cd757bc076.tar.bz2 |
link_directories(): enhance capabilities
Diffstat (limited to 'Tests/CMakeCommands')
-rw-r--r-- | Tests/CMakeCommands/link_directories/CMakeLists.txt | 30 | ||||
-rw-r--r-- | Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c | 4 |
2 files changed, 34 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/link_directories/CMakeLists.txt b/Tests/CMakeCommands/link_directories/CMakeLists.txt new file mode 100644 index 0000000..60c07b6 --- /dev/null +++ b/Tests/CMakeCommands/link_directories/CMakeLists.txt @@ -0,0 +1,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() diff --git a/Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c b/Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c new file mode 100644 index 0000000..8488f4e --- /dev/null +++ b/Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} |