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

Method CreateCustomCommands

Source/cmGlobalXCodeGenerator.cxx:1880–2041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1878}
1879
1880void cmGlobalXCodeGenerator::CreateCustomCommands(
1881 cmXCodeObject* buildPhases, cmXCodeObject* sourceBuildPhase,
1882 cmXCodeObject* headerBuildPhase, cmXCodeObject* resourceBuildPhase,
1883 std::vector<cmXCodeObject*> const& contentBuildPhases,
1884 cmXCodeObject* frameworkBuildPhase, cmGeneratorTarget* gtgt)
1885{
1886 std::vector<cmCustomCommand> const& prebuild = gtgt->GetPreBuildCommands();
1887 std::vector<cmCustomCommand> const& prelink = gtgt->GetPreLinkCommands();
1888 std::vector<cmCustomCommand> postbuild = gtgt->GetPostBuildCommands();
1889
1890 if (gtgt->GetType() == cmStateEnums::SHARED_LIBRARY &&
1891 !gtgt->IsFrameworkOnApple()) {
1892 std::string str_file = cmStrCat("$<TARGET_FILE:", gtgt->GetName(), '>');
1893 std::string str_so_file =
1894 cmStrCat("$<TARGET_SONAME_FILE:", gtgt->GetName(), '>');
1895 std::string str_link_file =
1896 cmStrCat("$<TARGET_LINKER_LIBRARY_FILE:", gtgt->GetName(), '>');
1897 cmCustomCommandLines cmd = cmMakeSingleCommandLine(
1898 { cmSystemTools::GetCMakeCommand(), "-E", "cmake_symlink_library",
1899 str_file, str_so_file, str_link_file });
1900
1901 cmCustomCommand command;
1902 command.SetCommandLines(cmd);
1903 command.SetComment("Creating symlinks");
1904 command.SetWorkingDirectory("");
1905 command.SetBacktrace(this->CurrentMakefile->GetBacktrace());
1906 command.SetStdPipesUTF8(true);
1907
1908 postbuild.push_back(std::move(command));
1909 }
1910
1911 if (gtgt->HasImportLibrary("") && !gtgt->IsFrameworkOnApple()) {
1912 // create symbolic links for .tbd file
1913 std::string file = cmStrCat("$<TARGET_IMPORT_FILE:", gtgt->GetName(), '>');
1914 std::string soFile =
1915 cmStrCat("$<TARGET_SONAME_IMPORT_FILE:", gtgt->GetName(), '>');
1916 std::string linkFile =
1917 cmStrCat("$<TARGET_LINKER_IMPORT_FILE:", gtgt->GetName(), '>');
1918 cmCustomCommandLines symlink_command = cmMakeSingleCommandLine(
1919 { cmSystemTools::GetCMakeCommand(), "-E", "cmake_symlink_library", file,
1920 soFile, linkFile });
1921
1922 cmCustomCommand command;
1923 command.SetCommandLines(symlink_command);
1924 command.SetComment("Creating import symlinks");
1925 command.SetWorkingDirectory("");
1926 command.SetBacktrace(this->CurrentMakefile->GetBacktrace());
1927 command.SetStdPipesUTF8(true);
1928
1929 postbuild.push_back(std::move(command));
1930 }
1931
1932 cmXCodeObject* legacyCustomCommandsBuildPhase = nullptr;
1933 cmXCodeObject* preBuildPhase = nullptr;
1934 cmXCodeObject* preLinkPhase = nullptr;
1935 cmXCodeObject* postBuildPhase = nullptr;
1936
1937 if (this->XcodeBuildSystem >= BuildSystem::Twelve) {

Callers 2

CreateXCodeTargetMethod · 0.95
CreateUtilityTargetMethod · 0.95

Calls 15

cmMakeSingleCommandLineFunction · 0.85
moveFunction · 0.85
SetCommandLinesMethod · 0.80
SetStdPipesUTF8Method · 0.80
push_backMethod · 0.80
HasImportLibraryMethod · 0.80
IsBundleOnAppleMethod · 0.80
GetObjectMethod · 0.80

Tested by

no test coverage detected