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

Method FindConfig

Source/cmFindPackageCommand.cxx:1926–1990  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1924}
1925
1926bool cmFindPackageCommand::FindConfig()
1927{
1928 // Compute the set of search prefixes.
1929 this->ComputePrefixes();
1930
1931 // Look for the project's configuration file.
1932 bool found = false;
1933 if (this->DebugModeEnabled()) {
1934 this->DebugBuffer = cmStrCat(this->DebugBuffer,
1935 "find_package considered the following "
1936 "locations for ",
1937 this->Name, "'s Config module:\n");
1938 }
1939
1940 if (!found && this->UseCpsFiles) {
1941 found = this->FindEnvironmentConfig();
1942 }
1943
1944 // Search for frameworks.
1945 if (!found && (this->SearchFrameworkFirst || this->SearchFrameworkOnly)) {
1946 found = this->FindFrameworkConfig();
1947 }
1948
1949 // Search for apps.
1950 if (!found && (this->SearchAppBundleFirst || this->SearchAppBundleOnly)) {
1951 found = this->FindAppBundleConfig();
1952 }
1953
1954 // Search prefixes.
1955 if (!found && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) {
1956 found = this->FindPrefixedConfig();
1957 }
1958
1959 // Search for frameworks.
1960 if (!found && this->SearchFrameworkLast) {
1961 found = this->FindFrameworkConfig();
1962 }
1963
1964 // Search for apps.
1965 if (!found && this->SearchAppBundleLast) {
1966 found = this->FindAppBundleConfig();
1967 }
1968
1969 if (this->DebugModeEnabled()) {
1970 if (found) {
1971 this->DebugBuffer = cmStrCat(
1972 this->DebugBuffer, "The file was found at\n ", this->FileFound, '\n');
1973 } else {
1974 this->DebugBuffer =
1975 cmStrCat(this->DebugBuffer, "The file was not found.\n");
1976 }
1977 }
1978
1979 // Store the entry in the cache so it can be set by the user.
1980 std::string init;
1981 if (found) {
1982 init = cmSystemTools::GetFilenamePath(this->FileFound);
1983 } else {

Callers 1

HandlePackageModeMethod · 0.95

Calls 8

ComputePrefixesMethod · 0.95
FindEnvironmentConfigMethod · 0.95
FindFrameworkConfigMethod · 0.95
FindAppBundleConfigMethod · 0.95
FindPrefixedConfigMethod · 0.95
DebugModeEnabledMethod · 0.80
cmStrCatFunction · 0.70

Tested by

no test coverage detected