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

Method AddLibrary

Source/cmMakefile.cxx:2014–2036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2012}
2013
2014cmTarget* cmMakefile::AddLibrary(std::string const& lname,
2015 cmStateEnums::TargetType type,
2016 std::vector<std::string> const& srcs,
2017 bool excludeFromAll)
2018{
2019 assert(type == cmStateEnums::STATIC_LIBRARY ||
2020 type == cmStateEnums::SHARED_LIBRARY ||
2021 type == cmStateEnums::MODULE_LIBRARY ||
2022 type == cmStateEnums::OBJECT_LIBRARY ||
2023 type == cmStateEnums::INTERFACE_LIBRARY);
2024
2025 cmTarget* target = this->AddNewTarget(type, lname);
2026 // Clear its dependencies. Otherwise, dependencies might persist
2027 // over changes in CMakeLists.txt, making the information stale and
2028 // hence useless.
2029 target->ClearDependencyInformation(*this);
2030 if (excludeFromAll) {
2031 target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
2032 }
2033 target->AddSources(srcs);
2034 this->AddGlobalLinkInformation(*target);
2035 return target;
2036}
2037
2038cmTarget* cmMakefile::AddExecutable(std::string const& exeName,
2039 std::vector<std::string> const& srcs,

Callers 5

HandleTargetsModeFunction · 0.45
cmAddLibraryCommandFunction · 0.45
CreateCxxStdlibTargetFunction · 0.45

Calls 5

AddNewTargetMethod · 0.95
AddSourcesMethod · 0.80
SetPropertyMethod · 0.45

Tested by

no test coverage detected