MCPcopy Create free account
hub / github.com/Kitware/CMake / InitialPass

Method InitialPass

Source/cmFindLibraryCommand.cxx:39–85  ·  view source on GitHub ↗

cmFindLibraryCommand

Source from the content-addressed store, hash-verified

37
38// cmFindLibraryCommand
39bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
40{
41 this->CMakePathName = "LIBRARY";
42
43 if (!this->ParseArguments(argsIn)) {
44 return false;
45 }
46
47 this->FullDebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
48 if (this->FullDebugMode || !this->ComputeIfImplicitDebugModeSuppressed()) {
49 this->DebugState = cm::make_unique<cmFindBaseDebugState>(this);
50 }
51
52 if (this->IsFound()) {
53 this->NormalizeFindResult();
54 return true;
55 }
56
57 // add custom lib<qual> paths instead of using fixed lib32, lib64 or
58 // libx32
59 if (cmValue customLib = this->Makefile->GetDefinition(
60 "CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX")) {
61 this->AddArchitecturePaths(customLib->c_str());
62 }
63 // add special 32 bit paths if this is a 32 bit compile.
64 else if (this->Makefile->PlatformIs32Bit() &&
65 this->Makefile->GetState()->GetGlobalPropertyAsBool(
66 "FIND_LIBRARY_USE_LIB32_PATHS")) {
67 this->AddArchitecturePaths("32");
68 }
69 // add special 64 bit paths if this is a 64 bit compile.
70 else if (this->Makefile->PlatformIs64Bit() &&
71 this->Makefile->GetState()->GetGlobalPropertyAsBool(
72 "FIND_LIBRARY_USE_LIB64_PATHS")) {
73 this->AddArchitecturePaths("64");
74 }
75 // add special 32 bit paths if this is an x32 compile.
76 else if (this->Makefile->PlatformIsx32() &&
77 this->Makefile->GetState()->GetGlobalPropertyAsBool(
78 "FIND_LIBRARY_USE_LIBX32_PATHS")) {
79 this->AddArchitecturePaths("x32");
80 }
81
82 std::string const library = this->FindLibrary();
83 this->StoreFindResult(library);
84 return true;
85}
86
87void cmFindLibraryCommand::AddArchitecturePaths(char const* suffix)
88{

Callers 1

cmFindLibraryFunction · 0.45

Calls 15

AddArchitecturePathsMethod · 0.95
FindLibraryMethod · 0.95
NormalizeFindResultMethod · 0.80
c_strMethod · 0.80
PlatformIs32BitMethod · 0.80
PlatformIs64BitMethod · 0.80
PlatformIsx32Method · 0.80
StoreFindResultMethod · 0.80
ParseArgumentsMethod · 0.45

Tested by

no test coverage detected