diff options
97 files changed, 406 insertions, 323 deletions
diff --git a/Auxiliary/cmake-indent.vim b/Auxiliary/cmake-indent.vim index 6cee9c8..fa088e4 100644 --- a/Auxiliary/cmake-indent.vim +++ b/Auxiliary/cmake-indent.vim @@ -16,7 +16,7 @@ " Version: $Revision$ " " Licence: The CMake license applies to this file. See -" http://www.cmake.org/licensing +" https://cmake.org/licensing " This implies that distribution with Vim is allowed if exists("b:did_indent") diff --git a/Auxiliary/cmake-syntax.vim b/Auxiliary/cmake-syntax.vim index 3e4a122..624a8c4 100644 --- a/Auxiliary/cmake-syntax.vim +++ b/Auxiliary/cmake-syntax.vim @@ -16,7 +16,7 @@ " Version: $Revision$ " " Licence: The CMake license applies to this file. See -" http://www.cmake.org/licensing +" https://cmake.org/licensing " This implies that distribution with Vim is allowed " For version 5.x: Clear all syntax items diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index a1e425a..b6013ef 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -14,14 +14,14 @@ if(CPACK_GENERATOR MATCHES "NSIS") # tell cpack to create links to the doc files set(CPACK_NSIS_MENU_LINKS "@CMAKE_DOC_DIR@/html/index.html" "CMake Documentation" - "http://www.cmake.org" "CMake Web Site" + "https://cmake.org" "CMake Web Site" ) # Use the icon from cmake-gui for add-remove programs set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe") set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@") set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system") - set(CPACK_NSIS_HELP_LINK "http://www.cmake.org") + set(CPACK_NSIS_HELP_LINK "https://cmake.org") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com") set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) set(CPACK_NSIS_MODIFY_PATH ON) @@ -35,7 +35,7 @@ if(CPACK_GENERATOR MATCHES "IFW") # Installer configuration set(CPACK_IFW_PACKAGE_TITLE "CMake Build Tool") - set(CPACK_IFW_PRODUCT_URL "http://www.cmake.org") + set(CPACK_IFW_PRODUCT_URL "https://cmake.org") @_CPACK_IFW_PACKAGE_ICON@ set(CPACK_IFW_PACKAGE_WINDOW_ICON "@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup128.png") @@ -204,7 +204,7 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${patch}") endif() - set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.cmake.org") + set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://cmake.org") set(CPACK_WIX_PROPERTY_ARPCONTACT "@CPACK_PACKAGE_CONTACT@") diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d138c..c96f68b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) if(POLICY CMP0025) cmake_policy(SET CMP0025 NEW) endif() +if(POLICY CMP0053) + cmake_policy(SET CMP0053 NEW) +endif() project(CMake) if(CMAKE_BOOTSTRAP) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5daaf9c..0e5c7e1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -14,7 +14,7 @@ Please subscribe and post to the `CMake Developers List`_ to offer contributions. Regular and productive contributors may be invited to gain direct push access. -.. _`CMake Developers List`: http://www.cmake.org/mailman/listinfo/cmake-developers +.. _`CMake Developers List`: https://cmake.org/mailman/listinfo/cmake-developers Patches ======= diff --git a/Help/manual/LINKS.txt b/Help/manual/LINKS.txt index 38fd151..3993ff8 100644 --- a/Help/manual/LINKS.txt +++ b/Help/manual/LINKS.txt @@ -1,25 +1,25 @@ The following resources are available to get help using CMake: Home Page - http://www.cmake.org + https://cmake.org The primary starting point for learning about CMake. Frequently Asked Questions - http://www.cmake.org/Wiki/CMake_FAQ + https://cmake.org/Wiki/CMake_FAQ A Wiki is provided containing answers to frequently asked questions. Online Documentation - http://www.cmake.org/documentation + https://cmake.org/documentation Links to available documentation may be found on this web page. Mailing List - http://www.cmake.org/mailing-lists + https://cmake.org/mailing-lists For help and discussion about using cmake, a mailing list is provided at cmake@cmake.org. The list is member-post-only but one may sign up on the CMake web page. Please first read the full - documentation at http://www.cmake.org before posting questions to + documentation at https://cmake.org before posting questions to the list. diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 189c3ef..13ee4bd 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -278,3 +278,7 @@ Available output expressions are: object of type ``OBJECT_LIBRARY``. This expression may only be used in the sources of :command:`add_library` and :command:`add_executable` commands. +``$<SHELL_PATH:...>`` + Content of ``...`` converted to shell path style. For example, slashes are + converted to backslashes in Windows shells and drive letters are converted + to posix paths in MSYS shells. The ``...`` must be an absolute path. diff --git a/Help/release/dev/genex-SHELL_PATH.rst b/Help/release/dev/genex-SHELL_PATH.rst new file mode 100644 index 0000000..86af720 --- /dev/null +++ b/Help/release/dev/genex-SHELL_PATH.rst @@ -0,0 +1,6 @@ +genex-SHELL_PATH +---------------- + +* A new ``$<SHELL_PATH:...>`` + :manual:`generator expression <cmake-generator-expressions(7)>` + has been added. diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 4b0d278..e0b5468 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -101,7 +101,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN) CMAKE_C_COMPILER_ID_PLATFORM_CONTENT) # The IAR compiler produces weird output. - # See http://www.cmake.org/Bug/view.php?id=10176#c19598 + # See https://cmake.org/Bug/view.php?id=10176#c19598 list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR) set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR ) set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 680356d..3c9bbc2 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -96,7 +96,7 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN) CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT) # The IAR compiler produces weird output. - # See http://www.cmake.org/Bug/view.php?id=10176#c19598 + # See https://cmake.org/Bug/view.php?id=10176#c19598 list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR) set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR ) set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index 573e5aa..96d5609 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -263,7 +263,7 @@ # # The site argument is a URL where the archives for downloadable # components will reside, e.g., -# http://www.cmake.org/files/2.6.1/installer/ All of the archives +# https://cmake.org/files/2.6.1/installer/ All of the archives # produced by CPack should be uploaded to that location. # # UPLOAD_DIRECTORY is the local directory where CPack will create the @@ -301,7 +301,7 @@ if(NOT CPackComponent_CMake_INCLUDED) set(CPackComponent_CMake_INCLUDED 1) -# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments +# Argument-parsing macro from https://cmake.org/Wiki/CMakeMacroParseArguments macro(cpack_parse_arguments prefix arg_names option_names) set(${prefix}_DEFAULT_ARGS) foreach(arg_name ${arg_names}) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 93d51c3..60e0d1f 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -9,7 +9,7 @@ # # CPackDeb may be used to create Deb package using CPack. # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables -# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. +# used by CPack : https://cmake.org/Wiki/CMake:CPackConfiguration. # CPackDeb generator should work on any linux host but it will produce # better deb package when Debian specific tools 'dpkg-xxx' are usable on # the build system. @@ -23,7 +23,7 @@ # a component GROUP name. # # You'll find a detailed usage on the wiki: -# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 . +# https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 . # However as a handy reminder here comes the list of specific variables: # # .. variable:: CPACK_DEBIAN_PACKAGE_NAME @@ -153,7 +153,7 @@ # You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value # if you use this feature, because if you don't :code:`dpkg-shlibdeps` # may fail to find your own shared libs. -# See http://www.cmake.org/Wiki/CMake_RPATH_handling. +# See https://cmake.org/Wiki/CMake_RPATH_handling. # # # .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake index 4b2e0eb..c6b3d19 100644 --- a/Modules/CPackNSIS.cmake +++ b/Modules/CPackNSIS.cmake @@ -115,7 +115,7 @@ # # set(CPACK_NSIS_MENU_LINKS # "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" -# "CMake Help" "http://www.cmake.org" "CMake Web Site") +# "CMake Help" "https://cmake.org" "CMake Web Site") # #============================================================================= diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 7c1db14..1e7b055 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -9,7 +9,7 @@ # # CPackRPM may be used to create RPM package using CPack. CPackRPM is a # CPack generator thus it uses the CPACK_XXX variables used by CPack : -# http://www.cmake.org/Wiki/CMake:CPackConfiguration +# https://cmake.org/Wiki/CMake:CPackConfiguration # # However CPackRPM has specific features which are controlled by the # specifics CPACK_RPM_XXX variables. CPackRPM is a component aware @@ -24,7 +24,7 @@ # # :: # -# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 +# https://cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 # # However as a handy reminder here comes the list of specific variables: # diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake index 00e4713..8c6c3f6 100644 --- a/Modules/Compiler/IAR.cmake +++ b/Modules/Compiler/IAR.cmake @@ -1,6 +1,6 @@ # This file is processed when the IAR compiler is used for a C or C++ file # Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/ -# The initial feature request is here: http://www.cmake.org/Bug/view.php?id=10176 +# The initial feature request is here: https://cmake.org/Bug/view.php?id=10176 # It also contains additional links and information. if(_IAR_CMAKE_LOADED) @@ -39,7 +39,7 @@ endif() if(NOT IAR_TARGET_ARCHITECTURE) message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported " - " by CMake. Please go to http://www.cmake.org/Bug and enter a feature request there.") + " by CMake. Please go to https://cmake.org/Bug and enter a feature request there.") endif() set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 37bca83..9f6e666 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -307,7 +307,7 @@ if( NOT HDF5_FOUND ) if( UNIX AND HDF5_USE_STATIC_LIBRARIES ) # According to bug 1643 on the CMake bug tracker, this is the # preferred method for searching for a static library. - # See http://www.cmake.org/Bug/view.php?id=1643. We search + # See https://cmake.org/Bug/view.php?id=1643. We search # first for the full static library name, but fall back to a # generic search on the name if the static search fails. set( THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a ${LIB}d ) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 54a74f6..9037594 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -193,8 +193,8 @@ set(wxWidgets_CXX_FLAGS "") # to prevent UsewxWidgets.cmake from using SYSTEM. # # See cmake mailing list discussions for more info: -# http://www.cmake.org/pipermail/cmake/2008-April/021115.html -# http://www.cmake.org/pipermail/cmake/2008-April/021146.html +# https://cmake.org/pipermail/cmake/2008-April/021115.html +# https://cmake.org/pipermail/cmake/2008-April/021146.html # if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake index 8f21adf..2c5d5ae 100644 --- a/Modules/ProcessorCount.cmake +++ b/Modules/ProcessorCount.cmake @@ -171,17 +171,30 @@ function(ProcessorCount var) endif() if(NOT count) - # Sun (systems where uname -X emits "NumCPU" in its output): - find_program(ProcessorCount_cmd_uname uname) - mark_as_advanced(ProcessorCount_cmd_uname) - if(ProcessorCount_cmd_uname) - execute_process(COMMAND ${ProcessorCount_cmd_uname} -X + # Sun (systems where psrinfo tool is available) + find_program(ProcessorCount_cmd_psrinfo psrinfo PATHS /usr/sbin /sbin) + mark_as_advanced(ProcessorCount_cmd_psrinfo) + if (ProcessorCount_cmd_psrinfo) + execute_process(COMMAND ${ProcessorCount_cmd_psrinfo} -p -v ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE uname_X_output) - string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}") + OUTPUT_VARIABLE psrinfo_output) + string(REGEX MATCH "([0-9]+) virtual processor" procs "${psrinfo_output}") set(count "${CMAKE_MATCH_1}") - #message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'") + #message("ProcessorCount: trying psrinfo -p -v '${ProcessorCount_cmd_prvinfo}'") + else() + # Sun (systems where uname -X emits "NumCPU" in its output): + find_program(ProcessorCount_cmd_uname uname) + mark_as_advanced(ProcessorCount_cmd_uname) + if(ProcessorCount_cmd_uname) + execute_process(COMMAND ${ProcessorCount_cmd_uname} -X + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE uname_X_output) + string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}") + set(count "${CMAKE_MATCH_1}") + #message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'") + endif() endif() endif() diff --git a/Modules/readme.txt b/Modules/readme.txt index b40f3d0..1e0c13b 100644 --- a/Modules/readme.txt +++ b/Modules/readme.txt @@ -1,4 +1,4 @@ See the "Find Modules" section of the cmake-developer(7) manual page. For more information about how to contribute modules to CMake, see this page: -http://www.cmake.org/Wiki/CMake:Module_Maintainers +https://cmake.org/Wiki/CMake:Module_Maintainers @@ -8,8 +8,8 @@ CMake is a cross-platform, open-source build system generator. For full documentation visit the `CMake Home Page`_ and the `CMake Documentation Page`_. -.. _`CMake Home Page`: http://www.cmake.org -.. _`CMake Documentation Page`: http://www.cmake.org/cmake/help/documentation.html +.. _`CMake Home Page`: https://cmake.org +.. _`CMake Documentation Page`: https://cmake.org/cmake/help/documentation.html CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. @@ -37,7 +37,7 @@ it should not be a major problem to port CMake to this platform. Subscribe and post to the `CMake Users List`_ to ask if others have had experience with the platform. -.. _`CMake Users List`: http://www.cmake.org/mailman/listinfo/cmake +.. _`CMake Users List`: https://cmake.org/mailman/listinfo/cmake Building CMake from Scratch --------------------------- @@ -63,7 +63,7 @@ You need to download and install a binary release of CMake in order to build CMake. You can get these releases from the `CMake Download Page`_ . Then proceed with the instructions below. -.. _`CMake Download Page`: http://www.cmake.org/cmake/resources/software.html +.. _`CMake Download Page`: https://cmake.org/cmake/resources/software.html Building CMake with CMake ------------------------- @@ -73,7 +73,7 @@ run the installed CMake on the sources of this CMake with your preferred options and generators. Then build it and install it. For instructions how to do this, see documentation on `Running CMake`_. -.. _`Running CMake`: http://www.cmake.org/cmake/help/runningcmake.html +.. _`Running CMake`: https://cmake.org/cmake/help/runningcmake.html Reporting Bugs ============== @@ -89,7 +89,7 @@ If you have found a bug: 3. Finally, if the issue is not resolved by the above steps, open an entry in the `CMake Issue Tracker`_. -.. _`CMake Issue Tracker`: http://www.cmake.org/Bug +.. _`CMake Issue Tracker`: https://cmake.org/Bug Contributing ============ diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b042c4a..eb53118 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 3) -set(CMake_VERSION_PATCH 20150925) +set(CMake_VERSION_PATCH 20150929) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 58bd947..70de757 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -78,7 +78,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive, std::string rp = filePrefix + *fileIt; cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: " << rp << std::endl); - archive.Add(rp); + archive.Add(rp, 0, 0, false); if (!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " @@ -284,7 +284,7 @@ int cmCPackArchiveGenerator::PackageFiles() // Get the relative path to the file std::string rp = cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str()); - archive.Add(rp); + archive.Add(rp, 0, 0, false); if(!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< " diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 04b1976..def9fc7 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -380,7 +380,11 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( for ( gfit = files.begin(); gfit != files.end(); ++ gfit ) { bool skip = false; - std::string &inFile = *gfit; + std::string inFile = *gfit; + if(cmSystemTools::FileIsDirectory(*gfit)) + { + inFile += '/'; + } for ( regIt= ignoreFilesRegex.begin(); regIt!= ignoreFilesRegex.end(); ++ regIt) diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 8f8038f..47455f8 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -23,7 +23,6 @@ public: cmExecutionStatus &status); virtual std::string GetName() const {return "build_name";} virtual bool IsScriptable() const { return true; } - virtual bool IsDiscouraged() const { return true; } }; diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 0548c6b..59bc396 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -102,15 +102,6 @@ public: } /** - * This determines if usage of the method is discouraged or not. - * This is currently only used for generating the documentation. - */ - virtual bool IsDiscouraged() const - { - return false; - } - - /** * This is used to avoid including this command * in documentation. This is mainly used by * cmMacroHelperCommand and cmFunctionHelperCommand diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 23d10f9..adefdf9 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -50,12 +50,6 @@ public: */ virtual bool IsScriptable() const { return true; } - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmExecProgramCommand, cmCommand); private: static bool RunCommand(const char* command, std::string& output, diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h index 2ea4e79..81aa21a 100644 --- a/Source/cmExportLibraryDependenciesCommand.h +++ b/Source/cmExportLibraryDependenciesCommand.h @@ -22,7 +22,6 @@ public: virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); virtual std::string GetName() const { return "export_library_dependencies";} - virtual bool IsDiscouraged() const { return true; } virtual void FinalPass(); virtual bool HasFinalPass() const { return true; } diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 31b6766..1c350ab 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -13,6 +13,7 @@ #include "cmGeneratorExpressionNode.h" #include "cmGlobalGenerator.h" #include "cmAlgorithms.h" +#include "cmOutputConverter.h" //---------------------------------------------------------------------------- std::string cmGeneratorExpressionNode::EvaluateDependentExpression( @@ -1792,6 +1793,27 @@ static const TargetFilesystemArtifactNodeGroup<ArtifactPdbTag> targetPdbNodeGroup; //---------------------------------------------------------------------------- +static const struct ShellPathNode : public cmGeneratorExpressionNode +{ + ShellPathNode() {} + + std::string Evaluate(const std::vector<std::string> ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *content, + cmGeneratorExpressionDAGChecker *) const + { + if (!cmSystemTools::FileIsFullPath(parameters.front())) + { + reportError(context, content->GetOriginalExpression(), + "\"" + parameters.front() + "\" is not an absolute path."); + return std::string(); + } + cmOutputConverter converter(context->Makefile->GetStateSnapshot()); + return converter.ConvertDirectorySeparatorsForShell(parameters.front()); + } +} shellPathNode; + +//---------------------------------------------------------------------------- const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(const std::string &identifier) { @@ -1846,6 +1868,7 @@ cmGeneratorExpressionNode::GetNode(const std::string &identifier) nodeMap["JOIN"] = &joinNode; nodeMap["LINK_ONLY"] = &linkOnlyNode; nodeMap["COMPILE_LANGUAGE"] = &languageNode; + nodeMap["SHELL_PATH"] = &shellPathNode; } NodeMap::const_iterator i = nodeMap.find(identifier); if (i == nodeMap.end()) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 47c50a0..ba74c9e 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -123,7 +123,7 @@ public: /** * Try to determine system information, get it from another generator */ - virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen, + void EnableLanguagesFromGenerator(cmGlobalGenerator *gen, cmMakefile* mf); /** diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 120bb03..9d8193b 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -818,6 +818,17 @@ void cmGlobalNinjaGenerator::CloseRulesFileStream() } } +std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) +{ + cmLocalNinjaGenerator *ng = + static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]); + std::string convPath = ng->Convert(path, cmOutputConverter::HOME_OUTPUT); +#ifdef _WIN32 + cmSystemTools::ReplaceString(convPath, "/", "\\"); +#endif + return convPath; +} + void cmGlobalNinjaGenerator::AddCXXCompileCommand( const std::string &commandLine, const std::string &sourceFile) @@ -907,8 +918,6 @@ cmGlobalNinjaGenerator { std::string configName = target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); - cmLocalNinjaGenerator *ng = - static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]); // for frameworks, we want the real name, not smple name // frameworks always appear versioned, and the build.ninja @@ -923,13 +932,13 @@ cmGlobalNinjaGenerator case cmTarget::MODULE_LIBRARY: { cmGeneratorTarget *gtgt = this->GetGeneratorTarget(target); - outputs.push_back(ng->ConvertToNinjaPath( + outputs.push_back(this->ConvertToNinjaPath( gtgt->GetFullPath(configName, false, realname))); break; } case cmTarget::OBJECT_LIBRARY: case cmTarget::UTILITY: { - std::string path = ng->ConvertToNinjaPath( + std::string path = this->ConvertToNinjaPath( target->GetMakefile()->GetCurrentBinaryDirectory()); if (path.empty() || path == ".") outputs.push_back(target->GetName()); @@ -1041,8 +1050,6 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) //get the list of files that cmake itself has generated as a //product of configuration. - cmLocalNinjaGenerator *ng = - static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]); for (std::vector<cmLocalGenerator *>::const_iterator i = this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) @@ -1054,7 +1061,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) typedef std::vector<std::string>::const_iterator vect_it; for(vect_it j = files.begin(); j != files.end(); ++j) { - knownDependencies.insert( ng->ConvertToNinjaPath( *j ) ); + knownDependencies.insert( this->ConvertToNinjaPath( *j ) ); } //get list files which are implicit dependencies as well and will be phony //for rebuild manifest @@ -1062,7 +1069,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) typedef std::vector<std::string>::const_iterator vect_it; for(vect_it j = lf.begin(); j != lf.end(); ++j) { - knownDependencies.insert( ng->ConvertToNinjaPath( *j ) ); + knownDependencies.insert( this->ConvertToNinjaPath( *j ) ); } std::vector<cmGeneratorExpressionEvaluationFile*> const& ef = (*i)->GetMakefile()->GetEvaluationFiles(); @@ -1074,7 +1081,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) std::vector<std::string> evaluationFiles = (*li)->GetFiles(); for(vect_it j = evaluationFiles.begin(); j != evaluationFiles.end(); ++j) { - knownDependencies.insert( ng->ConvertToNinjaPath( *j ) ); + knownDependencies.insert( this->ConvertToNinjaPath( *j ) ); } } } @@ -1084,7 +1091,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) i != this->TargetAliases.end(); ++i) { - knownDependencies.insert( ng->ConvertToNinjaPath(i->first) ); + knownDependencies.insert( this->ConvertToNinjaPath(i->first) ); } //remove all source files we know will exist. @@ -1093,7 +1100,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) i != this->AssumedSourceDependencies.end(); ++i) { - knownDependencies.insert( ng->ConvertToNinjaPath(i->first) ); + knownDependencies.insert( this->ConvertToNinjaPath(i->first) ); } //now we difference with CombinedCustomCommandExplicitDependencies to find @@ -1214,8 +1221,6 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) /*restat=*/ "", /*generator=*/ true); - cmLocalNinjaGenerator *ng = static_cast<cmLocalNinjaGenerator *>(lg); - cmNinjaDeps implicitDeps; for(std::vector<cmLocalGenerator*>::const_iterator i = this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) @@ -1224,7 +1229,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) for(std::vector<std::string>::const_iterator fi = lf.begin(); fi != lf.end(); ++fi) { - implicitDeps.push_back(ng->ConvertToNinjaPath(*fi)); + implicitDeps.push_back(this->ConvertToNinjaPath(*fi)); } } implicitDeps.push_back("CMakeCache.txt"); diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index d204a50..292f7c7 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -220,6 +220,19 @@ public: cmGeneratedFileStream* GetRulesFileStream() const { return this->RulesFileStream; } + std::string ConvertToNinjaPath(const std::string& path); + + struct MapToNinjaPathImpl { + cmGlobalNinjaGenerator* GG; + MapToNinjaPathImpl(cmGlobalNinjaGenerator* gg): GG(gg) {} + std::string operator()(std::string const& path) { + return this->GG->ConvertToNinjaPath(path); + } + }; + MapToNinjaPathImpl MapToNinjaPath() { + return MapToNinjaPathImpl(this); + } + void AddCXXCompileCommand(const std::string &commandLine, const std::string &sourceFile); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index e7cc8ff..7552d67 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -192,7 +192,7 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros() cmMakefile* mf = this->LocalGenerators[0]->GetMakefile(); std::string dir = this->GetUserMacrosDirectory(); - if (mf != 0 && dir != "") + if (dir != "") { std::string src = mf->GetRequiredDefinition("CMAKE_ROOT"); src += "/Templates/" CMAKE_VSMACROS_FILENAME; @@ -233,13 +233,12 @@ cmGlobalVisualStudioGenerator std::string dir = this->GetUserMacrosDirectory(); // Only really try to call the macro if: - // - mf is non-NULL // - there is a UserMacrosDirectory // - the CMake vsmacros file exists // - the CMake vsmacros file is registered // - there were .sln/.vcproj files changed during generation // - if (mf != 0 && dir != "") + if (dir != "") { std::string macrosFile = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME; std::string nextSubkeyName; diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index 4551ab1..8062d11 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -52,12 +52,6 @@ public: virtual void FinalPass(); virtual bool HasFinalPass() const { return !this->IsFilesForm; } - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmInstallFilesCommand, cmCommand); protected: diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 90c7ba3..524debf 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -53,12 +53,6 @@ public: virtual bool HasFinalPass() const { return true; } - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmInstallProgramsCommand, cmCommand); protected: diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index e6cbe6e..05160eb 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -44,12 +44,6 @@ public: */ virtual std::string GetName() const { return "install_targets";} - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmInstallTargetsCommand, cmCommand); }; diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index c572439..1ddefc4 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -44,12 +44,6 @@ public: */ virtual std::string GetName() const { return "link_libraries";} - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmLinkLibrariesCommand, cmCommand); }; diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index 4581269..445e167 100644 --- a/Source/cmLoadCommandCommand.h +++ b/Source/cmLoadCommandCommand.h @@ -21,7 +21,6 @@ public: virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); virtual std::string GetName() const {return "load_command";} - virtual bool IsDiscouraged() const { return true; } cmTypeMacro(cmLoadCommandCommand, cmCommand); }; diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 7525bf2..c46adc1 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -284,15 +284,6 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os) os << std::endl; } -std::string cmLocalNinjaGenerator::ConvertToNinjaPath(const std::string& path) -{ - std::string convPath = this->Convert(path, cmLocalGenerator::HOME_OUTPUT); -#ifdef _WIN32 - cmSystemTools::ReplaceString(convPath, "/", "\\"); -#endif - return convPath; -} - void cmLocalNinjaGenerator ::AppendTargetOutputs(cmTarget* target, cmNinjaDeps& outputs) @@ -316,7 +307,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandDeps( i != deps.end(); ++i) { std::string dep; if (this->GetRealDependency(*i, this->GetConfigName(), dep)) - ninjaDeps.push_back(ConvertToNinjaPath(dep)); + ninjaDeps.push_back( + this->GetGlobalNinjaGenerator()->ConvertToNinjaPath(dep)); } } @@ -413,9 +405,11 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( at us. How to know which ExternalProject step actually provides it? #endif std::transform(outputs.begin(), outputs.end(), - ninjaOutputs.begin(), MapToNinjaPath()); + ninjaOutputs.begin(), + this->GetGlobalNinjaGenerator()->MapToNinjaPath()); std::transform(byproducts.begin(), byproducts.end(), - ninjaOutputs.begin() + outputs.size(), MapToNinjaPath()); + ninjaOutputs.begin() + outputs.size(), + this->GetGlobalNinjaGenerator()->MapToNinjaPath()); this->AppendCustomCommandDeps(ccg, ninjaDeps); for (cmNinjaDeps::iterator i = ninjaOutputs.begin(); i != ninjaOutputs.end(); diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 8d3d49c..1645a8d 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -50,21 +50,6 @@ public: std::string GetHomeRelativeOutputPath() const { return this->HomeRelativeOutputPath; } - std::string ConvertToNinjaPath(const std::string& path); - - struct map_to_ninja_path { - cmLocalNinjaGenerator *LocalGenerator; - map_to_ninja_path(cmLocalNinjaGenerator *LocalGen) - : LocalGenerator(LocalGen) {} - std::string operator()(const std::string &path) { - return LocalGenerator->ConvertToNinjaPath(path); - } - }; - - map_to_ninja_path MapToNinjaPath() { - return map_to_ninja_path(this); - } - void ExpandRuleVariables(std::string& string, const RuleVariables& replaceValues) { cmLocalGenerator::ExpandRuleVariables(string, replaceValues); diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index 71b97eb..617f1fe 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -51,12 +51,6 @@ public: */ virtual bool IsScriptable() const { return true; } - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmMakeDirectoryCommand, cmCommand); }; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6480667..c70756a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -54,7 +54,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused(); this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); - this->Configured = false; this->SuppressWatches = false; // Setup the default include file regular expression (match everything). @@ -1658,7 +1657,6 @@ void cmMakefile::Configure() cmParseFileScope pfs(this); if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this)) { - this->SetConfigured(); return; } } @@ -1679,7 +1677,6 @@ void cmMakefile::Configure() } this->AddCMakeDependFilesFromUser(); - this->SetConfigured(); } void cmMakefile::ConfigureSubDirectory(cmMakefile *mf) @@ -1723,7 +1720,6 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile *mf) // NEW behavior prints the error. this->IssueMessage(cmake::FATAL_ERROR, e.str()); } - mf->SetConfigured(); return; } // finally configure the subdir diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 3cf20a6..8724c6e 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -750,9 +750,6 @@ public: cmStringRange GetCompileDefinitionsEntries() const; cmBacktraceRange GetCompileDefinitionsBacktraces() const; - bool IsConfigured() const { return this->Configured; } - void SetConfigured(){ this->Configured = true; } - void AddQtUiFileWithOptions(cmSourceFile *sf); std::vector<cmSourceFile*> GetQtUiFilesWithOptions() const; @@ -988,7 +985,6 @@ private: bool WarnUnused; bool CheckSystemVars; bool CheckCMP0000; - bool Configured; bool IsSourceFileTryCompile; mutable bool SuppressWatches; }; diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 7e7e600..84c19a3 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -583,7 +583,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } const std::string objPath = GetTarget()->GetSupportDirectory(); - vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath); + vars["OBJECT_DIR"] = + this->GetLocalGenerator()->ConvertToOutputFormat( + this->ConvertToNinjaPath(objPath), cmLocalGenerator::SHELL); EnsureDirectoryExists(objPath); if (this->GetGlobalGenerator()->IsGCCOnWindows()) @@ -631,7 +633,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); - std::string dllname = targetOutput; std::string name_of_def_file = target.GetSupportDirectory(); name_of_def_file += "/" + target.GetName(); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index f46c5b9..6e6dc60 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -771,14 +771,14 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()( // Get the input file location. std::string input = source.GetFullPath(); input = - this->Generator->GetLocalGenerator()->ConvertToNinjaPath(input); + this->Generator->GetGlobalGenerator()->ConvertToNinjaPath(input); // Get the output file location. std::string output = macdir; output += "/"; output += cmSystemTools::GetFilenameName(input); output = - this->Generator->GetLocalGenerator()->ConvertToNinjaPath(output); + this->Generator->GetGlobalGenerator()->ConvertToNinjaPath(output); // Write a build statement to copy the content into the bundle. this->Generator->GetGlobalGenerator()->WriteMacOSXContentBuild(input, diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index a10ceba..0267f63 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -17,11 +17,11 @@ #include "cmStandardIncludes.h" #include "cmNinjaTypes.h" +#include "cmGlobalNinjaGenerator.h" #include "cmLocalNinjaGenerator.h" #include "cmOSXBundleGenerator.h" class cmTarget; -class cmGlobalNinjaGenerator; class cmGeneratedFileStream; class cmGeneratorTarget; class cmMakefile; @@ -87,10 +87,10 @@ protected: const std::string& language); std::string ConvertToNinjaPath(const std::string& path) const { - return this->GetLocalGenerator()->ConvertToNinjaPath(path); + return this->GetGlobalGenerator()->ConvertToNinjaPath(path); } - cmLocalNinjaGenerator::map_to_ninja_path MapToNinjaPath() const { - return this->GetLocalGenerator()->MapToNinjaPath(); + cmGlobalNinjaGenerator::MapToNinjaPathImpl MapToNinjaPath() const { + return this->GetGlobalGenerator()->MapToNinjaPath(); } /// @return the list of link dependency for the given target @a target. diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 7be5b3f..5acae2f 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -142,21 +142,7 @@ std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source, } else if(output == SHELL || output == WATCOMQUOTE) { - // For the MSYS shell convert drive letters to posix paths, so - // that c:/some/path becomes /c/some/path. This is needed to - // avoid problems with the shell path translation. - if(this->GetState()->UseMSYSShell() && !this->LinkScriptShell) - { - if(result.size() > 2 && result[1] == ':') - { - result[1] = result[0]; - result[0] = '/'; - } - } - if(this->GetState()->UseWindowsShell()) - { - std::replace(result.begin(), result.end(), '/', '\\'); - } + result = this->ConvertDirectorySeparatorsForShell(source); result = this->EscapeForShell(result, true, false, output == WATCOMQUOTE); } else if(output == RESPONSE) @@ -167,6 +153,29 @@ std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source, } //---------------------------------------------------------------------------- +std::string cmOutputConverter::ConvertDirectorySeparatorsForShell( + const std::string& source) const +{ + std::string result = source; + // For the MSYS shell convert drive letters to posix paths, so + // that c:/some/path becomes /c/some/path. This is needed to + // avoid problems with the shell path translation. + if(this->GetState()->UseMSYSShell() && !this->LinkScriptShell) + { + if(result.size() > 2 && result[1] == ':') + { + result[1] = result[0]; + result[0] = '/'; + } + } + if(this->GetState()->UseWindowsShell()) + { + std::replace(result.begin(), result.end(), '/', '\\'); + } + return result; +} + +//---------------------------------------------------------------------------- std::string cmOutputConverter::Convert(RelativeRoot remote, const std::string& local, OutputFormat output, diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index ed7739e..852df5d 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -45,6 +45,8 @@ public: std::string Convert(RelativeRoot remote, const std::string& local, OutputFormat output = UNCHANGED, bool optional = false) const; + std::string ConvertDirectorySeparatorsForShell( + const std::string& source) const; /** * Get path for the specified relative root. diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index 95eba38..6a09673 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -23,7 +23,6 @@ public: virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); virtual std::string GetName() const { return "output_required_files";} - virtual bool IsDiscouraged() const { return true; } void ListDependencies(cmDependInformation const *info, FILE *fout, diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 283f277..a549d18 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -235,7 +235,7 @@ class cmPolicy; * \brief Handles changes in CMake behavior and policies * * See the cmake wiki section on - * <a href="http://www.cmake.org/Wiki/CMake/Policies">policies</a> + * <a href="https://cmake.org/Wiki/CMake/Policies">policies</a> * for an overview of this class's purpose */ class cmPolicies diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index 94161f8..410b370 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -47,12 +47,6 @@ public: */ virtual std::string GetName() const {return "remove";} - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmRemoveCommand, cmCommand); }; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 306276b..1d70ad6 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -48,7 +48,7 @@ bool cmSetCommand return true; } - // if it will be cleared, then clear it if it isn;t already clear + // if it will be cleared, then clear it if it isn't already clear if (currValue) { cmSystemTools::PutEnv(putEnvArg); @@ -59,7 +59,7 @@ bool cmSetCommand // SET (VAR) // Removes the definition of VAR. if (args.size() == 1) { - this->Makefile->RemoveDefinition(args[0]); + this->Makefile->RemoveDefinition(variable); return true; } // SET (VAR PARENT_SCOPE) // Removes the definition of VAR diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index 6addd8f..bcefd2c 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -44,12 +44,6 @@ public: */ virtual std::string GetName() const { return "subdirs";} - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmSubdirCommand, cmCommand); }; diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index 75a5685..3f3507e 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -21,7 +21,6 @@ public: virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); virtual std::string GetName() const { return "subdir_depends";} - virtual bool IsDiscouraged() const { return true; } cmTypeMacro(cmSubdirDependsCommand, cmCommand); }; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c24b5ea..d3c1f16 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -895,33 +895,12 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname, bool cmSystemTools::cmCopyFile(const char* source, const char* destination) { - // FIXME remove if statement once kwsys SystemTools get support for - // source is directory handling in CopyFileAlways function - if(cmSystemTools::FileIsDirectory(source)) - { - return Superclass::MakeDirectory(destination); - } - return Superclass::CopyFileAlways(source, destination); } bool cmSystemTools::CopyFileIfDifferent(const char* source, const char* destination) { - // FIXME remove if statement once kwsys SystemTools get support for - // source is directory handling in CopyFileIfDifferent function - if(cmSystemTools::FileIsDirectory(source)) - { - if(SystemTools::FileExists(destination)) - { - return true; - } - else - { - return Superclass::MakeDirectory(destination); - } - } - return Superclass::CopyFileIfDifferent(source, destination); } @@ -2066,10 +2045,11 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile) cmSystemToolsWindowsHandle hFrom = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(), GENERIC_READ, FILE_SHARE_READ, 0, - OPEN_EXISTING, 0, 0); + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); cmSystemToolsWindowsHandle hTo = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(), - GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); if(!hFrom || !hTo) { return false; @@ -2121,7 +2101,8 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t) #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), - GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); if(!h) { return false; @@ -2148,7 +2129,8 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), - GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); if(!h) { return false; diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index da927c7..1af2bfe 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -23,7 +23,6 @@ public: cmExecutionStatus &status); virtual std::string GetName() const { return "use_mangled_mesa";} virtual bool IsScriptable() const { return true; } - virtual bool IsDiscouraged() const { return true; } protected: void CopyAndFullPathMesaHeader(const char* source, const char* outdir); diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 23afdbe..8863ff5 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -22,7 +22,6 @@ public: virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); virtual std::string GetName() const { return "utility_source";} - virtual bool IsDiscouraged() const { return true; } }; #endif diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h index 7e68de1..5b0477f 100644 --- a/Source/cmVariableRequiresCommand.h +++ b/Source/cmVariableRequiresCommand.h @@ -22,7 +22,6 @@ public: virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); virtual std::string GetName() const { return "variable_requires";} - virtual bool IsDiscouraged() const { return true; } }; diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h index 0d06878..89dc9ff 100644 --- a/Source/cmWriteFileCommand.h +++ b/Source/cmWriteFileCommand.h @@ -46,12 +46,6 @@ public: */ virtual std::string GetName() const { return "write_file";} - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - cmTypeMacro(cmWriteFileCommand, cmCommand); }; diff --git a/Source/kwsys/CTestCustom.cmake.in b/Source/kwsys/CTestCustom.cmake.in index d6f802e..760221b 100644 --- a/Source/kwsys/CTestCustom.cmake.in +++ b/Source/kwsys/CTestCustom.cmake.in @@ -9,7 +9,6 @@ # resulting memory leaks are not logged by valgrind anyway. Therefore, we # don't have to exclude it. -set(CTEST_CUSTOM_MEMCHECK_IGNORE - ${CTEST_CUSTOM_MEMCHECK_IGNORE} +list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE kwsys.testProcess-10 ) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 3857e41..80289b8 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2365,95 +2365,102 @@ bool SystemTools::CopyFileAlways(const std::string& source, const std::string& d } mode_t perm = 0; bool perms = SystemTools::GetPermissions(source, perm); - - const int bufferSize = 4096; - char buffer[bufferSize]; - - // If destination is a directory, try to create a file with the same - // name as the source in that directory. - std::string real_destination = destination; - std::string destination_dir; - if(SystemTools::FileExists(destination) && - SystemTools::FileIsDirectory(destination)) + + if(SystemTools::FileIsDirectory(source)) { - destination_dir = real_destination; - SystemTools::ConvertToUnixSlashes(real_destination); - real_destination += '/'; - std::string source_name = source; - real_destination += SystemTools::GetFilenameName(source_name); + SystemTools::MakeDirectory(destination); } else { - destination_dir = SystemTools::GetFilenamePath(destination); - } + const int bufferSize = 4096; + char buffer[bufferSize]; + + // If destination is a directory, try to create a file with the same + // name as the source in that directory. + + std::string destination_dir; + if(SystemTools::FileExists(destination) && + SystemTools::FileIsDirectory(destination)) + { + destination_dir = real_destination; + SystemTools::ConvertToUnixSlashes(real_destination); + real_destination += '/'; + std::string source_name = source; + real_destination += SystemTools::GetFilenameName(source_name); + } + else + { + destination_dir = SystemTools::GetFilenamePath(destination); + } - // Create destination directory + // Create destination directory - SystemTools::MakeDirectory(destination_dir); + SystemTools::MakeDirectory(destination_dir); - // Open files + // Open files #if defined(_WIN32) - kwsys::ifstream fin(Encoding::ToNarrow( - SystemTools::ConvertToWindowsExtendedPath(source)).c_str(), - std::ios::in | std::ios::binary); + kwsys::ifstream fin(Encoding::ToNarrow( + SystemTools::ConvertToWindowsExtendedPath(source)).c_str(), + std::ios::in | std::ios::binary); #else - kwsys::ifstream fin(source.c_str(), - std::ios::in | std::ios::binary); + kwsys::ifstream fin(source.c_str(), + std::ios::in | std::ios::binary); #endif - if(!fin) - { - return false; - } + if(!fin) + { + return false; + } - // try and remove the destination file so that read only destination files - // can be written to. - // If the remove fails continue so that files in read only directories - // that do not allow file removal can be modified. - SystemTools::RemoveFile(real_destination); + // try and remove the destination file so that read only destination files + // can be written to. + // If the remove fails continue so that files in read only directories + // that do not allow file removal can be modified. + SystemTools::RemoveFile(real_destination); #if defined(_WIN32) - kwsys::ofstream fout(Encoding::ToNarrow( - SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(), + kwsys::ofstream fout(Encoding::ToNarrow( + SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(), std::ios::out | std::ios::trunc | std::ios::binary); #else - kwsys::ofstream fout(real_destination.c_str(), + kwsys::ofstream fout(real_destination.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); #endif - if(!fout) - { - return false; - } - - // This copy loop is very sensitive on certain platforms with - // slightly broken stream libraries (like HPUX). Normally, it is - // incorrect to not check the error condition on the fin.read() - // before using the data, but the fin.gcount() will be zero if an - // error occurred. Therefore, the loop should be safe everywhere. - while(fin) - { - fin.read(buffer, bufferSize); - if(fin.gcount()) + if(!fout) { - fout.write(buffer, fin.gcount()); + return false; } - else + + // This copy loop is very sensitive on certain platforms with + // slightly broken stream libraries (like HPUX). Normally, it is + // incorrect to not check the error condition on the fin.read() + // before using the data, but the fin.gcount() will be zero if an + // error occurred. Therefore, the loop should be safe everywhere. + while(fin) { - break; + fin.read(buffer, bufferSize); + if(fin.gcount()) + { + fout.write(buffer, fin.gcount()); + } + else + { + break; + } } - } - // Make sure the operating system has finished writing the file - // before closing it. This will ensure the file is finished before - // the check below. - fout.flush(); + // Make sure the operating system has finished writing the file + // before closing it. This will ensure the file is finished before + // the check below. + fout.flush(); - fin.close(); - fout.close(); + fin.close(); + fout.close(); - if(!fout) - { - return false; + if(!fout) + { + return false; + } } if ( perms ) { diff --git a/Templates/CPack.GenericDescription.txt b/Templates/CPack.GenericDescription.txt index 9ca1802..712ee14 100644 --- a/Templates/CPack.GenericDescription.txt +++ b/Templates/CPack.GenericDescription.txt @@ -1,5 +1,5 @@ DESCRIPTION =========== -This is an installer created using CPack (http://www.cmake.org). No additional installation instructions provided. +This is an installer created using CPack (https://cmake.org). No additional installation instructions provided. diff --git a/Templates/CPack.GenericLicense.txt b/Templates/CPack.GenericLicense.txt index c211bb3..09c6218 100644 --- a/Templates/CPack.GenericLicense.txt +++ b/Templates/CPack.GenericLicense.txt @@ -1,5 +1,5 @@ LICENSE ======= -This is an installer created using CPack (http://www.cmake.org). No license provided. +This is an installer created using CPack (https://cmake.org). No license provided. diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt index 1cb8669..3c8ae35 100644 --- a/Tests/CPackComponents/CMakeLists.txt +++ b/Tests/CPackComponents/CMakeLists.txt @@ -72,7 +72,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example") set(CPACK_NSIS_MENU_LINKS "ftp://ftpserver" "Test Ftp Link" "ftps://ftpsserver" "Test Ftps Link" - "http://www.cmake.org" "CMake Web Site" + "https://cmake.org" "CMake Web Site" "https://github.com/" "Test Https Link" "mailto:kitware@kitware.com" "Test MailTo Link" "news://newsserver" "Test News Link" diff --git a/Tests/CPackComponentsDEB/license.txt b/Tests/CPackComponentsDEB/license.txt index ba8ba48..d829d93 100644 --- a/Tests/CPackComponentsDEB/license.txt +++ b/Tests/CPackComponentsDEB/license.txt @@ -1,3 +1,3 @@ LICENSE ------- -This is an installer created using CPack (http://www.cmake.org). No license provided. +This is an installer created using CPack (https://cmake.org). No license provided. diff --git a/Tests/CPackComponentsForAll/license.txt b/Tests/CPackComponentsForAll/license.txt index ba8ba48..d829d93 100644 --- a/Tests/CPackComponentsForAll/license.txt +++ b/Tests/CPackComponentsForAll/license.txt @@ -1,3 +1,3 @@ LICENSE ------- -This is an installer created using CPack (http://www.cmake.org). No license provided. +This is an installer created using CPack (https://cmake.org). No license provided. diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt index 638e788..73eaf4f 100644 --- a/Tests/CPackWiXGenerator/CMakeLists.txt +++ b/Tests/CPackWiXGenerator/CMakeLists.txt @@ -64,7 +64,7 @@ set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt") set(CPACK_WIX_PROPERTY_ARPCOMMENTS "My Custom ARPCOMMENTS") -set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.cmake.org") +set(CPACK_WIX_PROPERTY_ARPHELPLINK "https://cmake.org") include(CPack) diff --git a/Tests/Contracts/Trilinos/CMakeLists.txt b/Tests/Contracts/Trilinos/CMakeLists.txt index f5757b5..8d74ca5 100644 --- a/Tests/Contracts/Trilinos/CMakeLists.txt +++ b/Tests/Contracts/Trilinos/CMakeLists.txt @@ -27,7 +27,7 @@ endif() message(STATUS "HOME='${HOME}'") if(NOT DEFINED url) - set(url "http://www.cmake.org/files/contracts/trilinos-11.4.1.tar.gz") + set(url "https://cmake.org/files/contracts/trilinos-11.4.1.tar.gz") endif() message(STATUS "url='${url}'") diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index a3f1f81..aedc89b 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -136,7 +136,7 @@ add_library(testLibDepends testLibDepends.c) target_link_libraries(testLibDepends LINK_PUBLIC testLibRequired) macro(add_include_lib _libName) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c" "// no content\n") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c" "/* no content */\n") add_library(${_libName} "${CMAKE_CURRENT_BINARY_DIR}/${_libName}.c") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_libName}") set_property(TARGET ${_libName} APPEND PROPERTY @@ -144,7 +144,7 @@ macro(add_include_lib _libName) "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/${_libName}>" ) if (NOT "${ARGV1}" STREQUAL "NO_HEADER") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" "// no content\n") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" "/* no content */\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_libName}/${_libName}.h" DESTINATION include/${_libName} @@ -182,7 +182,7 @@ install(FILES ) add_include_lib(testLibIncludeRequired6) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h" "/* No content */\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/testLibIncludeRequired7/testLibIncludeRequired7.h" DESTINATION include/testLibIncludeRequired7 @@ -391,22 +391,22 @@ install(TARGETS install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredTargets.cmake DESTINATION lib/cmake/testLibRequired) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired/installIncludesTest3.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired/installIncludesTest3.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4/installIncludesTest4.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4/installIncludesTest4.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5/installIncludesTest5.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5/installIncludesTest5.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" "/* No content */\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" "// No content\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" "/* No content */\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" DESTINATION installIncludesTest diff --git a/Tests/ExternalProject/Example/CMakeLists.txt b/Tests/ExternalProject/Example/CMakeLists.txt index 69ebaaf..4c12895 100644 --- a/Tests/ExternalProject/Example/CMakeLists.txt +++ b/Tests/ExternalProject/Example/CMakeLists.txt @@ -5,7 +5,7 @@ include(ExternalProject) ExternalProject_Add( cmake281 - URL http://www.cmake.org/files/v2.8/cmake-2.8.1.tar.gz + URL https://cmake.org/files/v2.8/cmake-2.8.1.tar.gz CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> BUILD_COMMAND "" ) diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 758165c..27f33a2 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -66,7 +66,7 @@ add_custom_target(check-part1 ALL -Dtest_colons_4=$<1:C:\\CMake> -Dtest_colons_5=$<1:C:/CMake> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake - COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 3)" + COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 4)" VERBATIM ) @@ -137,7 +137,7 @@ add_custom_target(check-part2 ALL -Dtest_arbitrary_content_comma_9=$<1:a,,b,,> -Dtest_arbitrary_content_comma_10=$<1:,,a,,b,,> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake - COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 3)" + COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 4)" VERBATIM ) @@ -221,7 +221,27 @@ add_custom_target(check-part3 ALL -Dequal22=$<EQUAL:10,-012> -Dequal23=$<EQUAL:-10,-012> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake - COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" + COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 4)" + VERBATIM + ) + +if(WIN32) + set(test_shell_path c:/shell/path) +else() + set(test_shell_path /shell/path) +endif() +set(path_prefix BYPASS_FURTHER_CONVERSION) + +add_custom_target(check-part4 ALL + COMMAND ${CMAKE_COMMAND} + # Prefix path to bypass its further conversion when being processed by + # CMake as command-line argument + -Dtest_shell_path=${path_prefix}$<SHELL_PATH:${test_shell_path}> + -Dpath_prefix=${path_prefix} + -DWIN32=${WIN32} + -DCMAKE_GENERATOR=${CMAKE_GENERATOR} + -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part4.cmake + COMMAND ${CMAKE_COMMAND} -E echo "check done (part 4 of 4)" VERBATIM ) diff --git a/Tests/GeneratorExpression/check-common.cmake b/Tests/GeneratorExpression/check-common.cmake index 8ffebd7..faf5d4f 100644 --- a/Tests/GeneratorExpression/check-common.cmake +++ b/Tests/GeneratorExpression/check-common.cmake @@ -1,5 +1,5 @@ -macro(check var val) +function(check var val) if(NOT "${${var}}" STREQUAL "${val}") message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"") endif() -endmacro() +endfunction() diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake index 3207582..60b193f 100644 --- a/Tests/GeneratorExpression/check-part1.cmake +++ b/Tests/GeneratorExpression/check-part1.cmake @@ -55,5 +55,5 @@ check(test_semicolon ";") check(test_colons_1 ":") check(test_colons_2 "::") check(test_colons_3 "Qt5::Core") -check(test_colons_4 "C:\\\\CMake") +check(test_colons_4 [[C:\CMake]]) check(test_colons_5 "C:/CMake") diff --git a/Tests/GeneratorExpression/check-part4.cmake b/Tests/GeneratorExpression/check-part4.cmake new file mode 100644 index 0000000..9e516d5 --- /dev/null +++ b/Tests/GeneratorExpression/check-part4.cmake @@ -0,0 +1,15 @@ +include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake) + +string(REPLACE ${path_prefix} "" test_shell_path ${test_shell_path}) + +if(WIN32) + if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles") + check(test_shell_path [[/c/shell/path]]) + elseif(CMAKE_GENERATOR STREQUAL "Unix Makefiles") + check(test_shell_path [[c:/shell/path]]) + else() + check(test_shell_path [[c:\shell\path]]) + endif() +else() + check(test_shell_path [[/shell/path]]) +endif() diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index 8e2bd0a..5b99ea7 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -5,7 +5,7 @@ project(TargetIncludeDirectories) macro(create_header _name) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "//${_name}.h\n") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h" "/* ${_name}.h */\n") endmacro() create_header(bar) @@ -88,7 +88,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/bad/common.h" "#error Should not be incl file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/good") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/good/common.h" "#include \"othergood.h\"\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/othergood") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/othergood/othergood.h" "// No error\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/othergood/othergood.h" "/* No error */\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libothergood.cpp" "// No content \n") add_library(libothergood "${CMAKE_CURRENT_BINARY_DIR}/libothergood.cpp") @@ -149,7 +149,7 @@ target_include_directories(lib5 ) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat/prefix_foo_bar_bat.h" "// prefix_foo_bar_bat.h\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat/prefix_foo_bar_bat.h" "/* prefix_foo_bar_bat.h */\n") target_include_directories(TargetIncludeDirectories PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/prefix_$<JOIN:foo;bar;bat,/prefix_>") diff --git a/Tests/OutOfBinary/CMakeLists.txt b/Tests/OutOfBinary/CMakeLists.txt index e327541..f50536e 100644 --- a/Tests/OutOfBinary/CMakeLists.txt +++ b/Tests/OutOfBinary/CMakeLists.txt @@ -1,2 +1,4 @@ add_library(outlib outlib.c) +add_executable(outexe outexe.c) +target_link_libraries(outexe subdir) diff --git a/Tests/OutOfBinary/outexe.c b/Tests/OutOfBinary/outexe.c new file mode 100644 index 0000000..6f14043 --- /dev/null +++ b/Tests/OutOfBinary/outexe.c @@ -0,0 +1,2 @@ +extern int subdir(void); +int main(void) { return subdir(); } diff --git a/Tests/OutOfSource/SubDir/CMakeLists.txt b/Tests/OutOfSource/SubDir/CMakeLists.txt index c5df36e..e18dbb9 100644 --- a/Tests/OutOfSource/SubDir/CMakeLists.txt +++ b/Tests/OutOfSource/SubDir/CMakeLists.txt @@ -6,3 +6,5 @@ add_subdirectory(${OutOfSource_SOURCE_DIR}/../OutOfBinary # subdir to a sibling dir add_subdirectory(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir ) + +add_library(subdir subdir.c) diff --git a/Tests/OutOfSource/SubDir/subdir.c b/Tests/OutOfSource/SubDir/subdir.c new file mode 100644 index 0000000..0d0d827 --- /dev/null +++ b/Tests/OutOfSource/SubDir/subdir.c @@ -0,0 +1 @@ +int subdir(void) { return 0; } diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index 8782ba9..a578408 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -1,5 +1,11 @@ include(RunCMake) +if(RunCMake_GENERATOR STREQUAL "Borland Makefiles") + set(fs_delay 3) +else() + set(fs_delay 1.125) +endif() + function(run_BuildDepends CASE) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${CASE}-build) @@ -17,7 +23,7 @@ function(run_BuildDepends CASE) if(run_BuildDepends_skip_step_2) return() endif() - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1.125) # handle 1s resolution + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay}) # handle 1s resolution include(${RunCMake_SOURCE_DIR}/${CASE}.step2.cmake OPTIONAL) set(check_step 2) run_cmake_command(${CASE}-build2 ${CMAKE_COMMAND} --build . --config Debug) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index f11d20c..1a0019f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -290,7 +290,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") add_RunCMake_test(CompilerLauncher) endif() -add_RunCMake_test_group(CPack "DEB;RPM") +add_RunCMake_test_group(CPack "DEB;RPM;TGZ") # add a test to make sure symbols are exported from a shared library # for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used add_RunCMake_test(AutoExportDll) diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 89673c2..b7295f4 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -4,9 +4,9 @@ include(RunCMake) include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake") # args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP -run_cpack_test(MINIMAL "RPM;DEB" false) +run_cpack_test(MINIMAL "RPM;DEB;TGZ" false) run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false) run_cpack_test(DEB_EXTRA "DEB" false) run_cpack_test(DEPENDENCIES "RPM;DEB" true) -run_cpack_test(EMPTY_DIR "RPM;DEB" true) -run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB" true) +run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true) +run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true) diff --git a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake new file mode 100644 index 0000000..26e2ab0 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-ExpectedFiles.cmake @@ -0,0 +1,3 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "components_empty_dir*.tar.gz") +set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty/$") diff --git a/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake new file mode 100644 index 0000000..81a5035 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/COMPONENTS_EMPTY_DIR-specifics.cmake @@ -0,0 +1 @@ +set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") diff --git a/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake new file mode 100644 index 0000000..a75514a --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/EMPTY_DIR-ExpectedFiles.cmake @@ -0,0 +1,3 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "empty_dir*.tar.gz") +set(EXPECTED_FILE_CONTENT_1 "^[^\n]*empty_dir-0.1.1-[^\n]*/empty/$") diff --git a/Tests/RunCMake/CPack/TGZ/Helpers.cmake b/Tests/RunCMake/CPack/TGZ/Helpers.cmake new file mode 100644 index 0000000..f14d532 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/Helpers.cmake @@ -0,0 +1,10 @@ +set(ALL_FILES_GLOB "*.tar.gz") + +function(getPackageContent FILE RESULT_VAR) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar -ztvf ${FILE} + OUTPUT_VARIABLE package_content_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE) +endfunction() diff --git a/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake b/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake new file mode 100644 index 0000000..5c31f27 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/MINIMAL-ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "minimal*.tar.gz") +set(EXPECTED_FILE_CONTENT_1 "^[^\n]*minimal-0.1.1-[^\n]*/foo/\n[^\n]*minimal-0.1.1-[^\n]*/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/TGZ/Prerequirements.cmake b/Tests/RunCMake/CPack/TGZ/Prerequirements.cmake new file mode 100644 index 0000000..dbaf682 --- /dev/null +++ b/Tests/RunCMake/CPack/TGZ/Prerequirements.cmake @@ -0,0 +1,4 @@ +function(get_test_prerequirements found_var config_file) + file(WRITE "${config_file}" "") + set(${found_var} true PARENT_SCOPE) +endfunction() diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt index f427303..92c1d23 100644 --- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt +++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt @@ -2,4 +2,10 @@ Some Author Warning Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at Wdev.cmake:6 \(include\): + include\(\) given empty file name \(ignored\). +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake index 0242086..e5026ef 100644 --- a/Tests/RunCMake/CommandLine/Wdev.cmake +++ b/Tests/RunCMake/CommandLine/Wdev.cmake @@ -1 +1,6 @@ message(AUTHOR_WARNING "Some Author Warning") + +# with -Wdev this will also cause an AUTHOR_WARNING message, checks that +# messages issued outside of the message command, by other CMake commands, also +# are affected by -Wdev +include("") diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake index 0242086..d81b858 100644 --- a/Tests/RunCMake/CommandLine/Wno-dev.cmake +++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake @@ -1 +1,6 @@ message(AUTHOR_WARNING "Some Author Warning") + +# without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that +# messages issued outside of the message command, by other CMake commands, also +# are affected by -Wno-dev +include("") diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-result.txt b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt new file mode 100644 index 0000000..8d3c4cc --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt @@ -0,0 +1,17 @@ +CMake Error at BadSHELL_PATH.cmake:[0-9]+ \(add_custom_target\): + Error evaluating generator expression: + + \$<SHELL_PATH:> + + "" is not an absolute path. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadSHELL_PATH.cmake:[0-9]+ \(add_custom_target\): + Error evaluating generator expression: + + \$<SHELL_PATH:Relative/Path> + + "Relative/Path" is not an absolute path. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake new file mode 100644 index 0000000..5eff7bc --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake @@ -0,0 +1,4 @@ +add_custom_target(check ALL COMMAND check + $<SHELL_PATH:> + $<SHELL_PATH:Relative/Path> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 0679024..45175d8 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -10,6 +10,7 @@ run_cmake(BadTargetName) run_cmake(BadTargetTypeInterface) run_cmake(BadTargetTypeObject) run_cmake(BadInstallPrefix) +run_cmake(BadSHELL_PATH) run_cmake(CMP0044-WARN) run_cmake(NonValidTarget-C_COMPILER_ID) run_cmake(NonValidTarget-CXX_COMPILER_ID) diff --git a/Utilities/Release/Cygwin/README.cygwin.in b/Utilities/Release/Cygwin/README.cygwin.in index 6c42a4c..17cf2a1 100644 --- a/Utilities/Release/Cygwin/README.cygwin.in +++ b/Utilities/Release/Cygwin/README.cygwin.in @@ -8,7 +8,7 @@ Build requirements make Canonical homepage: - http://www.cmake.org + https://cmake.org Canonical download: ftp://www.cmake.org/pub/cmake/ diff --git a/Utilities/Sphinx/templates/layout.html b/Utilities/Sphinx/templates/layout.html index 1c5728c..177e044 100644 --- a/Utilities/Sphinx/templates/layout.html +++ b/Utilities/Sphinx/templates/layout.html @@ -5,7 +5,7 @@ style="vertical-align: middle; margin-top: -2px" /> </li> <li> - <a href="http://www.cmake.org/">CMake</a>{{ reldelim1 }} + <a href="https://cmake.org/">CMake</a>{{ reldelim1 }} </li> <li> <a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }} diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index 41896a7..7b33828 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp @@ -529,7 +529,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) { return addError("'" + std::string(token.start_, token.end_) + "' is not a number.", token); - Value::UInt digit(c - '0'); + Value::UInt digit(static_cast<Value::UInt>(c - '0')); if (value >= threshold) { // We've hit or exceeded the max value divided by 10 (rounded down). If // a) we've only just touched the limit, b) this is the last digit, and |