diff options
39 files changed, 312 insertions, 47 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index fc042bc..ba858bd 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -54,6 +54,47 @@ if(${CPACK_SYSTEM_NAME} MATCHES Windows) endif() endif() +# Advanced IFW configuration +set(_cpifwrc CPACK_IFW_COMPONENT_GROUP_CMAKE_) +set(_cpifwrcconf _CPACK_IFW_COMPONENT_GROUP_CMAKE) +set(${_cpifwrcconf} "# CMake IFW configuration\n") +macro(_cmifwarg DESCRIPTION TYPE NAME DEFAULT) + set(_var CMake_IFW_ROOT_COMPONENT_${NAME}) + if(DEFINED ${_var}) + set(${_var} ${${_var}} CACHE ${TYPE} ${DESCRIPTION}) + mark_as_advanced(${_var}) + elseif(NOT "${DEFAULT}" STREQUAL "") + set(${_var} ${DEFAULT}) + endif() + if(DEFINED ${_var}) + set(${_cpifwrcconf} + "${${_cpifwrcconf}} set(${_cpifwrc}${NAME}\n \"${${_var}}\")\n") + endif() +endmacro() + +_cmifwarg("Package <Name> tag (domen-like)" + STRING NAME "") +_cmifwarg("Package <DisplayName> tag" + STRING DISPLAY_NAME "") +_cmifwarg("Package <Description> tag" + STRING DESCRIPTION "") +_cmifwarg("Package <ReleaseDate> tag (keep empty to auto generate)" + STRING RELEASE_DATE "") +_cmifwarg("Package <Default> tag (values: TRUE, FALSE, SCRIPT)" + STRING DEFAULT "") +_cmifwarg("Package <Version> tag" + STRING VERSION + "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") +_cmifwarg("Package <Script> tag" + FILEPATH SCRIPT "${CMake_BINARY_DIR}/installscript.qs") +_cmifwarg("Package <SortingPriority> tag" + STRING PRIORITY "100") +_cmifwarg("Package <ForsedInstallation> tag" + STRING FORCED_INSTALLATION "") + +set(${_cpifwrc}LICENSES_DEFAULT + "${CPACK_PACKAGE_NAME} Copyright;${CPACK_RESOURCE_FILE_LICENSE}") + # Components if(CMake_INSTALL_COMPONENTS) set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack) @@ -103,20 +144,31 @@ if(CMake_INSTALL_COMPONENTS) endif() endif() set(_CPACK_IFW_COMPONENTS_CONFIGURATION " -# Components -set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\") -set(CPACK_COMPONENTS_GROUPING IGNORE) -") + # Components + set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\") + set(CPACK_COMPONENTS_GROUPING IGNORE) + ") else() if(BUILD_QtDialog AND USE_LGPL) - set(_CPACK_IFW_ADDITIONAL_LICENSES - "\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\"") + set(${_cpifwrc}LICENSES_DEFAULT + "${${_cpifwrc}LICENSES_DEFAULT};LGPLv${USE_LGPL};${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt") endif() endif() +_cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)" + STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}") + # Components scripts configuration +if(CMake_INSTALL_COMPONENTS) + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/CMake.qs.in" + "${CMake_BINARY_DIR}/installscript.qs" @ONLY + ) +else() + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in" + "${CMake_BINARY_DIR}/installscript.qs" @ONLY + ) +endif() foreach(_script - CMake CMake.Documentation.SphinxHTML CMake.DeveloperReference.HTML) configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in" @@ -137,17 +189,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Windows) set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n") endif() endif() - configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in" - "${CMake_BINARY_DIR}/installscript.qs" @ONLY - ) install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html" DESTINATION "${CMAKE_DOC_DIR}" ) - if(CMake_INSTALL_COMPONENTS) - set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/CMake.qs") - else() - set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/installscript.qs") - endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES Linux) @@ -155,8 +199,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Linux) set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}") endif() -set(_CPACK_IFW_PACKAGE_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) - if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # default to source package - system, on cygwin system is not diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index d7a33bc..99746b0 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -47,7 +47,7 @@ if(CPACK_GENERATOR MATCHES "IFW") @_CPACK_IFW_COMPONENTS_CONFIGURATION@ # Unspecified set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME@_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Package configuration group set(CPACK_IFW_PACKAGE_GROUP CMake) @@ -59,13 +59,7 @@ if(CPACK_GENERATOR MATCHES "IFW") "@CPACK_PACKAGE_NAME@") set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_LICENSES - "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@" - @_CPACK_IFW_ADDITIONAL_LICENSES@) - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@_CPACK_IFW_PACKAGE_SCRIPT@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_PRIORITY 100) + @_CPACK_IFW_COMPONENT_GROUP_CMAKE@ # Tools set(CPACK_COMPONENT_GROUP_TOOLS_DISPLAY_NAME "Command-Line Tools") @@ -73,7 +67,8 @@ if(CPACK_GENERATOR MATCHES "IFW") "Command-Line Tools: cmake, ctest and cpack") set(CPACK_COMPONENT_GROUP_TOOLS_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_TOOLS_PRIORITY 90) - set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "cmake") set(CPACK_COMPONENT_CMAKE_DESCRIPTION @@ -82,7 +77,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CMAKE_GROUP Tools) set(CPACK_IFW_COMPONENT_CMAKE_NAME "CMake") set(CPACK_IFW_COMPONENT_CMAKE_PRIORITY 89) - set(CPACK_IFW_COMPONENT_CMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CTEST_DISPLAY_NAME "ctest") set(CPACK_COMPONENT_CTEST_DESCRIPTION @@ -91,7 +87,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CTEST_GROUP Tools) set(CPACK_IFW_COMPONENT_CTEST_NAME "CTest") set(CPACK_IFW_COMPONENT_CTEST_PRIORITY 88) - set(CPACK_IFW_COMPONENT_CTEST_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CTEST_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CPACK_DISPLAY_NAME "cpack") set(CPACK_COMPONENT_CPACK_DESCRIPTION @@ -100,7 +97,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CPACK_GROUP Tools) set(CPACK_IFW_COMPONENT_CPACK_NAME "CPack") set(CPACK_IFW_COMPONENT_CPACK_PRIORITY 87) - set(CPACK_IFW_COMPONENT_CPACK_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CPACK_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMCLDEPS_DISPLAY_NAME "cmcldeps") set(CPACK_COMPONENT_CMCLDEPS_DESCRIPTION @@ -108,7 +106,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CMCLDEPS_GROUP Tools) set(CPACK_IFW_COMPONENT_CMCLDEPS_NAME "CMClDeps") set(CPACK_IFW_COMPONENT_CMCLDEPS_PRIORITY 86) - set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKEXBUILD_DISPLAY_NAME "cmakexbuild") set(CPACK_COMPONENT_CMAKEXBUILD_DESCRIPTION @@ -117,7 +116,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CMAKEXBUILD_GROUP Tools) set(CPACK_IFW_COMPONENT_CMAKEXBUILD_NAME "CMakeXBuild") set(CPACK_IFW_COMPONENT_CMAKEXBUILD_PRIORITY 85) - set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Dialogs set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs") @@ -125,20 +125,23 @@ if(CPACK_GENERATOR MATCHES "IFW") "Interactive Dialogs with Console and GUI interfaces") set(CPACK_COMPONENT_GROUP_DIALOGS_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_PRIORITY 80) - set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE-GUI_DISPLAY_NAME "cmake-gui") set(CPACK_COMPONENT_CMAKE-GUI_GROUP Dialogs) set(CPACK_IFW_COMPONENT_CMAKE-GUI_NAME "QtGUI") set(CPACK_IFW_COMPONENT_CMAKE-GUI_SCRIPT "@CMake_SOURCE_DIR@/Source/QtIFW/CMake.Dialogs.QtGUI.qs") - set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") @_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES@ set(CPACK_COMPONENT_CCMAKE_DISPLAY_NAME "ccmake") set(CPACK_COMPONENT_CCMAKE_GROUP Dialogs) set(CPACK_IFW_COMPONENT_CCMAKE_NAME "CursesGUI") - set(CPACK_IFW_COMPONENT_CCMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CCMAKE_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Documentation set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DISPLAY_NAME "Documentation") @@ -147,33 +150,36 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_GROUP_DOCUMENTATION_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_PRIORITY 60) set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-MAN_DISPLAY_NAME "man") set(CPACK_COMPONENT_SPHINX-MAN_GROUP Documentation) set(CPACK_COMPONENT_SPHINX-MAN_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-MAN_NAME "SphinxMan") - set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-HTML_DISPLAY_NAME "HTML") set(CPACK_COMPONENT_SPHINX-HTML_GROUP Documentation) set(CPACK_IFW_COMPONENT_SPHINX-HTML_NAME "SphinxHTML") set(CPACK_IFW_COMPONENT_SPHINX-HTML_SCRIPT "@CMake_BINARY_DIR@/CMake.Documentation.SphinxHTML.qs") - set(CPACK_IFW_COMPONENT_SPHINX-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_SPHINX-HTML_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISPLAY_NAME "Single HTML") set(CPACK_COMPONENT_SPHINX-SINGLEHTML_GROUP Documentation) set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_NAME "SphinxSingleHTML") set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-QTHELP_DISPLAY_NAME "Qt Compressed Help") set(CPACK_COMPONENT_SPHINX-QTHELP_GROUP Documentation) set(CPACK_COMPONENT_SPHINX-QTHELP_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_NAME "SphinxQtHelp") - set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Developer Reference set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DISPLAY_NAME "Developer Reference") @@ -182,7 +188,7 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_PRIORITY 50) set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISPLAY_NAME "HTML") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_GROUP DeveloperReference) @@ -190,13 +196,15 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_NAME "HTML") set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_SCRIPT "@CMake_BINARY_DIR@/CMake.DeveloperReference.HTML.qs") - set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISPLAY_NAME "Qt Compressed Help") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_GROUP DeveloperReference) set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISABLED TRUE) set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_NAME "QtHelp") - set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") endif() diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst index e9a5eb0..71233d9 100644 --- a/Help/command/execute_process.rst +++ b/Help/command/execute_process.rst @@ -18,7 +18,8 @@ Execute one or more child processes. [OUTPUT_QUIET] [ERROR_QUIET] [OUTPUT_STRIP_TRAILING_WHITESPACE] - [ERROR_STRIP_TRAILING_WHITESPACE]) + [ERROR_STRIP_TRAILING_WHITESPACE] + [ENCODING <name>]) Runs the given sequence of one or more commands in parallel with the standard output of each process piped to the standard input of the next. @@ -66,6 +67,14 @@ Options: ``OUTPUT_QUIET``, ``ERROR_QUIET`` The standard output or standard error results will be quietly ignored. +``ENCODING <name>`` + On Windows, the encoding that is used to decode output from the process. + Ignored on other platforms. + Valid encoding names are: ``AUTO`` (the default), ``NONE``, ``UTF8``, + ``ANSI`` and ``OEM``. + ``AUTO`` encoding means current active console's codepage will be used + or if that isn't available then ``ANSI`` codepage will be used. + If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the same pipe the precedence is not specified. If no ``OUTPUT_*`` or ``ERROR_*`` options are given the output will diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index b365fdf..e55524c 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -269,6 +269,7 @@ Properties on Targets /prop_tgt/VERSION /prop_tgt/VISIBILITY_INLINES_HIDDEN /prop_tgt/VS_CONFIGURATION_TYPE + /prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY /prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION /prop_tgt/VS_DOTNET_REFERENCES /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst new file mode 100644 index 0000000..0af85cb --- /dev/null +++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst @@ -0,0 +1,6 @@ +VS_DEBUGGER_WORKING_DIRECTORY +----------------------------- + +Sets the local debugger working directory for Visual Studio C++ targets. +This is defined in ``<LocalDebuggerWorkingDirectory>`` in the Visual Studio +project file. diff --git a/Help/release/dev/execute_process-encoding.rst b/Help/release/dev/execute_process-encoding.rst new file mode 100644 index 0000000..1c7cd8c --- /dev/null +++ b/Help/release/dev/execute_process-encoding.rst @@ -0,0 +1,5 @@ +execute_process-encoding +------------------------ + +* The :command:`execute_process` command gained an ``ENCODING`` option to + specify on Windows which encoding is used for output from child process. diff --git a/Help/release/dev/vs-debugger-config.rst b/Help/release/dev/vs-debugger-config.rst new file mode 100644 index 0000000..58873a5 --- /dev/null +++ b/Help/release/dev/vs-debugger-config.rst @@ -0,0 +1,6 @@ +vs-debugger-configuration +------------------------- + +* For the :ref:`Visual Studio Generators` for VS 2010 and above + the working directory for debugging can be set using a new + :prop_tgt:`VS_DEBUGGER_WORKING_DIRECTORY` target property. diff --git a/Modules/Platform/Darwin-PGI-C.cmake b/Modules/Platform/Darwin-PGI-C.cmake new file mode 100644 index 0000000..790919b --- /dev/null +++ b/Modules/Platform/Darwin-PGI-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Darwin-PGI) +__darwin_compiler_pgi(C) diff --git a/Modules/Platform/Darwin-PGI-CXX.cmake b/Modules/Platform/Darwin-PGI-CXX.cmake new file mode 100644 index 0000000..ceaed71 --- /dev/null +++ b/Modules/Platform/Darwin-PGI-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Darwin-PGI) +__darwin_compiler_pgi(CXX) diff --git a/Modules/Platform/Darwin-PGI-Fortran.cmake b/Modules/Platform/Darwin-PGI-Fortran.cmake new file mode 100644 index 0000000..146807b --- /dev/null +++ b/Modules/Platform/Darwin-PGI-Fortran.cmake @@ -0,0 +1,2 @@ +include(Platform/Darwin-PGI) +__darwin_compiler_pgi(Fortran) diff --git a/Modules/Platform/Darwin-PGI.cmake b/Modules/Platform/Darwin-PGI.cmake new file mode 100644 index 0000000..04479a8 --- /dev/null +++ b/Modules/Platform/Darwin-PGI.cmake @@ -0,0 +1,14 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# This module is shared by multiple languages; use include blocker. +if(__DARWIN_COMPILER_PGI) + return() +endif() +set(__DARWIN_COMPILER_PGI 1) + +macro(__darwin_compiler_pgi lang) + set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,") + set(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version,") + set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-install_name") +endmacro() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e26e402..d5f5724 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 7) -set(CMake_VERSION_PATCH 20161201) +set(CMake_VERSION_PATCH 20161202) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index fa526ae..af80cbf 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -91,7 +91,9 @@ int main(int argc, char const* const* argv) #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) // Replace streambuf so we can output Unicode to console cmsys::ConsoleBuf::Manager consoleOut(std::cout); + consoleOut.SetUTF8Pipes(); cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); + consoleErr.SetUTF8Pipes(); #endif cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 98bd3bb..32ffa6b 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -105,7 +105,7 @@ bool cmProcess::Buffer::GetLast(std::string& line) int cmProcess::GetNextOutputLine(std::string& line, double timeout) { - cmProcessOutput processOutput; + cmProcessOutput processOutput(cmProcessOutput::UTF8); std::string strdata; for (;;) { // Look for lines already buffered. diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 1562223..eb26a50 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -47,6 +47,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, std::string error_variable; std::string result_variable; std::string working_directory; + cmProcessOutput::Encoding encoding = cmProcessOutput::Auto; for (size_t i = 0; i < args.size(); ++i) { if (args[i] == "COMMAND") { doing_command = true; @@ -128,6 +129,14 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, } else if (args[i] == "ERROR_STRIP_TRAILING_WHITESPACE") { doing_command = false; error_strip_trailing_whitespace = true; + } else if (args[i] == "ENCODING") { + doing_command = false; + if (++i < args.size()) { + encoding = cmProcessOutput::FindEncoding(args[i]); + } else { + this->SetError(" called with no value for ENCODING."); + return false; + } } else if (doing_command) { cmds[command_index].push_back(args[i].c_str()); } else { @@ -223,7 +232,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, int length; char* data; int p; - cmProcessOutput processOutput; + cmProcessOutput processOutput(encoding); std::string strdata; while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) { // Put the output in the right place. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 2e5173d..6906a90 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -520,8 +520,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( targetFullPathCompilePDB = this->GeneratorTarget->GetCompilePDBPath(this->ConfigName); if (targetFullPathCompilePDB.empty()) { + // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`. + // A trailing slash tells the toolchain to add its default file name. targetFullPathCompilePDB = this->GeneratorTarget->GetSupportDirectory() + "/"; + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { + // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`. + targetFullPathCompilePDB += this->GeneratorTarget->GetName(); + targetFullPathCompilePDB += ".pdb"; + } } } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e47de97..8090542 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -359,7 +359,14 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const compilePdbPath = this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); if (compilePdbPath.empty()) { + // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`. + // A trailing slash tells the toolchain to add its default file name. compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/"; + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { + // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`. + compilePdbPath += this->GeneratorTarget->GetName(); + compilePdbPath += ".pdb"; + } } } diff --git a/Source/cmProcessOutput.cxx b/Source/cmProcessOutput.cxx index 1440223..8b4d0e1 100644 --- a/Source/cmProcessOutput.cxx +++ b/Source/cmProcessOutput.cxx @@ -9,6 +9,21 @@ unsigned int cmProcessOutput::defaultCodepage = KWSYS_ENCODING_DEFAULT_CODEPAGE; #endif +cmProcessOutput::Encoding cmProcessOutput::FindEncoding(std::string name) +{ + Encoding encoding = Auto; + if (name == "UTF8") { + encoding = UTF8; + } else if (name == "NONE") { + encoding = None; + } else if (name == "ANSI") { + encoding = ANSI; + } else if (name == "OEM") { + encoding = OEM; + } + return encoding; +} + cmProcessOutput::cmProcessOutput(Encoding encoding, unsigned int maxSize) { #if defined(_WIN32) diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h index 6a4e7d5..6046f57 100644 --- a/Source/cmProcessOutput.h +++ b/Source/cmProcessOutput.h @@ -27,6 +27,13 @@ public: OEM }; + /** + * Find encoding enum value for given encoding \a name. + * \param name a encoding name. + * \return encoding enum value or Auto if \a name was not found. + */ + static Encoding FindEncoding(std::string name); + /// The code page that is used as internal encoding to which we will encode. static unsigned int defaultCodepage; diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 9a06f05..3776538 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -936,7 +936,7 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure( } // Make sure the types of cacheArguments matches (if given): - std::vector<std::string> cacheArgs; + std::vector<std::string> cacheArgs = { "unused" }; bool cacheArgumentsError = false; const Json::Value passedArgs = request.Data[kCACHE_ARGUMENTS_KEY]; if (!passedArgs.isNull()) { diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h index 317cc18..60b4379 100644 --- a/Source/cmVS140CLFlagTable.h +++ b/Source/cmVS140CLFlagTable.h @@ -164,6 +164,8 @@ static cmVS7FlagTable cmVS140CLFlagTable[] = { { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, + { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 }, + { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 }, { "RuntimeTypeInfo", "GR-", "", "false", 0 }, { "RuntimeTypeInfo", "GR", "", "true", 0 }, { "OpenMPSupport", "openmp-", "", "false", 0 }, diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h index 895b3e8..f751fc8 100644 --- a/Source/cmVS141CLFlagTable.h +++ b/Source/cmVS141CLFlagTable.h @@ -171,6 +171,7 @@ static cmVS7FlagTable cmVS141CLFlagTable[] = { { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, + { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 }, { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 }, { "EnforceTypeConversionRules", "Zc:rvalueCast-", "", "false", 0 }, { "EnforceTypeConversionRules", "Zc:rvalueCast", "", "true", 0 }, diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 22c3024..8ab3b04 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1593,6 +1593,14 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() *this->BuildFileStream << cmVS10EscapeXML(intermediateDir) << "</IntDir>\n"; + if (const char* workingDir = this->GeneratorTarget->GetProperty( + "VS_DEBUGGER_WORKING_DIRECTORY")) { + this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory", + config->c_str(), 3); + *this->BuildFileStream << cmVS10EscapeXML(workingDir) + << "</LocalDebuggerWorkingDirectory>\n"; + } + std::string name = cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull); this->WritePlatformConfigTag("TargetName", config->c_str(), 3); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index dee288c..b8e227f 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -160,7 +160,9 @@ int main(int ac, char const* const* av) #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) // Replace streambuf so we can output Unicode to console cmsys::ConsoleBuf::Manager consoleOut(std::cout); + consoleOut.SetUTF8Pipes(); cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); + consoleErr.SetUTF8Pipes(); #endif cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(ac, av); diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 1acd240..1cf75c8 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -116,7 +116,9 @@ int main(int argc, char const* const* argv) #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) // Replace streambuf so we can output Unicode to console cmsys::ConsoleBuf::Manager consoleOut(std::cout); + consoleOut.SetUTF8Pipes(); cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); + consoleErr.SetUTF8Pipes(); #endif cmsys::Encoding::CommandLineArguments encoding_args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 405917a..d680205 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -31,6 +31,9 @@ create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS}) add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS}) target_link_libraries(CMakeLibTests CMakeLib) +add_executable(testEncoding testEncoding.cxx) +target_link_libraries(testEncoding cmsys) + # Xcode 2.x forgets to create the output directory before linking # the individual architectures. if(CMAKE_OSX_ARCHITECTURES AND XCODE diff --git a/Tests/CMakeLib/testEncoding.cxx b/Tests/CMakeLib/testEncoding.cxx new file mode 100644 index 0000000..88743b0 --- /dev/null +++ b/Tests/CMakeLib/testEncoding.cxx @@ -0,0 +1,49 @@ +#include <fstream> +#include <iostream> +#include <string> + +#include <cmsys/ConsoleBuf.hxx> + +#ifdef _WIN32 +void setEncoding(cmsys::ConsoleBuf::Manager& buf, UINT codepage) +{ + cmsys::ConsoleBuf* cb = buf.GetConsoleBuf(); + if (cb) { + cb->input_pipe_codepage = codepage; + cb->output_pipe_codepage = codepage; + cb->input_file_codepage = codepage; + cb->output_file_codepage = codepage; + cb->activateCodepageChange(); + } +} +#endif + +int main(int argc, char* argv[]) +{ +#ifdef _WIN32 + cmsys::ConsoleBuf::Manager consoleOut(std::cout); +#endif + if (argc <= 2) { + std::cout << "Usage: testEncoding <encoding> <file>" << std::endl; + return 1; + } + const std::string encoding(argv[1]); +#ifdef _WIN32 + if (encoding == "UTF8") { + setEncoding(consoleOut, CP_UTF8); + } else if (encoding == "ANSI") { + setEncoding(consoleOut, CP_ACP); + } else if (encoding == "OEM") { + setEncoding(consoleOut, CP_OEMCP); + } // else AUTO +#endif + std::ifstream file(argv[2]); + if (!file.is_open()) { + std::cout << "Failed to open file: " << argv[2] << std::endl; + return 2; + } + std::string text((std::istreambuf_iterator<char>(file)), + std::istreambuf_iterator<char>()); + std::cout << text; + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 9dc540f..c02b917 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -179,6 +179,9 @@ add_RunCMake_test(add_custom_target) add_RunCMake_test(add_dependencies) add_RunCMake_test(add_subdirectory) add_RunCMake_test(build_command) +if(NOT CMake_TEST_EXTERNAL_CMAKE) + set(execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>) +endif() add_RunCMake_test(execute_process) add_RunCMake_test(export) add_RunCMake_test(cmake_minimum_required) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 247855a..6cc3054 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -75,6 +75,7 @@ function(run_cmake test) OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result + ENCODING UTF8 ${maybe_timeout} ) else() @@ -90,6 +91,7 @@ function(run_cmake test) OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result + ENCODING UTF8 ${maybe_timeout} ) endif() diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index d913af7..bc1ec97 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -2,3 +2,4 @@ include(RunCMake) run_cmake(VsConfigurationType) run_cmake(VsTargetsFileReferences) run_cmake(VsCustomProps) +run_cmake(VsDebuggerWorkingDir) diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake new file mode 100644 index 0000000..637c68c --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake @@ -0,0 +1,22 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(debuggerWorkDirSet FALSE) + +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<LocalDebuggerWorkingDirectory[^>]*>([^<>]+)</LocalDebuggerWorkingDirectory>$") + if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-directory") + message(STATUS "foo.vcxproj has debugger working dir set") + set(debuggerWorkDirSet TRUE) + endif() + endif() +endforeach() + +if(NOT debuggerWorkDirSet) + set(RunCMake_TEST_FAILED "LocalDebuggerWorkingDirectory not found or not set correctly.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake new file mode 100644 index 0000000..a277c65 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake @@ -0,0 +1,5 @@ +enable_language(CXX) +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + VS_DEBUGGER_WORKING_DIRECTORY "my-debugger-directory") diff --git a/Tests/RunCMake/execute_process/CMakeLists.txt b/Tests/RunCMake/execute_process/CMakeLists.txt new file mode 100644 index 0000000..a640c56 --- /dev/null +++ b/Tests/RunCMake/execute_process/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.7) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/execute_process/Encoding.cmake b/Tests/RunCMake/execute_process/Encoding.cmake new file mode 100644 index 0000000..3dc7c39 --- /dev/null +++ b/Tests/RunCMake/execute_process/Encoding.cmake @@ -0,0 +1,6 @@ +execute_process( + COMMAND ${TEST_ENCODING_EXE} ${TEST_ENCODING} ${CMAKE_CURRENT_LIST_DIR}/EncodingUTF8-stderr.txt + OUTPUT_VARIABLE out + ENCODING ${TEST_ENCODING} + ) +message("${out}") diff --git a/Tests/RunCMake/execute_process/EncodingMissing-result.txt b/Tests/RunCMake/execute_process/EncodingMissing-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingMissing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/execute_process/EncodingMissing-stderr.txt b/Tests/RunCMake/execute_process/EncodingMissing-stderr.txt new file mode 100644 index 0000000..1a69579 --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingMissing-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at EncodingMissing.cmake:[0-9]+ \(execute_process\): + execute_process called with no value for ENCODING. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/execute_process/EncodingMissing.cmake b/Tests/RunCMake/execute_process/EncodingMissing.cmake new file mode 100644 index 0000000..ae97480 --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingMissing.cmake @@ -0,0 +1 @@ +execute_process(ENCODING) diff --git a/Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt b/Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt new file mode 100644 index 0000000..0ac68de --- /dev/null +++ b/Tests/RunCMake/execute_process/EncodingUTF8-stderr.txt @@ -0,0 +1 @@ +यूनिकोड είναι very здорово! diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake index 2080437..62e18c6 100644 --- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake +++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake @@ -6,3 +6,8 @@ unset(RunCMake_TEST_OUTPUT_MERGE) run_cmake_command(MergeOutputFile ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/MergeOutputFile.cmake) run_cmake_command(MergeOutputVars ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/MergeOutputVars.cmake) + +run_cmake(EncodingMissing) +if(TEST_ENCODING_EXE) + run_cmake_command(EncodingUTF8 ${CMAKE_COMMAND} -DTEST_ENCODING=UTF8 -DTEST_ENCODING_EXE=${TEST_ENCODING_EXE} -P ${RunCMake_SOURCE_DIR}/Encoding.cmake) +endif() |