diff options
68 files changed, 625 insertions, 381 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index ec741ae..b8c8bea 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -68,7 +68,6 @@ Variables that Provide Information /variable/CMAKE_SKIP_INSTALL_RULES /variable/CMAKE_SKIP_RPATH /variable/CMAKE_SOURCE_DIR - /variable/CMAKE_STANDARD_LIBRARIES /variable/CMAKE_STATIC_LIBRARY_PREFIX /variable/CMAKE_STATIC_LIBRARY_SUFFIX /variable/CMAKE_TOOLCHAIN_FILE @@ -366,6 +365,8 @@ Variables for Languages /variable/CMAKE_LANG_SIMULATE_VERSION /variable/CMAKE_LANG_SIZEOF_DATA_PTR /variable/CMAKE_LANG_SOURCE_FILE_EXTENSIONS + /variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES + /variable/CMAKE_LANG_STANDARD_LIBRARIES /variable/CMAKE_USER_MAKE_RULES_OVERRIDE_LANG Variables for CTest diff --git a/Help/release/dev/cpack-deb-imporvements.rst b/Help/release/dev/cpack-deb-imporvements.rst index 4fd35b8..63312b5 100644 --- a/Help/release/dev/cpack-deb-imporvements.rst +++ b/Help/release/dev/cpack-deb-imporvements.rst @@ -11,17 +11,22 @@ cpack-deb-imporvements * The :module:`CPackDeb` module learned how to generate dependencies between Debian packages if multi-component setup is used and :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables are set. - This breaks compatibility with previous versions. + For backward compatibility this feature is disabled by default. See + :variable:`CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS`. -* The :module:`CPackDeb` module learned how to set the package release number - (``DebianRevisionNumber`` in package file name). See - :variable:`CPACK_DEBIAN_PACKAGE_RELEASE`. - -* The :module:`CPackDeb` module now generates properly-named Debian packages:: +* The :module:`CPackDeb` module learned how to set custom package file names + including how to generate properly-named Debian packages:: <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb - This breaks compatibility with previous versions. + For backward compatibility this feature is disabled by default. See + :variable:`CPACK_DEBIAN_FILE_NAME` and + :variable:`CPACK_DEBIAN_<COMPONENT>_FILE_NAME`. + +* The :module:`CPackDeb` module learned how to set the package release number + (``DebianRevisionNumber`` in package file name when used in combination with + ``DEB-DEFAULT`` value set by :variable:`CPACK_DEBIAN_FILE_NAME`). See + :variable:`CPACK_DEBIAN_PACKAGE_RELEASE`. * The :module:`CPackDeb` module learned how to set the package architecture per-component. See :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE`. diff --git a/Help/release/dev/doc-standard-libs.rst b/Help/release/dev/doc-standard-libs.rst new file mode 100644 index 0000000..6a99037 --- /dev/null +++ b/Help/release/dev/doc-standard-libs.rst @@ -0,0 +1,6 @@ +doc-standard-libs +----------------- + +* The :variable:`CMAKE_<LANG>_STANDARD_LIBRARIES` variable is now documented. + It is intended for use by toolchain files to specify system libraries to be + added to all linker command lines. diff --git a/Help/release/dev/standard-include-directories.rst b/Help/release/dev/standard-include-directories.rst new file mode 100644 index 0000000..a03d7db --- /dev/null +++ b/Help/release/dev/standard-include-directories.rst @@ -0,0 +1,6 @@ +standard-include-directories +---------------------------- + +* A :variable:`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable was + added for use by toolchain files to specify system include directories + to be appended to all compiler command lines. diff --git a/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst new file mode 100644 index 0000000..c8e3d57 --- /dev/null +++ b/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst @@ -0,0 +1,14 @@ +CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES +----------------------------------------- + +Include directories to be used for every source file compiled with +the ``<LANG>`` compiler. This is meant for specification of system +include directories needed by the language for the current platform. +The directories always appear at the end of the include path passed +to the compiler. + +This variable should not be set by project code. It is meant to be set by +CMake's platform information modules for the current toolchain, or by a +toolchain file when used with :variable:`CMAKE_TOOLCHAIN_FILE`. + +See also :variable:`CMAKE_<LANG>_STANDARD_LIBRARIES`. diff --git a/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst b/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst new file mode 100644 index 0000000..ba6df93 --- /dev/null +++ b/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst @@ -0,0 +1,12 @@ +CMAKE_<LANG>_STANDARD_LIBRARIES +------------------------------- + +Libraries linked into every executable and shared library linked +for language ``<LANG>``. This is meant for specification of system +libraries needed by the language for the current platform. + +This variable should not be set by project code. It is meant to be set by +CMake's platform information modules for the current toolchain, or by a +toolchain file when used with :variable:`CMAKE_TOOLCHAIN_FILE`. + +See also :variable:`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`. diff --git a/Help/variable/CMAKE_STANDARD_LIBRARIES.rst b/Help/variable/CMAKE_STANDARD_LIBRARIES.rst deleted file mode 100644 index 9c728cd..0000000 --- a/Help/variable/CMAKE_STANDARD_LIBRARIES.rst +++ /dev/null @@ -1,7 +0,0 @@ -CMAKE_STANDARD_LIBRARIES ------------------------- - -Libraries linked into every executable and shared library. - -This is the list of libraries that are linked into all executables and -libraries. diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake index e34f8cd..1959f22 100644 --- a/Modules/CPackDMG.cmake +++ b/Modules/CPackDMG.cmake @@ -19,7 +19,7 @@ # # The disk image format. Common values are UDRO (UDIF read-only), UDZO (UDIF # zlib-compressed) or UDBZ (UDIF bzip2-compressed). Refer to hdiutil(1) for -# more information on other available formats. +# more information on other available formats. Defaults to UDZO. # # .. variable:: CPACK_DMG_DS_STORE # diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index d93d924..ebeb387 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -42,6 +42,32 @@ # # See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source # +# .. variable:: CPACK_DEBIAN_FILE_NAME +# CPACK_DEBIAN_<COMPONENT>_FILE_NAME +# +# Package file name. +# +# * Mandatory : YES +# * Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].deb`` +# +# This may be set to ``DEB-DEFAULT`` to allow CPackDeb to generate package file +# name by itself in deb format:: +# +# <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb +# +# Alternatively provided package file name must end with ".deb" suffix. +# +# .. note:: +# +# Preferred setting of this variable is ``DEB-DEFAULT`` but for backward +# compatibility with CPackDeb in CMake prior to version 3.6 this feature +# is disabled by default. +# +# .. note:: +# +# By using non default filenames duplicate names may occur. Duplicate files +# get overwritten and it is up to the packager to set the variables in a +# manner that will prevent such errors. # # .. variable:: CPACK_DEBIAN_PACKAGE_VERSION # @@ -100,6 +126,13 @@ # # set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)") # +# .. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS +# +# Sets inter component dependencies if listed with +# :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables. +# +# * Mandatory : NO +# * Default : - # # .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER # @@ -466,6 +499,17 @@ if(NOT UNIX) message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.") endif() +function(cpack_deb_variable_fallback OUTPUT_VAR_NAME) + set(FALLBACK_VAR_NAMES ${ARGN}) + + foreach(variable_name IN LISTS FALLBACK_VAR_NAMES) + if(${variable_name}) + set(${OUTPUT_VAR_NAME} "${${variable_name}}" PARENT_SCOPE) + break() + endif() + endforeach() +endfunction() + function(get_component_package_name var component) string(TOUPPER "${component}" component_upcase) if(CPACK_DEBIAN_${component_upcase}_PACKAGE_NAME) @@ -713,20 +757,23 @@ function(cpack_deb_prepare_package_vars) endif() endif() endforeach() - set(COMPONENT_DEPENDS "") - foreach (_PACK ${CPACK_COMPONENT_${_local_component_name}_DEPENDS}) - get_component_package_name(_PACK_NAME "${_PACK}") + + if(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS) + set(COMPONENT_DEPENDS "") + foreach (_PACK ${CPACK_COMPONENT_${_local_component_name}_DEPENDS}) + get_component_package_name(_PACK_NAME "${_PACK}") + if(COMPONENT_DEPENDS) + set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION}), ${COMPONENT_DEPENDS}") + else() + set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION})") + endif() + endforeach() if(COMPONENT_DEPENDS) - set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION}), ${COMPONENT_DEPENDS}") - else() - set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION})") - endif() - endforeach() - if(COMPONENT_DEPENDS) - if(CPACK_DEBIAN_PACKAGE_DEPENDS) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") - else() - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}") + if(CPACK_DEBIAN_PACKAGE_DEPENDS) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") + else() + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}") + endif() endif() endif() endif() @@ -878,13 +925,32 @@ function(cpack_deb_prepare_package_vars) set(CPACK_DEBIAN_PACKAGE_RELEASE 1) endif() - # Patch package file name to be in corrent debian format: - # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb - set(CPACK_OUTPUT_FILE_NAME - "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") - set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_OUTPUT_FILE_NAME}") - get_filename_component(BINARY_DIR "${CPACK_OUTPUT_FILE_PATH}" DIRECTORY) - set(CPACK_OUTPUT_FILE_PATH "${BINARY_DIR}/${CPACK_OUTPUT_FILE_NAME}") + + cpack_deb_variable_fallback("CPACK_DEBIAN_FILE_NAME" + "CPACK_DEBIAN_${_local_component_name}_FILE_NAME" + "CPACK_DEBIAN_FILE_NAME") + if(CPACK_DEBIAN_FILE_NAME) + if(CPACK_DEBIAN_FILE_NAME STREQUAL "DEB-DEFAULT") + # Patch package file name to be in corrent debian format: + # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb + set(CPACK_OUTPUT_FILE_NAME + "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") + else() + cmake_policy(PUSH) + cmake_policy(SET CMP0010 NEW) + if(NOT CPACK_DEBIAN_FILE_NAME MATCHES ".*\\.deb") + cmake_policy(POP) + message(FATAL_ERROR "'${CPACK_DEBIAN_FILE_NAME}' is not a valid DEB package file name as it must end with '.deb'!") + endif() + cmake_policy(POP) + + set(CPACK_OUTPUT_FILE_NAME "${CPACK_DEBIAN_FILE_NAME}") + endif() + + set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_OUTPUT_FILE_NAME}") + get_filename_component(BINARY_DIR "${CPACK_OUTPUT_FILE_PATH}" DIRECTORY) + set(CPACK_OUTPUT_FILE_PATH "${BINARY_DIR}/${CPACK_OUTPUT_FILE_NAME}") + endif() # else() back compatibility - don't change the name # Print out some debug information if we were asked for that if(CPACK_DEBIAN_PACKAGE_DEBUG) diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 4cfc9d2..083fc28 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -4,8 +4,8 @@ # # .. _QtIFW: http://doc.qt.io/qtinstallerframework/index.html # -# This module looks for the location of the command line utilities supplied with -# the Qt Installer Framework (QtIFW_). +# This module looks for the location of the command line utilities supplied +# with the Qt Installer Framework (QtIFW_). # # The module also defines several commands to control the behavior of the # CPack ``IFW`` generator. @@ -31,7 +31,8 @@ # Variables # ^^^^^^^^^ # -# You can use the following variables to change behavior of CPack ``IFW`` generator. +# You can use the following variables to change behavior of CPack ``IFW`` +# generator. # # Debug # """""" @@ -65,7 +66,8 @@ # # .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON # -# Filename for a custom window icon in PNG format for the Installer application. +# Filename for a custom window icon in PNG format for the Installer +# application. # # .. variable:: CPACK_IFW_PACKAGE_LOGO # @@ -80,7 +82,8 @@ # .. variable:: CPACK_IFW_TARGET_DIRECTORY # # Default target directory for installation. -# By default used "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`" +# By default used +# "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`" # # You can use predefined variables. # @@ -186,7 +189,7 @@ # # :: # -# cpack_ifw_configure_component(<compname> [COMMON] +# cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] # [NAME <name>] # [VERSION <version>] # [SCRIPT <script>] @@ -194,20 +197,23 @@ # [DEPENDS <com_id> ...] # [LICENSES <display_name> <file_path> ...]) # -# This command should be called after cpack_add_component command. +# This command should be called after :command:`cpack_add_component` command. # # ``COMMON`` if set, then the component will be packaged and installed as part # of a group to which it belongs. # +# ``ESSENTIAL`` if set, then the package manager stays disabled until that +# component is updated. +# +# ``NAME`` is used to create domain-like identification for this component. +# By default used origin component name. +# # ``VERSION`` is version of component. # By default used :variable:`CPACK_PACKAGE_VERSION`. # # ``SCRIPT`` is a relative or absolute path to operations script # for this component. # -# ``NAME`` is used to create domain-like identification for this component. -# By default used origin component name. -# # ``PRIORITY`` is priority of the component in the tree. # # ``DEPENDS`` list of dependency component identifiers in QtIFW_ style. @@ -223,21 +229,23 @@ # # :: # -# cpack_ifw_configure_component_group(<grpname> -# [VERSION <version>] +# cpack_ifw_configure_component_group(<groupname> # [NAME <name>] +# [VERSION <version>] # [SCRIPT <script>] # [PRIORITY <priority>] # [LICENSES <display_name> <file_path> ...]) # -# This command should be called after cpack_add_component_group command. +# This command should be called after :command:`cpack_add_component_group` +# command. +# +# ``NAME`` is used to create domain-like identification for this component +# group. +# By default used origin component group name. # # ``VERSION`` is version of component group. # By default used :variable:`CPACK_PACKAGE_VERSION`. # -# ``NAME`` is used to create domain-like identification for this component group. -# By default used origin component group name. -# # ``SCRIPT`` is a relative or absolute path to operations script # for this component group. # @@ -260,8 +268,8 @@ # [PASSWORD <password>] # [DISPLAY_NAME <display_name>]) # -# This macro will also add the <reponame> repository -# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL` +# This command will also add the <reponame> repository +# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`. # # ``DISABLED`` if set, then the repository will be disabled by default. # @@ -289,9 +297,8 @@ # [PASSWORD <password>] # [DISPLAY_NAME <display_name>]) # -# Specified will -# This macro will also add the repository action -# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL` +# This command will also add the <reponame> repository +# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`. # # ``URL`` is points to a list of available components. # @@ -541,8 +548,8 @@ macro(cpack_ifw_configure_component compname) string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME) - set(_IFW_OPT COMMON) - set(_IFW_ARGS VERSION SCRIPT NAME PRIORITY) + set(_IFW_OPT COMMON ESSENTIAL) + set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) set(_IFW_MULTI_ARGS DEPENDS LICENSES) cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index ad6de18..2ff18fc 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2021,6 +2021,8 @@ function(_ep_add_update_command name) --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args}) set(always 1) elseif(git_repository) + unset(CMAKE_MODULE_PATH) # Use CMake builtin find module + find_package(Git QUIET) if(NOT GIT_EXECUTABLE) message(FATAL_ERROR "error: could not find git for fetch of ${name}") endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index aff7676..447d29f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 5) -set(CMake_VERSION_PATCH 20160523) +set(CMake_VERSION_PATCH 20160525) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 5bc1a0b..df612e5 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -146,6 +146,7 @@ void cmCPackIFWPackage::DefaultConfiguration() Licenses.clear(); SortingPriority = ""; Default = ""; + Essential = ""; Virtual = ""; ForcedInstallation = ""; } @@ -267,6 +268,11 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component) // Default Default = component->IsDisabledByDefault ? "false" : "true"; + // Essential + if (this->IsOn(prefix + "ESSENTIAL")) { + Essential = "true"; + } + // Virtual Virtual = component->IsHidden ? "true" : ""; @@ -452,6 +458,11 @@ void cmCPackIFWPackage::GeneratePackageFile() xout.Element("Default", Default); } + // Essential + if (!Essential.empty()) { + xout.Element("Essential", Essential); + } + // Priority if (!SortingPriority.empty()) { xout.Element("SortingPriority", SortingPriority); diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index 8a566cb..55b07ec 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -101,6 +101,9 @@ public: /// Set to true to preselect the component in the installer std::string Default; + /// Marks the package as essential to force a restart of the MaintenanceTool + std::string Essential; + /// Set to true to hide the component from the installer std::string Virtual; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 7675677..7fd76df 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -57,8 +57,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel, // Begin the archive for this pack std::string localToplevel(initialTopLevel); std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel)); - std::string outputFileName(cmsys::SystemTools::LowerCase(std::string( - this->GetOption("CPACK_PACKAGE_FILE_NAME"))) + + std::string outputFileName(std::string( + this->GetOption("CPACK_PACKAGE_FILE_NAME")) + "-" + packageName + this->GetOutputExtension()); localToplevel += "/" + packageName; @@ -174,8 +174,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne( // The ALL GROUPS in ONE package case std::string localToplevel(initialTopLevel); std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel)); - std::string outputFileName(cmsys::SystemTools::LowerCase(std::string( - this->GetOption("CPACK_PACKAGE_FILE_NAME"))) + + std::string outputFileName(std::string( + this->GetOption("CPACK_PACKAGE_FILE_NAME")) + this->GetOutputExtension()); // all GROUP in one vs all COMPONENT in one localToplevel += "/" + compInstDirName; diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 6b2d1e3..c630971 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -43,8 +43,8 @@ std::string const& cmCommonTargetGenerator::GetConfigName() const } std::string cmCommonTargetGenerator::Convert( - std::string const& source, cmLocalGenerator::RelativeRoot relative, - cmLocalGenerator::OutputFormat output) + std::string const& source, cmOutputConverter::RelativeRoot relative, + cmOutputConverter::OutputFormat output) { return this->LocalGenerator->Convert(source, relative, output); } @@ -140,7 +140,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags) std::string mod_dir = this->GetFortranModuleDirectory(); if (!mod_dir.empty()) { mod_dir = - this->Convert(mod_dir, this->WorkingDirectory, cmLocalGenerator::SHELL); + this->Convert(mod_dir, this->WorkingDirectory, cmOutputConverter::SHELL); } else { mod_dir = this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT"); @@ -167,7 +167,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags) idi != includes.end(); ++idi) { std::string flg = modpath_flag; flg += - this->Convert(*idi, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + this->Convert(*idi, cmOutputConverter::NONE, cmOutputConverter::SHELL); this->LocalGenerator->AppendFlags(flags, flg); } } @@ -177,18 +177,18 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags( std::string& flags, cmSourceFile const& source) { const char* srcfmt = source.GetProperty("Fortran_FORMAT"); - cmLocalGenerator::FortranFormat format = + cmOutputConverter::FortranFormat format = this->LocalGenerator->GetFortranFormat(srcfmt); - if (format == cmLocalGenerator::FortranFormatNone) { + if (format == cmOutputConverter::FortranFormatNone) { const char* tgtfmt = this->GeneratorTarget->GetProperty("Fortran_FORMAT"); format = this->LocalGenerator->GetFortranFormat(tgtfmt); } const char* var = 0; switch (format) { - case cmLocalGenerator::FortranFormatFixed: + case cmOutputConverter::FortranFormatFixed: var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; break; - case cmLocalGenerator::FortranFormatFree: + case cmOutputConverter::FortranFormatFree: var = "CMAKE_Fortran_FORMAT_FREE_FLAG"; break; default: @@ -244,7 +244,7 @@ std::string cmCommonTargetGenerator::GetFrameworkFlags(std::string const& l) if (emitted.insert(*i).second) { flags += fwSearchFlag; flags += this->LocalGenerator->ConvertToOutputFormat( - *i, cmLocalGenerator::SHELL); + *i, cmOutputConverter::SHELL); flags += " "; } } diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index c5d324f..c9645e7 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -65,8 +65,8 @@ protected: void AddFortranFlags(std::string& flags); std::string Convert( - std::string const& source, cmLocalGenerator::RelativeRoot relative, - cmLocalGenerator::OutputFormat output = cmLocalGenerator::UNCHANGED); + std::string const& source, cmOutputConverter::RelativeRoot relative, + cmOutputConverter::OutputFormat output = cmOutputConverter::UNCHANGED); void AppendFortranFormatFlags(std::string& flags, cmSourceFile const& source); diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 0a5c7fa..78bb1b2 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -238,17 +238,17 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, // convert the dependencies to paths relative to the home output // directory. We must do the same here. std::string obj_i = - this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT); + this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT); std::string obj_m = this->LocalGenerator->ConvertToOutputFormat( - obj_i, cmLocalGenerator::MAKERULE); + obj_i, cmOutputConverter::MAKERULE); internalDepends << obj_i << std::endl; for (std::set<std::string>::const_iterator i = dependencies.begin(); i != dependencies.end(); ++i) { makeDepends << obj_m << ": " - << this->LocalGenerator->Convert(*i, - cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE) + << this->LocalGenerator->Convert( + *i, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE) << std::endl; internalDepends << " " << *i << std::endl; } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index b8af178..8aa358c 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -192,16 +192,16 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, stamp += ".mod.stamp"; fcStream << "\n"; fcStream << " \"" - << this->LocalGenerator->Convert(mod_lower, - cmLocalGenerator::START_OUTPUT) + << this->LocalGenerator->Convert( + mod_lower, cmOutputConverter::START_OUTPUT) << "\"\n"; fcStream << " \"" - << this->LocalGenerator->Convert(mod_upper, - cmLocalGenerator::START_OUTPUT) + << this->LocalGenerator->Convert( + mod_upper, cmOutputConverter::START_OUTPUT) << "\"\n"; fcStream << " \"" - << this->LocalGenerator->Convert(stamp, - cmLocalGenerator::START_OUTPUT) + << this->LocalGenerator->Convert( + stamp, cmOutputConverter::START_OUTPUT) << "\"\n"; } fcStream << " )\n"; @@ -317,17 +317,17 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, // Write the include dependencies to the output stream. std::string obj_i = - this->LocalGenerator->Convert(obj, cmLocalGenerator::HOME_OUTPUT); + this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT); std::string obj_m = this->LocalGenerator->ConvertToOutputFormat( - obj_i, cmLocalGenerator::MAKERULE); + obj_i, cmOutputConverter::MAKERULE); internalDepends << obj_i << std::endl; internalDepends << " " << src << std::endl; for (std::set<std::string>::const_iterator i = info.Includes.begin(); i != info.Includes.end(); ++i) { makeDepends << obj_m << ": " - << this->LocalGenerator->Convert(*i, - cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE) + << this->LocalGenerator->Convert( + *i, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE) << std::endl; internalDepends << " " << *i << std::endl; } @@ -354,7 +354,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, proxy += *i; proxy += ".mod.proxy"; proxy = this->LocalGenerator->Convert( - proxy, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); + proxy, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE); // since we require some things add them to our list of requirements makeDepends << obj_m << ".requires: " << proxy << std::endl; @@ -370,8 +370,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, if (!required->second.empty()) { // This module is known. Depend on its timestamp file. std::string stampFile = this->LocalGenerator->Convert( - required->second, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE); + required->second, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE); makeDepends << obj_m << ": " << stampFile << "\n"; } else { // This module is not known to CMake. Try to locate it where @@ -379,7 +379,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, std::string module; if (this->FindModule(*i, module)) { module = this->LocalGenerator->Convert( - module, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); + module, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE); makeDepends << obj_m << ": " << module << "\n"; } } @@ -392,8 +392,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, proxy += "/"; proxy += *i; proxy += ".mod.proxy"; - proxy = this->LocalGenerator->Convert(proxy, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE); + proxy = this->LocalGenerator->Convert( + proxy, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE); makeDepends << proxy << ": " << obj_m << ".provides" << std::endl; } @@ -415,13 +415,13 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, modFile += "/"; modFile += *i; modFile = this->LocalGenerator->Convert( - modFile, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::SHELL); + modFile, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::SHELL); std::string stampFile = stamp_dir; stampFile += "/"; stampFile += m; stampFile += ".mod.stamp"; stampFile = this->LocalGenerator->Convert( - stampFile, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::SHELL); + stampFile, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::SHELL); makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile << " " << stampFile; cmMakefile* mf = this->LocalGenerator->GetMakefile(); @@ -441,7 +441,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, std::string driver = this->TargetDirectory; driver += "/build"; driver = this->LocalGenerator->Convert( - driver, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::MAKERULE); + driver, cmOutputConverter::HOME_OUTPUT, cmOutputConverter::MAKERULE); makeDepends << driver << ": " << obj_m << ".provides.build\n"; } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index a8f2e3f..f1b2e33 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -902,7 +902,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const const std::vector<cmGeneratorTarget*> targets = (*it)->GetGeneratorTargets(); std::string subdir = (*it)->Convert((*it)->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); if (subdir == ".") { subdir = ""; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 31fff9f..8859172 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2415,6 +2415,18 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories( cmDeleteAll(linkInterfaceIncludeDirectoriesEntries); + // Add standard include directories for this language. + std::string const standardIncludesVar = + "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES"; + std::string const standardIncludes = + this->Makefile->GetSafeDefinition(standardIncludesVar); + std::vector<std::string>::size_type const before = includes.size(); + cmSystemTools::ExpandListArgument(standardIncludes, includes); + for (std::vector<std::string>::iterator i = includes.begin() + before; + i != includes.end(); ++i) { + cmSystemTools::ConvertToUnixSlashes(*i); + } + return includes; } diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 5e13d4c..8565fdb 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -322,8 +322,10 @@ void cmGhsMultiTargetGenerator::WriteCompilerDefinitions( void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config, const std::string& language) { - std::vector<std::string> includes = - this->GeneratorTarget->GetIncludeDirectories(config, language); + std::vector<std::string> includes; + this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget, + language, config); + for (std::vector<std::string>::const_iterator includes_i = includes.begin(); includes_i != includes.end(); ++includes_i) { *this->GetFolderBuildStreams() << " -I\"" << *includes_i << "\"" diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3f4c22f..249a3b6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1385,6 +1385,9 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() void cmGlobalGenerator::FinalizeTargetCompileInfo() { + std::vector<std::string> const langs = + this->CMakeInstance->GetState()->GetEnabledLanguages(); + // Construct per-target generator information. for (unsigned int i = 0; i < this->Makefiles.size(); ++i) { cmMakefile* mf = this->Makefiles[i]; @@ -1429,6 +1432,23 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() } } } + + // The standard include directories for each language + // should be treated as system include directories. + std::set<std::string> standardIncludesSet; + for (std::vector<std::string>::const_iterator li = langs.begin(); + li != langs.end(); ++li) { + std::string const standardIncludesVar = + "CMAKE_" + *li + "_STANDARD_INCLUDE_DIRECTORIES"; + std::string const standardIncludesStr = + mf->GetSafeDefinition(standardIncludesVar); + std::vector<std::string> standardIncludesVec; + cmSystemTools::ExpandListArgument(standardIncludesStr, + standardIncludesVec); + standardIncludesSet.insert(standardIncludesVec.begin(), + standardIncludesVec.end()); + } + mf->AddSystemIncludeDirectories(standardIncludesSet); } } @@ -2523,7 +2543,7 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs, // Shorten the output name (in expected use case). cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot()); std::string fname = - converter.Convert(outputs[0], cmLocalGenerator::HOME_OUTPUT); + converter.Convert(outputs[0], cmOutputConverter::HOME_OUTPUT); // Associate the hash with this output. this->RuleHashes[fname] = hash; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index d65b463..44a750f 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -289,7 +289,7 @@ void cmGlobalNinjaGenerator::AddMacOSXContentRule() std::ostringstream cmd; cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(), - cmLocalGenerator::SHELL) + cmOutputConverter::SHELL) << " -E copy $in $out"; this->AddRule("COPY_OSX_CONTENT", cmd.str(), "Copying OS X Content $out", @@ -1166,13 +1166,13 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) std::ostringstream cmd; cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(), - cmLocalGenerator::SHELL) + cmOutputConverter::SHELL) << " -H" << lg->ConvertToOutputFormat(lg->GetSourceDirectory(), - cmLocalGenerator::SHELL) + cmOutputConverter::SHELL) << " -B" << lg->ConvertToOutputFormat(lg->GetBinaryDirectory(), - cmLocalGenerator::SHELL); + cmOutputConverter::SHELL); WriteRule(*this->RulesFileStream, "RERUN_CMAKE", cmd.str(), "Re-running CMake...", "Rule for re-running cmake.", /*depfile=*/"", @@ -1221,7 +1221,7 @@ std::string cmGlobalNinjaGenerator::ninjaCmd() const cmLocalGenerator* lgen = this->LocalGenerators[0]; if (lgen) { return lgen->ConvertToOutputFormat(this->NinjaCommand, - cmLocalGenerator::SHELL); + cmOutputConverter::SHELL); } return "ninja"; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 7b5ea13..1985461 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -311,11 +311,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() cmakefileStream << "# The top level Makefile was generated from the following files:\n" << "set(CMAKE_MAKEFILE_DEPENDS\n" - << " \"" << lg->Convert(cache, cmLocalGenerator::START_OUTPUT) << "\"\n"; + << " \"" << lg->Convert(cache, cmOutputConverter::START_OUTPUT) << "\"\n"; for (std::vector<std::string>::const_iterator i = lfiles.begin(); i != lfiles.end(); ++i) { cmakefileStream << " \"" - << lg->Convert(*i, cmLocalGenerator::START_OUTPUT) + << lg->Convert(*i, cmOutputConverter::START_OUTPUT) << "\"\n"; } cmakefileStream << " )\n\n"; @@ -329,10 +329,10 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() cmakefileStream << "# The corresponding makefile is:\n" << "set(CMAKE_MAKEFILE_OUTPUTS\n" << " \"" - << lg->Convert(makefileName, cmLocalGenerator::START_OUTPUT) + << lg->Convert(makefileName, cmOutputConverter::START_OUTPUT) << "\"\n" << " \"" - << lg->Convert(check, cmLocalGenerator::START_OUTPUT) + << lg->Convert(check, cmOutputConverter::START_OUTPUT) << "\"\n"; cmakefileStream << " )\n\n"; @@ -345,7 +345,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() for (std::vector<std::string>::const_iterator k = outfiles.begin(); k != outfiles.end(); ++k) { cmakefileStream << " \"" - << lg->Convert(*k, cmLocalGenerator::HOME_OUTPUT) + << lg->Convert(*k, cmOutputConverter::HOME_OUTPUT) << "\"\n"; } @@ -358,7 +358,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() tmpStr += cmake::GetCMakeFilesDirectory(); tmpStr += "/CMakeDirectoryInformation.cmake"; cmakefileStream << " \"" - << lg->Convert(tmpStr, cmLocalGenerator::HOME_OUTPUT) + << lg->Convert(tmpStr, cmOutputConverter::HOME_OUTPUT) << "\"\n"; } cmakefileStream << " )\n\n"; @@ -470,8 +470,8 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2( // Begin the directory-level rules section. std::string dir = lg->GetCurrentBinaryDirectory(); - dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE); + dir = lg->Convert(dir, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE); lg->WriteDivider(ruleFileStream); ruleFileStream << "# Directory level rules for directory " << dir << "\n\n"; @@ -716,8 +716,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # in target - progCmd << lg->Convert(progress.Dir, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL, + cmOutputConverter::SHELL); // std::set<cmGeneratorTarget const*> emitted; progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted); @@ -729,8 +729,8 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( { std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << lg->Convert(progress.Dir, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL, + cmOutputConverter::SHELL); progCmd << " 0"; commands.push_back(progCmd.str()); } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index cfe5e49..faee6ae 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -385,7 +385,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( if (vcprojName) { cmLocalGenerator* lg = target->GetLocalGenerator(); std::string dir = lg->GetCurrentBinaryDirectory(); - dir = root->Convert(dir.c_str(), cmLocalGenerator::START_OUTPUT); + dir = root->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT); if (dir == ".") { dir = ""; // msbuild cannot handle ".\" prefix } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index efc239e..a937e9c 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -660,10 +660,10 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( std::string flags; const char* srcfmt = sf->GetProperty("Fortran_FORMAT"); switch (this->CurrentLocalGenerator->GetFortranFormat(srcfmt)) { - case cmLocalGenerator::FortranFormatFixed: + case cmOutputConverter::FortranFormatFixed: flags = "-fixed " + flags; break; - case cmLocalGenerator::FortranFormatFree: + case cmOutputConverter::FortranFormatFree: flags = "-free " + flags; break; default: @@ -1982,10 +1982,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, const char* format = 0; const char* tgtfmt = gtgt->GetProperty("Fortran_FORMAT"); switch (this->CurrentLocalGenerator->GetFortranFormat(tgtfmt)) { - case cmLocalGenerator::FortranFormatFixed: + case cmOutputConverter::FortranFormatFixed: format = "fixed"; break; - case cmLocalGenerator::FortranFormatFree: + case cmOutputConverter::FortranFormatFree: format = "free"; break; default: diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0ff13d9..a350f09 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2140,7 +2140,7 @@ std::string cmLocalGenerator::ConstructComment( for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin(); o != ccg.GetOutputs().end(); ++o) { comment += sep; - comment += this->Convert(*o, cmLocalGenerator::START_OUTPUT); + comment += this->Convert(*o, cmOutputConverter::START_OUTPUT); sep = ", "; } return comment; diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 892ad4f..5c603a6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -174,9 +174,10 @@ public: bool GetRealDependency(const std::string& name, const std::string& config, std::string& dep); - virtual std::string ConvertToIncludeReference(std::string const& path, - OutputFormat format = SHELL, - bool forceFullPaths = false); + virtual std::string ConvertToIncludeReference( + std::string const& path, + cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL, + bool forceFullPaths = false); /** Called from command-line hook to clear dependencies. */ virtual void ClearDependencies(cmMakefile* /* mf */, bool /* verbose */) {} @@ -353,8 +354,9 @@ protected: std::string& CreateSafeUniqueObjectFileName(const std::string& sin, std::string const& dir_max); - virtual std::string ConvertToLinkReference(std::string const& lib, - OutputFormat format = SHELL); + virtual std::string ConvertToLinkReference( + std::string const& lib, + cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL); /** Check whether the native build system supports the given definition. Issues a warning. */ diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index c7e1a90f8..270e6d3 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -41,8 +41,8 @@ void cmLocalNinjaGenerator::Generate() { // Compute the path to use when referencing the current output // directory from the top output directory. - this->HomeRelativeOutputPath = - this->Convert(this->GetCurrentBinaryDirectory(), HOME_OUTPUT); + this->HomeRelativeOutputPath = this->Convert( + this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT); if (this->HomeRelativeOutputPath == ".") { this->HomeRelativeOutputPath = ""; } @@ -121,16 +121,19 @@ cmGlobalNinjaGenerator* cmLocalNinjaGenerator::GetGlobalNinjaGenerator() // Virtual protected methods. std::string cmLocalNinjaGenerator::ConvertToLinkReference( - std::string const& lib, OutputFormat format) + std::string const& lib, cmOutputConverter::OutputFormat format) { std::string path = this->GetGlobalNinjaGenerator()->ConvertToNinjaPath(lib); return this->ConvertToOutputFormat(path, format); } std::string cmLocalNinjaGenerator::ConvertToIncludeReference( - std::string const& path, OutputFormat format, bool forceFullPaths) + std::string const& path, cmOutputConverter::OutputFormat format, + bool forceFullPaths) { - return this->Convert(path, forceFullPaths ? FULL : HOME_OUTPUT, format); + return this->Convert(path, forceFullPaths ? cmOutputConverter::FULL + : cmOutputConverter::HOME_OUTPUT, + format); } // Private methods. @@ -338,7 +341,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines( #else std::string cdStr = "cd "; #endif - cdCmd << cdStr << this->ConvertToOutputFormat(wd, SHELL); + cdCmd << cdStr + << this->ConvertToOutputFormat(wd, cmOutputConverter::SHELL); cmdLines.push_back(cdCmd.str()); } @@ -346,7 +350,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines( for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) { cmdLines.push_back(launcher + - this->ConvertToOutputFormat(ccg.GetCommand(i), SHELL)); + this->ConvertToOutputFormat(ccg.GetCommand(i), + cmOutputConverter::SHELL)); std::string& cmd = cmdLines.back(); ccg.AppendArguments(i, cmd); @@ -473,10 +478,12 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( std::string output; const std::vector<std::string>& outputs = ccg.GetOutputs(); if (!outputs.empty()) { - RelativeRoot relative_root = - ccg.GetWorkingDirectory().empty() ? START_OUTPUT : NONE; + cmOutputConverter::RelativeRoot relative_root = + ccg.GetWorkingDirectory().empty() ? cmOutputConverter::START_OUTPUT + : cmOutputConverter::NONE; - output = this->Convert(outputs[0], relative_root, SHELL); + output = + this->Convert(outputs[0], relative_root, cmOutputConverter::SHELL); } vars.Output = output.c_str(); diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index afaa24c..9899360 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -72,17 +72,19 @@ public: void AppendCustomCommandDeps(cmCustomCommandGenerator const& ccg, cmNinjaDeps& ninjaDeps); - virtual std::string ConvertToLinkReference(std::string const& lib, - OutputFormat format = SHELL); + virtual std::string ConvertToLinkReference( + std::string const& lib, + cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL); virtual void ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, cmGeneratorTarget const* gt = 0); protected: - virtual std::string ConvertToIncludeReference(std::string const& path, - OutputFormat format = SHELL, - bool forceFullPaths = false); + virtual std::string ConvertToIncludeReference( + std::string const& path, + cmOutputConverter::OutputFormat format = cmOutputConverter::SHELL, + bool forceFullPaths = false); private: cmGeneratedFileStream& GetBuildFileStream() const; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 88c6d61..8d4955b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -140,8 +140,8 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath() { // Compute the path to use when referencing the current output // directory from the top output directory. - this->HomeRelativeOutputPath = - this->Convert(this->GetCurrentBinaryDirectory(), HOME_OUTPUT); + this->HomeRelativeOutputPath = this->Convert( + this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT); if (this->HomeRelativeOutputPath == ".") { this->HomeRelativeOutputPath = ""; } @@ -358,7 +358,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule( this->GetRecursiveMakeCall(tgtMakefileName.c_str(), targetName)); } this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); // Write the rule to the makefile. std::vector<std::string> no_depends; @@ -398,7 +398,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( commands.push_back( this->GetRecursiveMakeCall(makefile2.c_str(), localName)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->WriteMakeRule(ruleFileStream, "Convenience name for target.", localName, depends, commands, true); @@ -423,7 +423,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( commands.push_back( this->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->WriteMakeRule(ruleFileStream, "fast build rule for target.", localName, depends, commands, true); @@ -439,7 +439,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( commands.push_back( this->GetRecursiveMakeCall(makefile2.c_str(), makeTargetName)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->WriteMakeRule(ruleFileStream, "Manual pre-install relink rule for target.", localName, depends, commands, true); @@ -546,7 +546,8 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule( } // Construct the left hand side of the rule. - std::string tgt = this->Convert(target, HOME_OUTPUT, MAKERULE); + std::string tgt = this->Convert(target, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE); const char* space = ""; if (tgt.size() == 1) { @@ -573,7 +574,8 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule( for (std::vector<std::string>::const_iterator dep = depends.begin(); dep != depends.end(); ++dep) { replace = *dep; - replace = this->Convert(replace, HOME_OUTPUT, MAKERULE); + replace = this->Convert(replace, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE); os << cmMakeSafe(tgt) << space << ": " << cmMakeSafe(replace) << "\n"; } } @@ -591,7 +593,7 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule( } std::string cmLocalUnixMakefileGenerator3::ConvertShellCommand( - std::string const& cmd, RelativeRoot root) + std::string const& cmd, cmOutputConverter::RelativeRoot root) { if (this->IsWatcomWMake() && cmSystemTools::FileIsFullPath(cmd.c_str()) && cmd.find_first_of("( )") != cmd.npos) { @@ -600,10 +602,11 @@ std::string cmLocalUnixMakefileGenerator3::ConvertShellCommand( // lines with shell redirection operators. std::string scmd; if (cmSystemTools::GetShortPath(cmd, scmd)) { - return this->Convert(scmd, NONE, SHELL); + return this->Convert(scmd, cmOutputConverter::NONE, + cmOutputConverter::SHELL); } } - return this->Convert(cmd, root, SHELL); + return this->Convert(cmd, root, cmOutputConverter::SHELL); } void cmLocalUnixMakefileGenerator3::WriteMakeVariables( @@ -639,13 +642,15 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables( makefileStream << "# The CMake executable.\n" << "CMAKE_COMMAND = " - << this->ConvertShellCommand(cmSystemTools::GetCMakeCommand(), FULL) + << this->ConvertShellCommand(cmSystemTools::GetCMakeCommand(), + cmOutputConverter::FULL) << "\n" << "\n"; makefileStream << "# The command to remove a file.\n" << "RM = " - << this->ConvertShellCommand(cmSystemTools::GetCMakeCommand(), FULL) + << this->ConvertShellCommand(cmSystemTools::GetCMakeCommand(), + cmOutputConverter::FULL) << " -E remove -f\n" << "\n"; makefileStream @@ -655,13 +660,17 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables( makefileStream << "# The top-level source directory on which CMake was run.\n" << "CMAKE_SOURCE_DIR = " - << this->Convert(this->GetSourceDirectory(), FULL, SHELL) + << this->Convert(this->GetSourceDirectory(), + cmOutputConverter::FULL, + cmOutputConverter::SHELL) << "\n" << "\n"; makefileStream << "# The top-level build directory on which CMake was run.\n" << "CMAKE_BINARY_DIR = " - << this->Convert(this->GetBinaryDirectory(), FULL, SHELL) + << this->Convert(this->GetBinaryDirectory(), + cmOutputConverter::FULL, + cmOutputConverter::SHELL) << "\n" << "\n"; /* clang-format on */ @@ -775,7 +784,8 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom( std::string runRule = "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; runRule += " --check-build-system "; - runRule += this->Convert(cmakefileName, NONE, SHELL); + runRule += this->Convert(cmakefileName, cmOutputConverter::NONE, + cmOutputConverter::SHELL); runRule += " 0"; std::vector<std::string> no_depends; @@ -783,7 +793,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom( commands.push_back(runRule); if (!this->IsRootMakefile()) { this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); } this->WriteMakeRule( makefileStream, "Special rule to run CMake to check the build system " @@ -819,7 +829,8 @@ std::string cmLocalUnixMakefileGenerator3::GetRelativeTargetDirectory( { std::string dir = this->HomeRelativeOutputPath; dir += this->GetTargetDirectory(target); - return this->Convert(dir, NONE, UNCHANGED); + return this->Convert(dir, cmOutputConverter::NONE, + cmOutputConverter::UNCHANGED); } void cmLocalUnixMakefileGenerator3::AppendFlags(std::string& flags, @@ -889,7 +900,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomDepend( void cmLocalUnixMakefileGenerator3::AppendCustomCommands( std::vector<std::string>& commands, const std::vector<cmCustomCommand>& ccs, - cmGeneratorTarget* target, cmLocalGenerator::RelativeRoot relative) + cmGeneratorTarget* target, cmOutputConverter::RelativeRoot relative) { for (std::vector<cmCustomCommand>::const_iterator i = ccs.begin(); i != ccs.end(); ++i) { @@ -901,7 +912,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommands( void cmLocalUnixMakefileGenerator3::AppendCustomCommand( std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target, bool echo_comment, - cmLocalGenerator::RelativeRoot relative, std::ostream* content) + cmOutputConverter::RelativeRoot relative, std::ostream* content) { // Optionally create a command to display the custom command's // comment text. This is used for pre-build, pre-link, and @@ -951,7 +962,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( // working directory will be the start-output directory. bool had_slash = cmd.find("/") != cmd.npos; if (workingDir.empty()) { - cmd = this->Convert(cmd, START_OUTPUT); + cmd = this->Convert(cmd, cmOutputConverter::START_OUTPUT); } bool has_slash = cmd.find("/") != cmd.npos; if (had_slash && !has_slash) { @@ -961,8 +972,9 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( cmd = "./" + cmd; } std::string launcher = this->MakeLauncher( - ccg, target, workingDir.empty() ? START_OUTPUT : NONE); - cmd = launcher + this->ConvertShellCommand(cmd, NONE); + ccg, target, workingDir.empty() ? cmOutputConverter::START_OUTPUT + : cmOutputConverter::NONE); + cmd = launcher + this->ConvertShellCommand(cmd, cmOutputConverter::NONE); ccg.AppendArguments(c, cmd); if (content) { @@ -1007,7 +1019,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( std::string cmLocalUnixMakefileGenerator3::MakeLauncher( cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target, - RelativeRoot relative) + cmOutputConverter::RelativeRoot relative) { // Short-circuit if there is no launcher. const char* prop = "RULE_LAUNCH_CUSTOM"; @@ -1024,7 +1036,7 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher( std::string output; const std::vector<std::string>& outputs = ccg.GetOutputs(); if (!outputs.empty()) { - output = this->Convert(outputs[0], relative, SHELL); + output = this->Convert(outputs[0], relative, cmOutputConverter::SHELL); } vars.Output = output.c_str(); @@ -1049,7 +1061,8 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand( cleanfile += filename; } cleanfile += ".cmake"; - std::string cleanfilePath = this->Convert(cleanfile, FULL); + std::string cleanfilePath = + this->Convert(cleanfile, cmOutputConverter::FULL); cmsys::ofstream fout(cleanfilePath.c_str()); if (!fout) { cmSystemTools::Error("Could not create ", cleanfilePath.c_str()); @@ -1058,13 +1071,15 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand( fout << "file(REMOVE_RECURSE\n"; for (std::vector<std::string>::const_iterator f = files.begin(); f != files.end(); ++f) { - std::string fc = this->Convert(*f, START_OUTPUT, UNCHANGED); + std::string fc = this->Convert(*f, cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED); fout << " " << cmOutputConverter::EscapeForCMake(fc) << "\n"; } fout << ")\n"; } std::string remove = "$(CMAKE_COMMAND) -P "; - remove += this->Convert(cleanfile, START_OUTPUT, SHELL); + remove += this->Convert(cleanfile, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); commands.push_back(remove); // For the main clean rule add per-language cleaning. @@ -1133,8 +1148,8 @@ void cmLocalUnixMakefileGenerator3::AppendEcho( cmd += color_name; if (progress) { cmd += "--progress-dir="; - cmd += this->Convert(progress->Dir, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + cmd += this->Convert(progress->Dir, cmOutputConverter::FULL, + cmOutputConverter::SHELL); cmd += " "; cmd += "--progress-num="; cmd += progress->Arg; @@ -1544,9 +1559,9 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( this->AppendCustomDepends(depends, gt->GetPreBuildCommands()); this->AppendCustomDepends(depends, gt->GetPostBuildCommands()); this->AppendCustomCommands(commands, gt->GetPreBuildCommands(), gt, - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->AppendCustomCommands(commands, gt->GetPostBuildCommands(), gt, - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); std::string targetName = gt->GetName(); this->WriteMakeRule(ruleFileStream, targetString.c_str(), targetName, depends, commands, true); @@ -1583,15 +1598,15 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( { std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; - progCmd << this->Convert(progressDir, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + progCmd << this->Convert(progressDir, cmOutputConverter::FULL, + cmOutputConverter::SHELL); std::string progressFile = cmake::GetCMakeFilesDirectory(); progressFile += "/progress.marks"; std::string progressFileNameFull = this->ConvertToFullPath(progressFile); progCmd << " " - << this->Convert(progressFileNameFull, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + << this->Convert(progressFileNameFull, cmOutputConverter::FULL, + cmOutputConverter::SHELL); commands.push_back(progCmd.str()); } std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash(); @@ -1599,12 +1614,12 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( commands.push_back( this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); { std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << this->Convert(progressDir, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + progCmd << this->Convert(progressDir, cmOutputConverter::FULL, + cmOutputConverter::SHELL); progCmd << " 0"; commands.push_back(progCmd.str()); } @@ -1619,7 +1634,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( commands.push_back( this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands, true); commands.clear(); @@ -1645,7 +1660,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( commands.push_back( this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.", "preinstall", depends, commands, true); depends.clear(); @@ -1660,12 +1675,12 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( std::string runRule = "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; runRule += " --check-build-system "; - runRule += this->Convert(cmakefileName, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL); + runRule += this->Convert(cmakefileName, cmOutputConverter::NONE, + cmOutputConverter::SHELL); runRule += " 1"; commands.push_back(runRule); this->CreateCDCommand(commands, this->GetBinaryDirectory(), - cmLocalGenerator::START_OUTPUT); + cmOutputConverter::START_OUTPUT); this->WriteMakeRule(ruleFileStream, "clear depends", "depend", depends, commands, true); } @@ -1832,7 +1847,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( for (std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) { cmakefileStream << " \"" - << this->Convert(*i, cmLocalGenerator::HOME_OUTPUT) + << this->Convert(*i, cmOutputConverter::HOME_OUTPUT) << "\"\n"; } cmakefileStream << " )\n"; @@ -1874,7 +1889,8 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall( // Call make on the given file. std::string cmd; cmd += "$(MAKE) -f "; - cmd += this->Convert(makefile, NONE, SHELL); + cmd += + this->Convert(makefile, cmOutputConverter::NONE, cmOutputConverter::SHELL); cmd += " "; cmGlobalUnixMakefileGenerator3* gg = @@ -1896,7 +1912,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall( // Add the target. if (!tgt.empty()) { // The make target is always relative to the top of the build tree. - std::string tgt2 = this->Convert(tgt, HOME_OUTPUT); + std::string tgt2 = this->Convert(tgt, cmOutputConverter::HOME_OUTPUT); // The target may have been written with windows paths. cmSystemTools::ConvertToOutputSlashes(tgt2); @@ -2031,7 +2047,7 @@ void cmLocalUnixMakefileGenerator3::AddImplicitDepends( void cmLocalUnixMakefileGenerator3::CreateCDCommand( std::vector<std::string>& commands, const char* tgtDir, - cmLocalGenerator::RelativeRoot relRetDir) + cmOutputConverter::RelativeRoot relRetDir) { const char* retDir = this->GetRelativeRootPath(relRetDir); diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 321edcb..a65a1a1 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -120,7 +120,7 @@ public: // create a command that cds to the start dir then runs the commands void CreateCDCommand(std::vector<std::string>& commands, const char* targetDir, - cmLocalGenerator::RelativeRoot returnDir); + cmOutputConverter::RelativeRoot returnDir); static std::string ConvertToQuotedOutputPath(const char* p, bool useWatcomQuote); @@ -230,11 +230,11 @@ protected: void AppendCustomCommands( std::vector<std::string>& commands, const std::vector<cmCustomCommand>& ccs, cmGeneratorTarget* target, - cmLocalGenerator::RelativeRoot relative = cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT); void AppendCustomCommand( std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target, bool echo_comment = false, - cmLocalGenerator::RelativeRoot relative = cmLocalGenerator::HOME_OUTPUT, + cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT, std::ostream* content = 0); void AppendCleanCommand(std::vector<std::string>& commands, const std::vector<std::string>& files, @@ -247,9 +247,11 @@ protected: void CheckMultipleOutputs(bool verbose); private: - std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root); + std::string ConvertShellCommand(std::string const& cmd, + cmOutputConverter::RelativeRoot root); std::string MakeLauncher(cmCustomCommandGenerator const& ccg, - cmGeneratorTarget* target, RelativeRoot relative); + cmGeneratorTarget* target, + cmOutputConverter::RelativeRoot relative); virtual void ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index ad386f7..6e7d7d2 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -269,7 +269,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() args += this->GetBinaryDirectory(); commandLine.push_back(args); commandLine.push_back("--check-stamp-file"); - std::string stampFilename = this->Convert(stampName.c_str(), FULL, SHELL); + std::string stampFilename = this->Convert( + stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::SHELL); commandLine.push_back(stampFilename.c_str()); std::vector<std::string> const& listFiles = this->Makefile->GetListFiles(); @@ -277,8 +278,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() cmCustomCommandLines commandLines; commandLines.push_back(commandLine); const char* no_working_directory = 0; - std::string fullpathStampName = - this->Convert(stampName.c_str(), FULL, UNCHANGED); + std::string fullpathStampName = this->Convert( + stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::UNCHANGED); this->Makefile->AddCustomCommandToOutput( fullpathStampName.c_str(), listFiles, makefileIn.c_str(), commandLines, comment.c_str(), no_working_directory, true); @@ -683,10 +684,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( if (this->FortranProject) { switch (this->GetFortranFormat(target->GetProperty("Fortran_FORMAT"))) { - case FortranFormatFixed: + case cmOutputConverter::FortranFormatFixed: flags += " -fixed"; break; - case FortranFormatFree: + case cmOutputConverter::FortranFormatFree: flags += " -free"; break; default: @@ -786,8 +787,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( target->GetProperty("Fortran_MODULE_DIRECTORY"); std::string modDir; if (target_mod_dir) { - modDir = this->Convert(target_mod_dir, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED); + modDir = this->Convert(target_mod_dir, cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED); } else { modDir = "."; } @@ -1006,8 +1007,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( linkOptions.Parse(extraLinkOptions.c_str()); if (!this->ModuleDefinitionFile.empty()) { - std::string defFile = - this->ConvertToOutputFormat(this->ModuleDefinitionFile, SHELL); + std::string defFile = this->ConvertToOutputFormat( + this->ModuleDefinitionFile, cmOutputConverter::SHELL); linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str()); } @@ -1298,8 +1299,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries( for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) { if (l->IsPath) { std::string rel = - lg->Convert(l->Value.c_str(), cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED); + lg->Convert(l->Value.c_str(), cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED); fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " "; } else if (!l->Target || l->Target->GetType() != cmState::INTERFACE_LIBRARY) { @@ -1319,8 +1320,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects( const char* sep = isep ? isep : ""; for (std::vector<std::string>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { - std::string rel = lg->Convert(oi->c_str(), cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED); + std::string rel = lg->Convert(oi->c_str(), cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED); fout << sep << lg->ConvertToXMLOutputPath(rel.c_str()); sep = " "; } @@ -1343,7 +1344,9 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories( // Switch to a relative path specification if it is shorter. if (cmSystemTools::FileIsFullPath(dir.c_str())) { - std::string rel = this->Convert(dir.c_str(), START_OUTPUT, UNCHANGED); + std::string rel = + this->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED); if (rel.size() < dir.size()) { dir = rel; } @@ -1472,11 +1475,11 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( } if (lg->FortranProject) { switch (lg->GetFortranFormat(sf.GetProperty("Fortran_FORMAT"))) { - case cmLocalGenerator::FortranFormatFixed: + case cmOutputConverter::FortranFormatFixed: fc.CompileFlags = "-fixed " + fc.CompileFlags; needfc = true; break; - case cmLocalGenerator::FortranFormatFree: + case cmOutputConverter::FortranFormatFree: fc.CompileFlags = "-free " + fc.CompileFlags; needfc = true; break; @@ -2042,7 +2045,8 @@ std::string cmLocalVisualStudio7Generator::EscapeForXML(const std::string& s) std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath( const char* path) { - std::string ret = this->ConvertToOutputFormat(path, SHELL); + std::string ret = + this->ConvertToOutputFormat(path, cmOutputConverter::SHELL); cmSystemTools::ReplaceString(ret, "&", "&"); cmSystemTools::ReplaceString(ret, "\"", """); cmSystemTools::ReplaceString(ret, "<", "<"); @@ -2053,7 +2057,8 @@ std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPath( std::string cmLocalVisualStudio7Generator::ConvertToXMLOutputPathSingle( const char* path) { - std::string ret = this->ConvertToOutputFormat(path, SHELL); + std::string ret = + this->ConvertToOutputFormat(path, cmOutputConverter::SHELL); cmSystemTools::ReplaceString(ret, "\"", ""); cmSystemTools::ReplaceString(ret, "&", "&"); cmSystemTools::ReplaceString(ret, "<", "<"); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7e99f2c..e684689 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1574,6 +1574,10 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string>& incs, void cmMakefile::AddSystemIncludeDirectories(const std::set<std::string>& incs) { + if (incs.empty()) { + return; + } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); for (cmTargets::iterator l = this->Targets.begin(); l != this->Targets.end(); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 674bc2f..51231fc 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -128,16 +128,16 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string targetFullPathPDB = pdbOutputPath + targetNamePDB; std::string targetFullPathImport = outpathImp + targetNameImport; std::string targetOutPathPDB = this->Convert( - targetFullPathPDB, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); // Convert to the output path to use in constructing commands. std::string targetOutPath = this->Convert( - targetFullPath, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); + targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL); std::string targetOutPathReal = - this->Convert(targetFullPathReal, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); std::string targetOutPathImport = - this->Convert(targetFullPathImport, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + this->Convert(targetFullPathImport, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); // Get the language to use for linking this executable. std::string linkLanguage = @@ -209,29 +209,30 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // may need to be cleaned. std::vector<std::string> exeCleanFiles; exeCleanFiles.push_back(this->Convert(targetFullPath, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); #ifdef _WIN32 // There may be a manifest file for this target. Add it to the // clean set just in case. exeCleanFiles.push_back(this->Convert((targetFullPath + ".manifest").c_str(), - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); #endif if (targetNameReal != targetName) { exeCleanFiles.push_back(this->Convert(targetFullPathReal, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); } if (!targetNameImport.empty()) { exeCleanFiles.push_back(this->Convert(targetFullPathImport, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); std::string implib; if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport, implib)) { - exeCleanFiles.push_back(this->Convert( - implib, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::UNCHANGED)); + exeCleanFiles.push_back(this->Convert(implib, + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); } } @@ -239,8 +240,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // cleaned. We do not want to delete the .pdb file just before // linking the target. this->CleanFiles.push_back(this->Convert(targetFullPathPDB, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); // Add the pre-build and pre-link rules building but not when relinking. if (!relink) { @@ -323,14 +324,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) vars.Language = linkLanguage.c_str(); vars.Objects = buildObjs.c_str(); std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); - objectDir = this->Convert(objectDir, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); vars.ObjectDir = objectDir.c_str(); - cmLocalGenerator::OutputFormat output = (useWatcomQuote) - ? cmLocalGenerator::WATCOMQUOTE - : cmLocalGenerator::SHELL; - std::string target = this->Convert(targetFullPathReal, - cmLocalGenerator::START_OUTPUT, output); + cmOutputConverter::OutputFormat output = (useWatcomQuote) + ? cmOutputConverter::WATCOMQUOTE + : cmOutputConverter::SHELL; + std::string target = this->Convert( + targetFullPathReal, cmOutputConverter::START_OUTPUT, output); vars.Target = target.c_str(); vars.TargetPDB = targetOutPathPDB.c_str(); @@ -380,7 +381,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); @@ -393,7 +394,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) commands1.push_back(symlink); this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 25235ea..7f5bc11 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -301,17 +301,18 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Construct the output path version of the names for use in command // arguments. std::string targetOutPathPDB = this->Convert( - targetFullPathPDB, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); std::string targetOutPath = this->Convert( - targetFullPath, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); - std::string targetOutPathSO = this->Convert( - targetFullPathSO, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); + targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL); + std::string targetOutPathSO = + this->Convert(targetFullPathSO, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); std::string targetOutPathReal = - this->Convert(targetFullPathReal, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); std::string targetOutPathImport = - this->Convert(targetFullPathImport, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + this->Convert(targetFullPathImport, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); this->NumberOfProgressActions++; if (!this->NoRuleMessages) { @@ -357,27 +358,28 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Clean files associated with this library. std::vector<std::string> libCleanFiles; libCleanFiles.push_back(this->Convert(targetFullPath, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); if (targetNameReal != targetName) { libCleanFiles.push_back(this->Convert(targetFullPathReal, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); } if (targetNameSO != targetName && targetNameSO != targetNameReal) { libCleanFiles.push_back(this->Convert(targetFullPathSO, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); } if (!targetNameImport.empty()) { libCleanFiles.push_back(this->Convert(targetFullPathImport, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); std::string implib; if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport, implib)) { - libCleanFiles.push_back(this->Convert( - implib, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::UNCHANGED)); + libCleanFiles.push_back(this->Convert(implib, + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); } } @@ -385,16 +387,16 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // cleaned. We do not want to delete the .pdb file just before // linking the target. this->CleanFiles.push_back(this->Convert(targetFullPathPDB, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); #ifdef _WIN32 // There may be a manifest file for this target. Add it to the // clean set just in case. if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) { libCleanFiles.push_back(this->Convert( - (targetFullPath + ".manifest").c_str(), cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED)); + (targetFullPath + ".manifest").c_str(), cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED)); } #endif @@ -406,7 +408,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( this->GeneratorTarget, "target"); this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); } @@ -525,16 +527,16 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::string("/") + this->GeneratorTarget->GetName(); name_of_def_file += ".def"; std::string cmd = cmSystemTools::GetCMakeCommand(); - cmd = - this->Convert(cmd, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + cmd = this->Convert(cmd, cmOutputConverter::NONE, + cmOutputConverter::SHELL); cmd += " -E __create_def "; - cmd += this->Convert(name_of_def_file, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + cmd += this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); cmd += " "; std::string objlist_file = name_of_def_file; objlist_file += ".objs"; - cmd += this->Convert(objlist_file, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + cmd += this->Convert(objlist_file, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); real_link_commands.push_back(cmd); // create a list of obj files for the -E __create_def to read cmGeneratedFileStream fout(objlist_file.c_str()); @@ -555,8 +557,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( linkFlags += this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); linkFlags += - this->Convert(name_of_def_file, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); linkFlags += " "; } } @@ -588,14 +590,14 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( vars.Language = linkLanguage.c_str(); vars.Objects = buildObjs.c_str(); std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); - objectDir = this->Convert(objectDir, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); vars.ObjectDir = objectDir.c_str(); - cmLocalGenerator::OutputFormat output = (useWatcomQuote) - ? cmLocalGenerator::WATCOMQUOTE - : cmLocalGenerator::SHELL; - std::string target = this->Convert(targetFullPathReal, - cmLocalGenerator::START_OUTPUT, output); + cmOutputConverter::OutputFormat output = (useWatcomQuote) + ? cmOutputConverter::WATCOMQUOTE + : cmOutputConverter::SHELL; + std::string target = this->Convert( + targetFullPathReal, cmOutputConverter::START_OUTPUT, output); vars.Target = target.c_str(); vars.LinkLibraries = linkLibs.c_str(); vars.ObjectsQuoted = buildObjs.c_str(); @@ -620,7 +622,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } else { // Convert to a path for the native build tool. install_name_dir = this->LocalGenerator->Convert( - install_name_dir, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + install_name_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL); vars.TargetInstallNameDir = install_name_dir.c_str(); } } @@ -707,7 +709,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); @@ -724,7 +726,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( commands1.push_back(symlink); this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index e480140..980a49d 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -162,7 +162,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() for (std::vector<std::string>::const_iterator o = outputs.begin(); o != outputs.end(); ++o) { this->CleanFiles.push_back(this->Convert( - *o, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::UNCHANGED)); + *o, cmOutputConverter::START_OUTPUT, cmOutputConverter::UNCHANGED)); } } } @@ -203,8 +203,8 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() *this->BuildFileStream << "# Include any dependencies generated for this target.\n" << this->GlobalGenerator->IncludeDirective << " " << root - << this->Convert(dependFileNameFull, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE) + << this->Convert(dependFileNameFull, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE) << "\n\n"; if (!this->NoRuleMessages) { @@ -213,8 +213,8 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() << "# Include the progress variables for this target.\n" << this->GlobalGenerator->IncludeDirective << " " << root << this->Convert(this->ProgressFileNameFull, - cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE) + cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE) << "\n\n"; } @@ -244,8 +244,8 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() *this->BuildFileStream << "# Include the compile flags for this target's objects.\n" << this->GlobalGenerator->IncludeDirective << " " << root - << this->Convert(this->FlagFileNameFull, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE) + << this->Convert(this->FlagFileNameFull, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE) << "\n\n"; } @@ -301,8 +301,8 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()( output += "/"; output += cmSystemTools::GetFilenameName(input); this->Generator->CleanFiles.push_back( - this->Generator->Convert(output, cmLocalGenerator::START_OUTPUT)); - output = this->Generator->Convert(output, cmLocalGenerator::HOME_OUTPUT); + this->Generator->Convert(output, cmOutputConverter::START_OUTPUT)); + output = this->Generator->Convert(output, cmOutputConverter::HOME_OUTPUT); // Create a rule to copy the content into the bundle. std::vector<std::string> depends; @@ -313,11 +313,11 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()( this->Generator->LocalGenerator->AppendEcho( commands, copyEcho.c_str(), cmLocalUnixMakefileGenerator3::EchoBuild); std::string copyCommand = "$(CMAKE_COMMAND) -E copy "; - copyCommand += this->Generator->Convert(input, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL); + copyCommand += this->Generator->Convert(input, cmOutputConverter::NONE, + cmOutputConverter::SHELL); copyCommand += " "; - copyCommand += this->Generator->Convert(output, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL); + copyCommand += this->Generator->Convert(output, cmOutputConverter::NONE, + cmOutputConverter::SHELL); commands.push_back(copyCommand); this->Generator->LocalGenerator->WriteMakeRule( *this->Generator->BuildFileStream, 0, output, depends, commands, false); @@ -381,9 +381,9 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string objFullPath = this->LocalGenerator->GetCurrentBinaryDirectory(); objFullPath += "/"; objFullPath += obj; - objFullPath = this->Convert(objFullPath, cmLocalGenerator::FULL); + objFullPath = this->Convert(objFullPath, cmOutputConverter::FULL); std::string srcFullPath = - this->Convert(source.GetFullPath(), cmLocalGenerator::FULL); + this->Convert(source.GetFullPath(), cmOutputConverter::FULL); this->LocalGenerator->AddImplicitDepends( this->GeneratorTarget, lang, objFullPath.c_str(), srcFullPath.c_str()); } @@ -453,7 +453,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( // Get the output paths for source and object files. std::string sourceFile = this->Convert( - source.GetFullPath(), cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + source.GetFullPath(), cmOutputConverter::NONE, cmOutputConverter::SHELL); // Construct the build message. std::vector<std::string> no_commands; @@ -502,13 +502,13 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( } targetOutPathReal = - this->Convert(targetFullPathReal, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); - targetOutPathPDB = this->Convert(targetFullPathPDB, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL); + this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); + targetOutPathPDB = this->Convert( + targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); targetOutPathCompilePDB = - this->Convert(targetFullPathCompilePDB, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + this->Convert(targetFullPathCompilePDB, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); if (this->LocalGenerator->IsMinGWMake() && cmHasLiteralSuffix(targetOutPathCompilePDB, "\\")) { @@ -527,15 +527,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( vars.TargetCompilePDB = targetOutPathCompilePDB.c_str(); vars.Source = sourceFile.c_str(); std::string shellObj = - this->Convert(obj, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + this->Convert(obj, cmOutputConverter::NONE, cmOutputConverter::SHELL); vars.Object = shellObj.c_str(); std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); - objectDir = this->Convert(objectDir, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); vars.ObjectDir = objectDir.c_str(); std::string objectFileDir = cmSystemTools::GetFilenamePath(obj); - objectFileDir = this->Convert(objectFileDir, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + objectFileDir = this->Convert(objectFileDir, cmOutputConverter::START_OUTPUT, + cmOutputConverter::SHELL); vars.ObjectFileDir = objectFileDir.c_str(); vars.Flags = flags.c_str(); @@ -574,7 +574,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( this->LocalGenerator->ExpandRuleVariables(compileCommand, vars); std::string workingDirectory = this->LocalGenerator->Convert( this->LocalGenerator->GetCurrentBinaryDirectory(), - cmLocalGenerator::FULL); + cmOutputConverter::FULL); compileCommand.replace(compileCommand.find(langFlags), langFlags.size(), this->GetFlags(lang)); std::string langDefines = std::string("$(") + lang + "_DEFINES)"; @@ -637,7 +637,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( // Change the command working directory to the local build tree. this->LocalGenerator->CreateCDCommand( compileCommands, this->LocalGenerator->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), compileCommands.begin(), compileCommands.end()); } @@ -687,8 +687,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::vector<std::string> preprocessCommands; cmSystemTools::ExpandListArgument(preprocessRule, preprocessCommands); - std::string shellObjI = - this->Convert(objI, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + std::string shellObjI = this->Convert(objI, cmOutputConverter::NONE, + cmOutputConverter::SHELL); vars.PreprocessedSource = shellObjI.c_str(); // Expand placeholders in the commands. @@ -700,7 +700,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( this->LocalGenerator->CreateCDCommand( preprocessCommands, this->LocalGenerator->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), preprocessCommands.begin(), preprocessCommands.end()); } else { @@ -735,8 +735,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::vector<std::string> assemblyCommands; cmSystemTools::ExpandListArgument(assemblyRule, assemblyCommands); - std::string shellObjS = - this->Convert(objS, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + std::string shellObjS = this->Convert(objS, cmOutputConverter::NONE, + cmOutputConverter::SHELL); vars.AssemblySource = shellObjS.c_str(); // Expand placeholders in the commands. @@ -747,7 +747,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( this->LocalGenerator->CreateCDCommand( assemblyCommands, this->LocalGenerator->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); commands.insert(commands.end(), assemblyCommands.begin(), assemblyCommands.end()); } else { @@ -836,7 +836,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules() this->GeneratorTarget); this->LocalGenerator->CreateCDCommand( commands, this->LocalGenerator->GetCurrentBinaryDirectory(), - cmLocalGenerator::HOME_OUTPUT); + cmOutputConverter::HOME_OUTPUT); // Write the rule. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, cleanTarget, @@ -879,8 +879,8 @@ bool cmMakefileTargetGenerator::WriteMakeRule( o != outputs.end(); ++o) { // Touch the extra output so "make" knows that it was updated, // but only if the output was acually created. - std::string const out = this->Convert(*o, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::SHELL); + std::string const out = this->Convert(*o, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::SHELL); std::vector<std::string> output_commands; bool o_symbolic = false; @@ -988,7 +988,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // translation table for the dependency scanning process. depCmd << "cd " << (this->LocalGenerator->Convert( this->LocalGenerator->GetBinaryDirectory(), - cmLocalGenerator::FULL, cmLocalGenerator::SHELL)) + cmOutputConverter::FULL, cmOutputConverter::SHELL)) << " && "; #endif // Generate a call this signature: @@ -1003,19 +1003,19 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() depCmd << "$(CMAKE_COMMAND) -E cmake_depends \"" << this->GlobalGenerator->GetName() << "\" " << this->Convert(this->LocalGenerator->GetSourceDirectory(), - cmLocalGenerator::FULL, cmLocalGenerator::SHELL) + cmOutputConverter::FULL, cmOutputConverter::SHELL) << " " << this->Convert(this->LocalGenerator->GetCurrentSourceDirectory(), - cmLocalGenerator::FULL, cmLocalGenerator::SHELL) + cmOutputConverter::FULL, cmOutputConverter::SHELL) << " " << this->Convert(this->LocalGenerator->GetBinaryDirectory(), - cmLocalGenerator::FULL, cmLocalGenerator::SHELL) + cmOutputConverter::FULL, cmOutputConverter::SHELL) << " " << this->Convert(this->LocalGenerator->GetCurrentBinaryDirectory(), - cmLocalGenerator::FULL, cmLocalGenerator::SHELL) + cmOutputConverter::FULL, cmOutputConverter::SHELL) << " " - << this->Convert(this->InfoFileNameFull, cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); + << this->Convert(this->InfoFileNameFull, cmOutputConverter::FULL, + cmOutputConverter::SHELL); if (this->LocalGenerator->GetColorMakefile()) { depCmd << " --color=$(COLOR)"; } @@ -1081,8 +1081,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile( // Now append the actual user-specified commands. std::ostringstream content; this->LocalGenerator->AppendCustomCommand( - commands, ccg, this->GeneratorTarget, false, cmLocalGenerator::HOME_OUTPUT, - &content); + commands, ccg, this->GeneratorTarget, false, + cmOutputConverter::HOME_OUTPUT, &content); // Collect the dependencies. std::vector<std::string> depends; @@ -1103,9 +1103,9 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile( ccg.GetCC().GetImplicitDepends().begin(); idi != ccg.GetCC().GetImplicitDepends().end(); ++idi) { std::string objFullPath = - this->Convert(outputs[0], cmLocalGenerator::FULL); + this->Convert(outputs[0], cmOutputConverter::FULL); std::string srcFullPath = - this->Convert(idi->second, cmLocalGenerator::FULL); + this->Convert(idi->second, cmOutputConverter::FULL); this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, idi->first, objFullPath.c_str(), srcFullPath.c_str()); @@ -1161,7 +1161,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable( for (std::vector<std::string>::const_iterator i = this->ExternalObjects.begin(); i != this->ExternalObjects.end(); ++i) { - object = this->Convert(*i, cmLocalGenerator::START_OUTPUT); + object = this->Convert(*i, cmOutputConverter::START_OUTPUT); *this->BuildFileStream << " " << lineContinue << "\n" << this->Makefile->GetSafeDefinition( "CMAKE_OBJECT_NAME"); @@ -1195,7 +1195,7 @@ public: { // Construct the name of the next object. this->NextObject = this->LocalGenerator->Convert( - obj, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::RESPONSE); + obj, cmOutputConverter::START_OUTPUT, cmOutputConverter::RESPONSE); // Roll over to next string if the limit will be exceeded. if (this->LengthLimit != std::string::npos && @@ -1249,8 +1249,8 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule( std::string buildTargetRuleName = dir; buildTargetRuleName += relink ? "/preinstall" : "/build"; buildTargetRuleName = - this->Convert(buildTargetRuleName, cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::UNCHANGED); + this->Convert(buildTargetRuleName, cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::UNCHANGED); // Build the list of target outputs to drive. std::vector<std::string> depends; @@ -1438,8 +1438,8 @@ void cmMakefileTargetGenerator::CreateLinkScript( // Create the makefile command to invoke the link script. std::string link_command = "$(CMAKE_COMMAND) -E cmake_link_script "; - link_command += this->Convert(linkScriptName, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + link_command += this->Convert( + linkScriptName, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL); link_command += " --verbose=$(VERBOSE)"; makefile_commands.push_back(link_command); makefile_depends.push_back(linkScriptName); @@ -1496,8 +1496,8 @@ void cmMakefileTargetGenerator::CreateLinkLibs( // Reference the response file. linkLibs = responseFlag; - linkLibs += - this->Convert(link_rsp, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + linkLibs += this->Convert(link_rsp, cmOutputConverter::NONE, + cmOutputConverter::SHELL); } } @@ -1545,8 +1545,8 @@ void cmMakefileTargetGenerator::CreateObjectLists( // Reference the response file. buildObjs += responseFlag; - buildObjs += this->Convert(objects_rsp, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL); + buildObjs += this->Convert(objects_rsp, cmOutputConverter::NONE, + cmOutputConverter::SHELL); } } else if (useLinkScript) { if (!useArchiveRules) { diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 697f123..6e44e8f 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -48,8 +48,8 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles() << "# Include the progress variables for this target.\n" << this->GlobalGenerator->IncludeDirective << " " << root << this->Convert(this->ProgressFileNameFull, - cmLocalGenerator::HOME_OUTPUT, - cmLocalGenerator::MAKERULE) + cmOutputConverter::HOME_OUTPUT, + cmOutputConverter::MAKERULE) << "\n\n"; } diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 8d7a892..90022c0 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -255,7 +255,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) !this->GetGeneratorTarget()->IsFrameworkOnApple()) { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( - cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); + cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); if (targetType == cmState::EXECUTABLE) this->GetGlobalGenerator()->AddRule( "CMAKE_SYMLINK_EXECUTABLE", @@ -304,7 +304,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd() { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( - cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); + cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); linkCmds.push_back(cmakeCommand + " -E remove $TARGET_FILE"); } // TODO: Use ARCHIVE_APPEND for archives over a certain size. @@ -432,7 +432,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmLocalNinjaGenerator& localGen = *this->GetLocalGenerator(); vars["TARGET_FILE"] = - localGen.ConvertToOutputFormat(targetOutputReal, cmLocalGenerator::SHELL); + localGen.ConvertToOutputFormat(targetOutputReal, cmOutputConverter::SHELL); localGen.GetTargetFlags(vars["LINK_LIBRARIES"], vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, @@ -445,7 +445,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() name_of_def_file += ".def "; vars["LINK_FLAGS"] += " /DEF:"; vars["LINK_FLAGS"] += this->GetLocalGenerator()->ConvertToOutputFormat( - name_of_def_file.c_str(), cmLocalGenerator::SHELL); + name_of_def_file.c_str(), cmOutputConverter::SHELL); } } @@ -492,7 +492,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName); if (!install_dir.empty()) { vars["INSTALLNAME_DIR"] = localGen.Convert( - install_dir, cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + install_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL); } } } @@ -501,7 +501,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (!this->TargetNameImport.empty()) { const std::string impLibPath = localGen.ConvertToOutputFormat( - targetOutputImplib, cmLocalGenerator::SHELL); + targetOutputImplib, cmOutputConverter::SHELL); vars["TARGET_IMPLIB"] = impLibPath; EnsureParentDirectoryExists(impLibPath); if (genTarget.HasImportLibrary()) { @@ -526,7 +526,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() const std::string objPath = GetGeneratorTarget()->GetSupportDirectory(); vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( - this->ConvertToNinjaPath(objPath), cmLocalGenerator::SHELL); + this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL); EnsureDirectoryExists(objPath); if (this->GetGlobalGenerator()->IsGCCOnWindows()) { @@ -565,20 +565,20 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (gt.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( - cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); + cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); std::string name_of_def_file = gt.GetSupportDirectory(); name_of_def_file += "/" + gt.GetName(); name_of_def_file += ".def"; std::string cmd = cmakeCommand; cmd += " -E __create_def "; cmd += this->GetLocalGenerator()->ConvertToOutputFormat( - name_of_def_file.c_str(), cmLocalGenerator::SHELL); + name_of_def_file.c_str(), cmOutputConverter::SHELL); cmd += " "; cmNinjaDeps objs = this->GetObjects(); std::string obj_list_file = name_of_def_file; obj_list_file += ".objs"; cmd += this->GetLocalGenerator()->ConvertToOutputFormat( - obj_list_file.c_str(), cmLocalGenerator::SHELL); + obj_list_file.c_str(), cmOutputConverter::SHELL); preLinkCmdLines.push_back(cmd); // create a list of obj files for the -E __create_def to read cmGeneratedFileStream fout(obj_list_file.c_str()); @@ -593,7 +593,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // the link commands. if (!preLinkCmdLines.empty()) { const std::string homeOutDir = localGen.ConvertToOutputFormat( - localGen.GetBinaryDirectory(), cmLocalGenerator::SHELL); + localGen.GetBinaryDirectory(), cmOutputConverter::SHELL); preLinkCmdLines.push_back("cd " + homeOutDir); } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4d58242..86db8e0 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -274,10 +274,10 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const } vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( - ConvertToNinjaPath(pdbPath), cmLocalGenerator::SHELL); + ConvertToNinjaPath(pdbPath), cmOutputConverter::SHELL); vars["TARGET_COMPILE_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( - ConvertToNinjaPath(compilePdbPath), cmLocalGenerator::SHELL); + ConvertToNinjaPath(compilePdbPath), cmOutputConverter::SHELL); EnsureParentDirectoryExists(pdbPath); EnsureParentDirectoryExists(compilePdbPath); @@ -383,7 +383,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) const char* tidy = this->GeneratorTarget->GetProperty(tidy_prop); if ((iwyu && *iwyu) || (tidy && *tidy)) { std::string run_iwyu = this->GetLocalGenerator()->ConvertToOutputFormat( - cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); + cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); run_iwyu += " -E __run_iwyu"; if (iwyu && *iwyu) { run_iwyu += " --iwyu="; @@ -584,9 +584,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( EnsureParentDirectoryExists(objectFileName); vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( - objectDir, cmLocalGenerator::SHELL); + objectDir, cmOutputConverter::SHELL); vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( - objectFileDir, cmLocalGenerator::SHELL); + objectFileDir, cmOutputConverter::SHELL); this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(), vars); @@ -634,7 +634,7 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand( } escapedSourceFileName = this->LocalGenerator->ConvertToOutputFormat( - escapedSourceFileName, cmLocalGenerator::SHELL); + escapedSourceFileName, cmOutputConverter::SHELL); compileObjectVars.Source = escapedSourceFileName.c_str(); compileObjectVars.Object = objectFileName.c_str(); diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index d07341c..f7a7f38 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -111,14 +111,14 @@ void cmNinjaUtilityTargetGenerator::Generate() this->GetLocalGenerator() ->ConvertToOutputFormat( this->GetLocalGenerator()->GetSourceDirectory(), - cmLocalGenerator::SHELL) + cmOutputConverter::SHELL) .c_str()); cmSystemTools::ReplaceString( command, "$(CMAKE_BINARY_DIR)", this->GetLocalGenerator() ->ConvertToOutputFormat( this->GetLocalGenerator()->GetBinaryDirectory(), - cmLocalGenerator::SHELL) + cmOutputConverter::SHELL) .c_str()); cmSystemTools::ReplaceString(command, "$(ARGS)", ""); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 3d93e69..6121b28 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2404,8 +2404,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries( for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) { if (l->IsPath) { std::string path = this->LocalGenerator->Convert( - l->Value.c_str(), cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::UNCHANGED); + l->Value.c_str(), cmOutputConverter::START_OUTPUT, + cmOutputConverter::UNCHANGED); this->ConvertToWindowsSlash(path); libVec.push_back(path); } else if (!l->Target || diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt index 093b23f..9d4b5e9 100644 --- a/Tests/CPackComponentsDEB/CMakeLists.txt +++ b/Tests/CPackComponentsDEB/CMakeLists.txt @@ -130,6 +130,8 @@ configure_file(${CPackComponentsDEB_SOURCE_DIR}/MyLibCPackConfig-${CPackDEBConfi @ONLY) set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsDEB_BINARY_DIR}/MyLibCPackConfig-${CPackDEBConfiguration}.cmake) +# set CPACK_DEBIAN_FILE_NAME to use default package name format +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") # Include CPack to introduce the appropriate targets include(CPack) diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in index d207bcc..dc038fa 100644 --- a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in +++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in @@ -4,6 +4,7 @@ if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") + set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS "ON") endif() # diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in index 803720a..1aa7d01 100644 --- a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in +++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in @@ -4,6 +4,7 @@ if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") + set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS "ON") endif() # diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index 05c13a4..3440843 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -165,6 +165,9 @@ set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}" "${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}" "other_relocatable" "${CMAKE_INSTALL_LIBDIR}/inside_relocatable_two/depth_two/different_relocatable") +# set CPACK_DEBIAN_FILE_NAME to use default package name format +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + # We may use the CPack specific config file in order # to tailor CPack behavior on a CPack generator specific way # (Behavior would be different for RPM or TGZ or DEB ...) diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt index 9ee1957..523c4f7 100644 --- a/Tests/IncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/CMakeLists.txt @@ -63,6 +63,7 @@ else() PROPERTIES COMPILE_FLAGS "-ITarProp") endif() +add_subdirectory(StandardIncludeDirectories) add_subdirectory(TargetIncludeDirectories) set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}") diff --git a/Tests/IncludeDirectories/StandardIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/StandardIncludeDirectories/CMakeLists.txt new file mode 100644 index 0000000..dcbc566 --- /dev/null +++ b/Tests/IncludeDirectories/StandardIncludeDirectories/CMakeLists.txt @@ -0,0 +1,5 @@ +# Normally this variable should be set by a platform information module or +# a toolchain file, but for purposes of this test we simply set it here. +set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/StdDir) + +add_executable(StandardIncludeDirectories main.c) diff --git a/Tests/IncludeDirectories/StandardIncludeDirectories/StdDir/StdIncDir.h b/Tests/IncludeDirectories/StandardIncludeDirectories/StdDir/StdIncDir.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/IncludeDirectories/StandardIncludeDirectories/StdDir/StdIncDir.h diff --git a/Tests/IncludeDirectories/StandardIncludeDirectories/main.c b/Tests/IncludeDirectories/StandardIncludeDirectories/main.c new file mode 100644 index 0000000..edfe9ce --- /dev/null +++ b/Tests/IncludeDirectories/StandardIncludeDirectories/main.c @@ -0,0 +1,5 @@ +#include "StdIncDir.h" +int main() +{ + return 0; +} diff --git a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake index ba53a87..c89df89 100644 --- a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake +++ b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake @@ -1,9 +1,5 @@ set(CPACK_RPM_COMPONENT_INSTALL "ON") -set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") -set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") -set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm") - install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2) install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3) diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake index 2720fe9..4b4ac8d 100644 --- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake +++ b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake @@ -1,2 +1,3 @@ set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake new file mode 100644 index 0000000..2acf45b --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake @@ -0,0 +1,9 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "3") +set(EXPECTED_FILE_1 "custom_names-pkg_1_0.1.1-1_*.deb") +set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_2 "second*.deb") +set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") +set(EXPECTED_FILE_3 "pkg_3_abc.deb") +set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake new file mode 100644 index 0000000..c64f161 --- /dev/null +++ b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake @@ -0,0 +1,6 @@ +set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEB_COMPONENT_INSTALL "ON") + +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") +set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb") diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake index c182e30..a6f08fe 100644 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake @@ -1,14 +1,14 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") -set(EXPECTED_FILE_1 "dependencies-applications_0.1.1-1_*.deb") +set(EXPECTED_FILE_1 "dependencies-0.1.1-*-applications.deb") set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$") -set(EXPECTED_FILE_2 "dependencies-applications_auto_0.1.1-1_*.deb") +set(EXPECTED_FILE_2 "dependencies-0.1.1-*-applications_auto.deb") set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$") -set(EXPECTED_FILE_3 "dependencies-headers_0.1.1-1_*.deb") +set(EXPECTED_FILE_3 "dependencies-0.1.1-*-headers.deb") set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$") -set(EXPECTED_FILE_4 "dependencies-libs_0.1.1-1_*.deb") +set(EXPECTED_FILE_4 "dependencies-0.1.1-*-libs.deb") # dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it set(EXPECTED_FILE_CONTENT_4 "^.*/usr/bas${whitespaces_}.*/usr/bas/libtest_lib\\..*$") -set(EXPECTED_FILE_5 "dependencies-libs_auto_0.1.1-1_*.deb") +set(EXPECTED_FILE_5 "dependencies-0.1.1-*-libs_auto.deb") set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$") diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake index 96a9f14..5f82cc6 100644 --- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake +++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake @@ -1,5 +1,7 @@ set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEB_COMPONENT_INSTALL "ON") +#intentionaly commented out to test old file naming +#set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") # false by default set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE) diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake index 8821ab9..4e9a2e7 100644 --- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake +++ b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake @@ -1 +1,2 @@ set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake index 8821ab9..4e9a2e7 100644 --- a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake +++ b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake @@ -1 +1,2 @@ set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake index a1da1a3..25bd2e7 100644 --- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake +++ b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake @@ -1,5 +1,6 @@ set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_SECTION "default") set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second") diff --git a/Tests/RunCMake/CPack/DEB_EXTRA.cmake b/Tests/RunCMake/CPack/DEB_EXTRA.cmake index 3c291d5..189d123 100644 --- a/Tests/RunCMake/CPack/DEB_EXTRA.cmake +++ b/Tests/RunCMake/CPack/DEB_EXTRA.cmake @@ -34,5 +34,6 @@ set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA set(CPACK_PACKAGE_NAME "deb_extra") set(CPACK_PACKAGE_CONTACT "someone") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEB_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake index efb0211..1aeb06f 100644 --- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake +++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake @@ -1,5 +1,6 @@ set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake index 1f70386..f58c876 100644 --- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake +++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake @@ -1,5 +1,6 @@ set(CPACK_PACKAGE_CONTACT "someone") set(CPACK_DEB_COMPONENT_INSTALL "ON") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake index 780e57e..780e57e 100644 --- a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake new file mode 100644 index 0000000..575aa01 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake @@ -0,0 +1,5 @@ +set(CPACK_RPM_COMPONENT_INSTALL "ON") + +set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_PKG_2_PACKAGE_NAME "second") +set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm") diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt new file mode 100644 index 0000000..9bfba7e --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt @@ -0,0 +1,3 @@ +^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec +CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec +CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$ diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt deleted file mode 100644 index d3ba7b0..0000000 --- a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec -CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$ diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 759295f..59c52f8 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -10,7 +10,7 @@ run_cpack_test(DEB_EXTRA "DEB" false) run_cpack_test(DEPENDENCIES "RPM;DEB" true) run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true) run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true) -run_cpack_test(RPM_CUSTOM_NAMES "RPM" true) +run_cpack_test(CUSTOM_NAMES "RPM;DEB" true) run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false) run_cpack_test(RPM_DIST "RPM" false) run_cpack_test(INSTALL_SCRIPTS "RPM" false) |