Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/CMakeCommands/add_link_options/CMakeLists.txt
3153 views
1
cmake_minimum_required(VERSION 3.11)
2
3
project(add_link_options LANGUAGES C)
4
5
6
add_link_options(-LINK_FLAG)
7
8
add_executable(add_link_options EXCLUDE_FROM_ALL LinkOptionsExe.c)
9
10
get_target_property(result add_link_options LINK_OPTIONS)
11
if (NOT result MATCHES "-LINK_FLAG")
12
message(SEND_ERROR "add_link_options not populated the LINK_OPTIONS target property")
13
endif()
14
15
16
add_library(imp UNKNOWN IMPORTED)
17
get_target_property(result imp LINK_OPTIONS)
18
if (result)
19
message(FATAL_ERROR "add_link_options populated the LINK_OPTIONS target property")
20
endif()
21
22