1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
4 #include "cmTargetPropertyComputer.h"
8 #include "cmMakefile.h"
9 #include "cmMessageType.h"
10 #include "cmPolicies.h"
12 bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
13 std::string
const& tgtName
, cmMakefile
const& mf
)
16 const char* modal
= nullptr;
17 MessageType messageType
= MessageType::AUTHOR_WARNING
;
18 switch (mf
.GetPolicyStatus(cmPolicies::CMP0026
)) {
19 case cmPolicies::WARN
:
20 e
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0026
) << "\n";
25 case cmPolicies::REQUIRED_ALWAYS
:
26 case cmPolicies::REQUIRED_IF_USED
:
29 messageType
= MessageType::FATAL_ERROR
;
34 e
<< "The LOCATION property " << modal
<< " not be read from target \""
36 << "\". Use the target name directly with "
37 "add_custom_command, or use the generator expression $<TARGET_FILE>, "
39 mf
.IssueMessage(messageType
, e
.str());
42 return messageType
!= MessageType::FATAL_ERROR
;