summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetPropertyComputer.h
blob: 941614bdcd27705ec5ecb684a53b57a922b8788a (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#ifndef cmTargetPropertyComputer_h
#define cmTargetPropertyComputer_h

#include <cmConfigure.h> // IWYU pragma: keep

#include "cmListFileCache.h"

#include <map>
#include <string>

class cmTarget;
class cmMessenger;

class cmTargetPropertyComputer
{
public:
  static const char* GetProperty(cmTarget const* tgt, const std::string& prop,
                                 cmMessenger* messenger,
                                 cmListFileBacktrace const& context);

  static std::map<std::string, std::string> ComputeFileLocations(
    cmTarget const* tgt);

  static bool WhiteListedInterfaceProperty(const std::string& prop);

  static bool PassesWhitelist(cmState::TargetType tgtType,
                              std::string const& prop, cmMessenger* messenger,
                              cmListFileBacktrace const& context);

private:
  static bool HandleLocationPropertyPolicy(std::string const& tgtName,
                                           cmMessenger* messenger,
                                           cmListFileBacktrace const& context);

  static const char* ComputeLocationForBuild(cmTarget const* tgt);
  static const char* ComputeLocation(cmTarget const* tgt,
                                     std::string const& config);
  static const char* GetLocation(cmTarget const* tgt, std::string const& prop,
                                 cmMessenger* messenger,
                                 cmListFileBacktrace const& context);

  static const char* GetSources(cmTarget const* tgt, cmMessenger* messenger,
                                cmListFileBacktrace const& context);
};

#endif