| 2012 | } |
| 2013 | |
| 2014 | cmTarget* 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 | |
| 2038 | cmTarget* cmMakefile::AddExecutable(std::string const& exeName, |
| 2039 | std::vector<std::string> const& srcs, |
no test coverage detected