diff options
64 files changed, 1198 insertions, 90 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/cpack-rpm-user-file-list-with-multiple-directives.rst b/Help/release/dev/cpack-rpm-user-file-list-with-multiple-directives.rst new file mode 100644 index 0000000..ad0154d --- /dev/null +++ b/Help/release/dev/cpack-rpm-user-file-list-with-multiple-directives.rst @@ -0,0 +1,6 @@ +cpack-rpm-user-file-list-with-multiple-directives +------------------------------------------------- + +* The :module:`CPackRPM` module learned to support + multiple directives per file when using + :variable:`CPACK_RPM_USER_FILELIST` variable. 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/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index deb10fb..4162726 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -9,7 +9,13 @@ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) # prefer the environment variable ASM if(NOT $ENV{ASM${ASM_DIALECT}} STREQUAL "") - set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}") + get_filename_component(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT $ENV{ASM${ASM_DIALECT}} PROGRAM PROGRAM_ARGS CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT) + if(CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT}" CACHE STRING "First argument to ASM${ASM_DIALECT} compiler") + endif() + if(NOT EXISTS ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT}) + message(FATAL_ERROR "Could not find compiler set in environment variable ASM${ASM_DIALECT}:\n$ENV{ASM${ASM_DIALECT}}.") + endif() endif() # finally list compilers to try diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 39697f0..5021c41 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -507,10 +507,12 @@ # # May be used to explicitly specify ``%(<directive>)`` file line # in the spec file. Like ``%config(noreplace)`` or any other directive -# that be found in the ``%files`` section. Since CPackRPM is generating -# the list of files (and directories) the user specified files of -# the ``CPACK_RPM_<COMPONENT>_USER_FILELIST`` list will be removed from -# the generated list. +# that be found in the ``%files`` section. You can have multiple directives +# per line, as in ``%attr(600,root,root) %config(noreplace)``. Since +# CPackRPM is generating the list of files (and directories) the user +# specified files of the ``CPACK_RPM_<COMPONENT>_USER_FILELIST`` list will +# be removed from the generated list. If referring to directories do +# not add a trailing slash. # # .. variable:: CPACK_RPM_CHANGELOG_FILE # @@ -2055,7 +2057,8 @@ function(cpack_rpm_generate_package) set(CPACK_RPM_USER_INSTALL_FILES "") foreach(F IN LISTS CPACK_RPM_USER_FILELIST_INTERNAL) string(REGEX REPLACE "%[A-Za-z]+(\\([^()]*\\))? " "" F_PATH ${F}) - string(REGEX MATCH "%[A-Za-z]+(\\([^()]*\\))?" F_PREFIX ${F}) + string(REGEX MATCH "(%[A-Za-z]+(\\([^()]*\\))? )*" F_PREFIX ${F}) + string(STRIP ${F_PREFIX} F_PREFIX) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: F_PREFIX=<${F_PREFIX}>, F_PATH=<${F_PATH}>") 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/Packaging/QtSDK/ToolsCMakeXX.cmake b/Packaging/QtSDK/ToolsCMakeXX.cmake new file mode 100644 index 0000000..e227b73 --- /dev/null +++ b/Packaging/QtSDK/ToolsCMakeXX.cmake @@ -0,0 +1,68 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# CMake version +include("${CMAKE_CURRENT_LIST_DIR}/../../Source/CMakeVersion.cmake") +set(CM_VER_XY ${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}) +set(CM_VER_X_Y ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}) +set(CM_VER_X_Y_Z ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATH}) + +# Destiantion +set(CM_INST_PREF "Tools/CMake/${CM_VER_X_Y}") +set(CMAKE_BIN_DIR "${CM_INST_PREF}/bin" + CACHE STRING "Location under install bin") +set(CMAKE_DATA_DIR "${CM_INST_PREF}/share/cmake-${CM_VER_X_Y}" + CACHE STRING "Location under install data") +set(CMAKE_DOC_DIR "${CM_INST_PREF}/doc/cmake-${CM_VER_X_Y}" + CACHE STRING "Location under install docs") +set(CMAKE_MAN_DIR "${CM_INST_PREF}/man" + CACHE STRING "Location under install man pages") +set(CMAKE_XDGDATA_DIR "${CM_INST_PREF}/share" + CACHE STRING "Location under install XDG specific files") + +# Package +set(CMake_IFW_ROOT_COMPONENT_NAME + "qt.tools.cmake.${CM_VER_XY}" + CACHE STRING "QtSDK CMake tools component name") +set(CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME + "CMake ${CM_VER_X_Y}" + CACHE STRING "QtSDK CMake tools component display name") +set(CMake_IFW_ROOT_COMPONENT_DESCRIPTION + "CMake Build Tools ${CM_VER_X_Y_Z}" + CACHE STRING "QtSDK CMake tools component description") +set(CMake_IFW_ROOT_COMPONENT_SCRIPT + "${CMAKE_CURRENT_BINARY_DIR}/qt.tools.cmake.${CM_VER_XY}.qs" + CACHE STRING "QtSDK CMake tools component display name") +set(CMake_IFW_ROOT_COMPONENT_PRIORITY + "${CM_VER_XY}" + CACHE STRING "QtSDK CMake tools component sorting priority") +set(CMake_IFW_ROOT_COMPONENT_DEFAULT "" + CACHE STRING "QtSDK CMake tools component default") +set(CMake_IFW_ROOT_COMPONENT_FORCED_INSTALLATION "" + CACHE STRING "QtSDK CMake tools component forsed installation") + +# CPack +set(CPACK_GENERATOR "IFW" + CACHE STRING "Generator to build QtSDK CMake package") +set(CPACK_PACKAGE_FILE_NAME "CMake" + CACHE STRING "Short package name") +set(CPACK_TOPLEVEL_TAG "../QtSDK" + CACHE STRING "QtSDK packages dir") +set(CPACK_IFW_DOWNLOAD_ALL "TRUE" + CACHE STRING "All QtSDK components is downloaded") +set(CPACK_DOWNLOAD_SITE "file:///${CMAKE_CURRENT_BINARY_DIR}/QtSDK/IFW/CMake/repository" + CACHE STRING "Local repository for testing") + +# Script +set(SDKToolBinary "@SDKToolBinary@") +set(CM_VER_XY_DIR "@CMAKE${CM_VER_XY}_DIR@") +configure_file("${CMAKE_CURRENT_LIST_DIR}/qt.tools.cmake.xx.qs.in" + "${CMAKE_CURRENT_BINARY_DIR}/qt.tools.cmake.${CM_VER_XY}.qs" + @ONLY) + +# Unset temporary variables +unset(CM_VER_XY) +unset(CM_VER_X_Y) +unset(CM_VER_X_Y_Z) +unset(CM_INST_PREF) +unset(SDKToolBinary) diff --git a/Packaging/QtSDK/qt.tools.cmake.xx.qs.in b/Packaging/QtSDK/qt.tools.cmake.xx.qs.in new file mode 100644 index 0000000..cb42a71 --- /dev/null +++ b/Packaging/QtSDK/qt.tools.cmake.xx.qs.in @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Distributed under the OSI-approved BSD 3-Clause License. See accompanying +** file Copyright.txt or https://cmake.org/licensing for details. +** +****************************************************************************/ + +// constructor +function Component() +{ + installer.valueChanged.connect( this, Component.prototype.reactOnTargetDirChange ); + // set the default values to CMAKE@CM_VER_XY@_DIR + Component.prototype.reactOnTargetDirChange("TargetDir", installer.value("TargetDir")); +} + +Component.prototype.reactOnTargetDirChange = function(key, value) +{ + if (key == "TargetDir") { + var path = value + "/@CM_INST_PREF@"; + installer.setValue("CMAKE@CM_VER_XY@_DIR", path.replace(/\\/g, "/")); + } +} + +Component.prototype.createOperations = function() +{ + component.createOperations(); + + if (installer.value("os") == "win") { + try { + if (installer.value("SDKToolBinary") == "") + return; + + var cmId = component.name; + installer.setValue("CMAKE@CM_VER_XY@_ID", cmId); + + component.addOperation("Execute", + ["{0,2}", "@SDKToolBinary@", "addCMake", + "--id", cmId, + "--name", "@CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME@", + "--path", "@CM_VER_XY_DIR@/bin/cmake.exe", + "UNDOEXECUTE", + "@SDKToolBinary@", "rmCMake", "--id", cmId]); + + } catch( e ) { + print( e ); + } + } +} diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1144390..d7f27be 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 20161130) +set(CMake_VERSION_PATCH 20161205) #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/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index ab43dbc..68f9a54 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -797,8 +797,9 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const // Prepare some maps to help us find setup and cleanup tests for // any given fixture - typedef std::set<ListOfTests::const_iterator> TestIteratorSet; - typedef std::map<std::string, TestIteratorSet> FixtureDependencies; + typedef ListOfTests::const_iterator TestIterator; + typedef std::multimap<std::string, TestIterator> FixtureDependencies; + typedef FixtureDependencies::const_iterator FixtureDepsIterator; FixtureDependencies fixtureSetups; FixtureDependencies fixtureDeps; @@ -809,14 +810,14 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const const std::set<std::string>& setups = p.FixturesSetup; for (std::set<std::string>::const_iterator depsIt = setups.begin(); depsIt != setups.end(); ++depsIt) { - fixtureSetups[*depsIt].insert(it); - fixtureDeps[*depsIt].insert(it); + fixtureSetups.insert(std::make_pair(*depsIt, it)); + fixtureDeps.insert(std::make_pair(*depsIt, it)); } const std::set<std::string>& cleanups = p.FixturesCleanup; for (std::set<std::string>::const_iterator depsIt = cleanups.begin(); depsIt != cleanups.end(); ++depsIt) { - fixtureDeps[*depsIt].insert(it); + fixtureDeps.insert(std::make_pair(*depsIt, it)); } } @@ -859,17 +860,15 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const // associated with the required fixture. If any of those setup // tests fail, this test should not run. We make the fixture's // cleanup tests depend on this test case later. - FixtureDependencies::const_iterator setupIt = - fixtureSetups.find(requiredFixtureName); - if (setupIt != fixtureSetups.end()) { - for (TestIteratorSet::const_iterator sIt = setupIt->second.begin(); - sIt != setupIt->second.end(); ++sIt) { - const std::string& setupTestName = (**sIt).Name; - tests[i].RequireSuccessDepends.insert(setupTestName); - if (std::find(tests[i].Depends.begin(), tests[i].Depends.end(), - setupTestName) == tests[i].Depends.end()) { - tests[i].Depends.push_back(setupTestName); - } + std::pair<FixtureDepsIterator, FixtureDepsIterator> setupRange = + fixtureSetups.equal_range(requiredFixtureName); + for (FixtureDepsIterator sIt = setupRange.first; + sIt != setupRange.second; ++sIt) { + const std::string& setupTestName = sIt->second->Name; + tests[i].RequireSuccessDepends.insert(setupTestName); + if (std::find(tests[i].Depends.begin(), tests[i].Depends.end(), + setupTestName) == tests[i].Depends.end()) { + tests[i].Depends.push_back(setupTestName); } } @@ -882,17 +881,11 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const // Already added this fixture continue; } - FixtureDependencies::const_iterator fixtureIt = - fixtureDeps.find(requiredFixtureName); - if (fixtureIt == fixtureDeps.end()) { - // No setup or cleanup tests for this fixture - continue; - } - - const TestIteratorSet& testIters = fixtureIt->second; - for (TestIteratorSet::const_iterator depsIt = testIters.begin(); - depsIt != testIters.end(); ++depsIt) { - ListOfTests::const_iterator lotIt = *depsIt; + std::pair<FixtureDepsIterator, FixtureDepsIterator> fixtureRange = + fixtureDeps.equal_range(requiredFixtureName); + for (FixtureDepsIterator it = fixtureRange.first; + it != fixtureRange.second; ++it) { + ListOfTests::const_iterator lotIt = it->second; const cmCTestTestProperties& p = *lotIt; if (!addedTests.insert(p.Name).second) { 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/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx index c34751a..2f1df4f 100644 --- a/Source/QtDialog/FirstConfigure.cxx +++ b/Source/QtDialog/FirstConfigure.cxx @@ -56,7 +56,7 @@ QFrame* StartCompilerSetup::CreateToolsetWidgets() QVBoxLayout* l = new QVBoxLayout(frame); l->setContentsMargins(0, 0, 0, 0); - ToolsetLabel = new QLabel(tr("Optional toolset to use (-T parameter)")); + ToolsetLabel = new QLabel(tr("Optional toolset to use (argument to -T)")); l->addWidget(ToolsetLabel); Toolset = new QLineEdit(frame); 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/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index a1af6ff..d992aef 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -9,6 +9,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmVS10CLFlagTable.h" +#include "cmVS10CSharpFlagTable.h" #include "cmVS10LibFlagTable.h" #include "cmVS10LinkFlagTable.h" #include "cmVS10MASMFlagTable.h" @@ -99,6 +100,7 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( this->MSBuildCommandInitialized = false; this->DefaultPlatformToolset = "v100"; this->DefaultClFlagTable = cmVS10CLFlagTable; + this->DefaultCSharpFlagTable = cmVS10CSharpFlagTable; this->DefaultLibFlagTable = cmVS10LibFlagTable; this->DefaultLinkFlagTable = cmVS10LinkFlagTable; this->DefaultMasmFlagTable = cmVS10MASMFlagTable; @@ -626,6 +628,15 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const return (table != CM_NULLPTR) ? table : this->DefaultClFlagTable; } +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable() + const +{ + cmIDEFlagTable const* table = this->ToolsetOptions.GetCSharpFlagTable( + this->GetPlatformName(), this->GetPlatformToolsetString()); + + return (table != CM_NULLPTR) ? table : this->DefaultCSharpFlagTable; +} + cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const { cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable( diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 4175104..5bfaf38 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -91,6 +91,7 @@ public: static std::string GetInstalledNsightTegraVersion(); cmIDEFlagTable const* GetClFlagTable() const; + cmIDEFlagTable const* GetCSharpFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; cmIDEFlagTable const* GetLibFlagTable() const; cmIDEFlagTable const* GetLinkFlagTable() const; @@ -120,6 +121,7 @@ protected: std::string SystemVersion; std::string NsightTegraVersion; cmIDEFlagTable const* DefaultClFlagTable; + cmIDEFlagTable const* DefaultCSharpFlagTable; cmIDEFlagTable const* DefaultLibFlagTable; cmIDEFlagTable const* DefaultLinkFlagTable; cmIDEFlagTable const* DefaultMasmFlagTable; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 049e86e..d37d4b0 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -7,6 +7,7 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmVS11CLFlagTable.h" +#include "cmVS11CSharpFlagTable.h" #include "cmVS11LibFlagTable.h" #include "cmVS11LinkFlagTable.h" #include "cmVS11MASMFlagTable.h" @@ -108,6 +109,7 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( vc11Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v110"; this->DefaultClFlagTable = cmVS11CLFlagTable; + this->DefaultCSharpFlagTable = cmVS11CSharpFlagTable; this->DefaultLibFlagTable = cmVS11LibFlagTable; this->DefaultLinkFlagTable = cmVS11LinkFlagTable; this->DefaultMasmFlagTable = cmVS11MASMFlagTable; diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 0a48ba6..2656dcc 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -7,6 +7,7 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmVS12CLFlagTable.h" +#include "cmVS12CSharpFlagTable.h" #include "cmVS12LibFlagTable.h" #include "cmVS12LinkFlagTable.h" #include "cmVS12MASMFlagTable.h" @@ -90,6 +91,7 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator( vc12Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v120"; this->DefaultClFlagTable = cmVS12CLFlagTable; + this->DefaultCSharpFlagTable = cmVS12CSharpFlagTable; this->DefaultLibFlagTable = cmVS12LibFlagTable; this->DefaultLinkFlagTable = cmVS12LinkFlagTable; this->DefaultMasmFlagTable = cmVS12MASMFlagTable; diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index b4cb823..81c305c 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -7,6 +7,7 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmVS140CLFlagTable.h" +#include "cmVS140CSharpFlagTable.h" #include "cmVS14LibFlagTable.h" #include "cmVS14LinkFlagTable.h" #include "cmVS14MASMFlagTable.h" @@ -90,6 +91,7 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator( vc14Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v140"; this->DefaultClFlagTable = cmVS140CLFlagTable; + this->DefaultCSharpFlagTable = cmVS140CSharpFlagTable; this->DefaultLibFlagTable = cmVS14LibFlagTable; this->DefaultLinkFlagTable = cmVS14LinkFlagTable; this->DefaultMasmFlagTable = cmVS14MASMFlagTable; diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index 091a03e..20d30bc 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -7,6 +7,7 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmVS141CLFlagTable.h" +#include "cmVS141CSharpFlagTable.h" static const char vs15generatorName[] = "Visual Studio 15 2017"; @@ -86,6 +87,7 @@ cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator( vc15Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v141"; this->DefaultClFlagTable = cmVS141CLFlagTable; + this->DefaultCSharpFlagTable = cmVS141CSharpFlagTable; this->Version = VS15; } 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..c08a36b 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -672,8 +672,9 @@ static Json::Value DumpSourceFilesList( std::string compileFlags = ld.Flags; if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) { cmGeneratorExpression ge; + auto cge = ge.Parse(cflags); const char* processed = - ge.Parse(cflags)->Evaluate(target->GetLocalGenerator(), config); + cge->Evaluate(target->GetLocalGenerator(), config); lg->AppendFlags(compileFlags, processed); } fileData.Flags = compileFlags; @@ -936,7 +937,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/cmVS10CSharpFlagTable.h b/Source/cmVS10CSharpFlagTable.h new file mode 100644 index 0000000..493ec2b --- /dev/null +++ b/Source/cmVS10CSharpFlagTable.h @@ -0,0 +1,120 @@ +static cmVS7FlagTable cmVS10CSharpFlagTable[] = { + { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, + + { "OutputType", "target:exe", "", "Exe", 0 }, + { "OutputType", "target:winexe", "", "Winexe", 0 }, + { "OutputType", "target:library", "", "Library", 0 }, + { "OutputType", "target:module", "", "Module", 0 }, + + { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, + + { "Platform", "platform:x86", "", "x86", 0 }, + { "Platform", "platform:Itanium", "", "Itanium", 0 }, + { "Platform", "platform:x64", "", "x64", 0 }, + { "Platform", "platform:arm", "", "arm", 0 }, + { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", + 0 }, + { "Platform", "platform:anycpu", "", "anycpu", 0 }, + + { "References", "reference:", "mit alias", "", 0 }, + { "References", "reference:", "dateiliste", "", 0 }, + { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, + { "", "link", "", "", 0 }, + + { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired }, + { "ApplicationIcon", "win32icon", "", "", + cmIDEFlagTable::UserValueRequired }, + + { "Win32Manifest", "win32manifest:", "", "true", 0 }, + + { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, + + { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, + + { "DebugSymbols", "debug", "", "true", 0 }, + { "DebugSymbols", "debug-", "", "false", 0 }, + { "DebugSymbols", "debug+", "", "true", 0 }, + + { "DebugType", "debug:none", "", "none", 0 }, + { "DebugType", "debug:full", "", "full", 0 }, + { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, + + { "Optimize", "optimize", "", "true", 0 }, + { "Optimize", "optimize-", "", "false", 0 }, + { "Optimize", "optimize+", "", "true", 0 }, + + { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, + { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, + { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, + + { "WarningsAsErrors", "warnaserror", "", "", 0 }, + { "WarningsAsErrors", "warnaserror-", "", "", 0 }, + { "WarningsAsErrors", "warnaserror+", "", "", 0 }, + + { "WarningLevel", "warn:0", "", "0", 0 }, + { "WarningLevel", "warn:1", "", "1", 0 }, + { "WarningLevel", "warn:2", "", "2", 0 }, + { "WarningLevel", "warn:3", "", "3", 0 }, + { "WarningLevel", "warn:4", "", "4", 0 }, + { "DisabledWarnings", "nowarn", "", "", 0 }, + + { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, + { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, + { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, + + { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, + { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, + { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, + + { "DefineConstants", "define:", "", "", + cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, + + { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, + { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, + { "LangVersion", "langversion:3", "", "3", 0 }, + { "LangVersion", "langversion:4", "", "4", 0 }, + { "LangVersion", "langversion:5", "", "5", 0 }, + { "LangVersion", "langversion:6", "", "6", 0 }, + { "LangVersion", "langversion:default", "", "default", 0 }, + + { "DelaySign", "delaysign", "", "true", 0 }, + { "DelaySign", "delaysign-", "", "false", 0 }, + { "DelaySign", "delaysign+", "", "true", 0 }, + + { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, + + { "KeyContainerName", "keycontainer", "", "", 0 }, + + { "NoLogo", "nologo", "", "", 0 }, + + { "NoConfig", "noconfig", "", "true", 0 }, + + { "BaseAddress", "baseaddress:", "", "", 0 }, + + { "CodePage", "codepage", "", "", 0 }, + + { "Utf8Output", "utf8output", "", "", 0 }, + + { "MainEntryPoint", "main:", "", "", 0 }, + + { "GenerateFullPaths", "fullpaths", "", "true", 0 }, + + { "FileAlignment", "filealign", "", "", 0 }, + + { "PdbFile", "pdb:", "", "", 0 }, + + { "NoStandardLib", "nostdlib", "", "true", 0 }, + { "NoStandardLib", "nostdlib-", "", "false", 0 }, + { "NoStandardLib", "nostdlib+", "", "true", 0 }, + + { "SubsystemVersion", "subsystemversion", "", "", 0 }, + + { "AdditionalLibPaths", "lib:", "", "", 0 }, + + { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, + { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, + { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, + { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, + + { 0, 0, 0, 0, 0 }, +}; diff --git a/Source/cmVS11CSharpFlagTable.h b/Source/cmVS11CSharpFlagTable.h new file mode 100644 index 0000000..71870b6 --- /dev/null +++ b/Source/cmVS11CSharpFlagTable.h @@ -0,0 +1,120 @@ +static cmVS7FlagTable cmVS11CSharpFlagTable[] = { + { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, + + { "OutputType", "target:exe", "", "Exe", 0 }, + { "OutputType", "target:winexe", "", "Winexe", 0 }, + { "OutputType", "target:library", "", "Library", 0 }, + { "OutputType", "target:module", "", "Module", 0 }, + + { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, + + { "Platform", "platform:x86", "", "x86", 0 }, + { "Platform", "platform:Itanium", "", "Itanium", 0 }, + { "Platform", "platform:x64", "", "x64", 0 }, + { "Platform", "platform:arm", "", "arm", 0 }, + { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", + 0 }, + { "Platform", "platform:anycpu", "", "anycpu", 0 }, + + { "References", "reference:", "mit alias", "", 0 }, + { "References", "reference:", "dateiliste", "", 0 }, + { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, + { "", "link", "", "", 0 }, + + { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired }, + { "ApplicationIcon", "win32icon", "", "", + cmIDEFlagTable::UserValueRequired }, + + { "Win32Manifest", "win32manifest:", "", "true", 0 }, + + { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, + + { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, + + { "DebugSymbols", "debug", "", "true", 0 }, + { "DebugSymbols", "debug-", "", "false", 0 }, + { "DebugSymbols", "debug+", "", "true", 0 }, + + { "DebugType", "debug:none", "", "none", 0 }, + { "DebugType", "debug:full", "", "full", 0 }, + { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, + + { "Optimize", "optimize", "", "true", 0 }, + { "Optimize", "optimize-", "", "false", 0 }, + { "Optimize", "optimize+", "", "true", 0 }, + + { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, + { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, + { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, + + { "WarningsAsErrors", "warnaserror", "", "", 0 }, + { "WarningsAsErrors", "warnaserror-", "", "", 0 }, + { "WarningsAsErrors", "warnaserror+", "", "", 0 }, + + { "WarningLevel", "warn:0", "", "0", 0 }, + { "WarningLevel", "warn:1", "", "1", 0 }, + { "WarningLevel", "warn:2", "", "2", 0 }, + { "WarningLevel", "warn:3", "", "3", 0 }, + { "WarningLevel", "warn:4", "", "4", 0 }, + { "DisabledWarnings", "nowarn", "", "", 0 }, + + { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, + { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, + { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, + + { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, + { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, + { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, + + { "DefineConstants", "define:", "", "", + cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, + + { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, + { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, + { "LangVersion", "langversion:3", "", "3", 0 }, + { "LangVersion", "langversion:4", "", "4", 0 }, + { "LangVersion", "langversion:5", "", "5", 0 }, + { "LangVersion", "langversion:6", "", "6", 0 }, + { "LangVersion", "langversion:default", "", "default", 0 }, + + { "DelaySign", "delaysign", "", "true", 0 }, + { "DelaySign", "delaysign-", "", "false", 0 }, + { "DelaySign", "delaysign+", "", "true", 0 }, + + { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, + + { "KeyContainerName", "keycontainer", "", "", 0 }, + + { "NoLogo", "nologo", "", "", 0 }, + + { "NoConfig", "noconfig", "", "true", 0 }, + + { "BaseAddress", "baseaddress:", "", "", 0 }, + + { "CodePage", "codepage", "", "", 0 }, + + { "Utf8Output", "utf8output", "", "", 0 }, + + { "MainEntryPoint", "main:", "", "", 0 }, + + { "GenerateFullPaths", "fullpaths", "", "true", 0 }, + + { "FileAlignment", "filealign", "", "", 0 }, + + { "PdbFile", "pdb:", "", "", 0 }, + + { "NoStandardLib", "nostdlib", "", "true", 0 }, + { "NoStandardLib", "nostdlib-", "", "false", 0 }, + { "NoStandardLib", "nostdlib+", "", "true", 0 }, + + { "SubsystemVersion", "subsystemversion", "", "", 0 }, + + { "AdditionalLibPaths", "lib:", "", "", 0 }, + + { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, + { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, + { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, + { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, + + { 0, 0, 0, 0, 0 }, +}; diff --git a/Source/cmVS12CSharpFlagTable.h b/Source/cmVS12CSharpFlagTable.h new file mode 100644 index 0000000..f98b184 --- /dev/null +++ b/Source/cmVS12CSharpFlagTable.h @@ -0,0 +1,120 @@ +static cmVS7FlagTable cmVS12CSharpFlagTable[] = { + { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, + + { "OutputType", "target:exe", "", "Exe", 0 }, + { "OutputType", "target:winexe", "", "Winexe", 0 }, + { "OutputType", "target:library", "", "Library", 0 }, + { "OutputType", "target:module", "", "Module", 0 }, + + { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, + + { "Platform", "platform:x86", "", "x86", 0 }, + { "Platform", "platform:Itanium", "", "Itanium", 0 }, + { "Platform", "platform:x64", "", "x64", 0 }, + { "Platform", "platform:arm", "", "arm", 0 }, + { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", + 0 }, + { "Platform", "platform:anycpu", "", "anycpu", 0 }, + + { "References", "reference:", "mit alias", "", 0 }, + { "References", "reference:", "dateiliste", "", 0 }, + { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, + { "", "link", "", "", 0 }, + + { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired }, + { "ApplicationIcon", "win32icon", "", "", + cmIDEFlagTable::UserValueRequired }, + + { "Win32Manifest", "win32manifest:", "", "true", 0 }, + + { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, + + { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, + + { "DebugSymbols", "debug", "", "true", 0 }, + { "DebugSymbols", "debug-", "", "false", 0 }, + { "DebugSymbols", "debug+", "", "true", 0 }, + + { "DebugType", "debug:none", "", "none", 0 }, + { "DebugType", "debug:full", "", "full", 0 }, + { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, + + { "Optimize", "optimize", "", "true", 0 }, + { "Optimize", "optimize-", "", "false", 0 }, + { "Optimize", "optimize+", "", "true", 0 }, + + { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, + { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, + { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, + + { "WarningsAsErrors", "warnaserror", "", "", 0 }, + { "WarningsAsErrors", "warnaserror-", "", "", 0 }, + { "WarningsAsErrors", "warnaserror+", "", "", 0 }, + + { "WarningLevel", "warn:0", "", "0", 0 }, + { "WarningLevel", "warn:1", "", "1", 0 }, + { "WarningLevel", "warn:2", "", "2", 0 }, + { "WarningLevel", "warn:3", "", "3", 0 }, + { "WarningLevel", "warn:4", "", "4", 0 }, + { "DisabledWarnings", "nowarn", "", "", 0 }, + + { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, + { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, + { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, + + { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, + { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, + { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, + + { "DefineConstants", "define:", "", "", + cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, + + { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, + { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, + { "LangVersion", "langversion:3", "", "3", 0 }, + { "LangVersion", "langversion:4", "", "4", 0 }, + { "LangVersion", "langversion:5", "", "5", 0 }, + { "LangVersion", "langversion:6", "", "6", 0 }, + { "LangVersion", "langversion:default", "", "default", 0 }, + + { "DelaySign", "delaysign", "", "true", 0 }, + { "DelaySign", "delaysign-", "", "false", 0 }, + { "DelaySign", "delaysign+", "", "true", 0 }, + + { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, + + { "KeyContainerName", "keycontainer", "", "", 0 }, + + { "NoLogo", "nologo", "", "", 0 }, + + { "NoConfig", "noconfig", "", "true", 0 }, + + { "BaseAddress", "baseaddress:", "", "", 0 }, + + { "CodePage", "codepage", "", "", 0 }, + + { "Utf8Output", "utf8output", "", "", 0 }, + + { "MainEntryPoint", "main:", "", "", 0 }, + + { "GenerateFullPaths", "fullpaths", "", "true", 0 }, + + { "FileAlignment", "filealign", "", "", 0 }, + + { "PdbFile", "pdb:", "", "", 0 }, + + { "NoStandardLib", "nostdlib", "", "true", 0 }, + { "NoStandardLib", "nostdlib-", "", "false", 0 }, + { "NoStandardLib", "nostdlib+", "", "true", 0 }, + + { "SubsystemVersion", "subsystemversion", "", "", 0 }, + + { "AdditionalLibPaths", "lib:", "", "", 0 }, + + { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, + { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, + { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, + { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, + + { 0, 0, 0, 0, 0 }, +}; 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/cmVS140CSharpFlagTable.h b/Source/cmVS140CSharpFlagTable.h new file mode 100644 index 0000000..256c35f --- /dev/null +++ b/Source/cmVS140CSharpFlagTable.h @@ -0,0 +1,120 @@ +static cmVS7FlagTable cmVS140CSharpFlagTable[] = { + { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, + + { "OutputType", "target:exe", "", "Exe", 0 }, + { "OutputType", "target:winexe", "", "Winexe", 0 }, + { "OutputType", "target:library", "", "Library", 0 }, + { "OutputType", "target:module", "", "Module", 0 }, + + { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, + + { "Platform", "platform:x86", "", "x86", 0 }, + { "Platform", "platform:Itanium", "", "Itanium", 0 }, + { "Platform", "platform:x64", "", "x64", 0 }, + { "Platform", "platform:arm", "", "arm", 0 }, + { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", + 0 }, + { "Platform", "platform:anycpu", "", "anycpu", 0 }, + + { "References", "reference:", "mit alias", "", 0 }, + { "References", "reference:", "dateiliste", "", 0 }, + { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, + { "", "link", "", "", 0 }, + + { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired }, + { "ApplicationIcon", "win32icon", "", "", + cmIDEFlagTable::UserValueRequired }, + + { "Win32Manifest", "win32manifest:", "", "true", 0 }, + + { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, + + { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, + + { "DebugSymbols", "debug", "", "true", 0 }, + { "DebugSymbols", "debug-", "", "false", 0 }, + { "DebugSymbols", "debug+", "", "true", 0 }, + + { "DebugType", "debug:none", "", "none", 0 }, + { "DebugType", "debug:full", "", "full", 0 }, + { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, + + { "Optimize", "optimize", "", "true", 0 }, + { "Optimize", "optimize-", "", "false", 0 }, + { "Optimize", "optimize+", "", "true", 0 }, + + { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, + { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, + { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, + + { "WarningsAsErrors", "warnaserror", "", "", 0 }, + { "WarningsAsErrors", "warnaserror-", "", "", 0 }, + { "WarningsAsErrors", "warnaserror+", "", "", 0 }, + + { "WarningLevel", "warn:0", "", "0", 0 }, + { "WarningLevel", "warn:1", "", "1", 0 }, + { "WarningLevel", "warn:2", "", "2", 0 }, + { "WarningLevel", "warn:3", "", "3", 0 }, + { "WarningLevel", "warn:4", "", "4", 0 }, + { "DisabledWarnings", "nowarn", "", "", 0 }, + + { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, + { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, + { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, + + { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, + { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, + { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, + + { "DefineConstants", "define:", "", "", + cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, + + { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, + { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, + { "LangVersion", "langversion:3", "", "3", 0 }, + { "LangVersion", "langversion:4", "", "4", 0 }, + { "LangVersion", "langversion:5", "", "5", 0 }, + { "LangVersion", "langversion:6", "", "6", 0 }, + { "LangVersion", "langversion:default", "", "default", 0 }, + + { "DelaySign", "delaysign", "", "true", 0 }, + { "DelaySign", "delaysign-", "", "false", 0 }, + { "DelaySign", "delaysign+", "", "true", 0 }, + + { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, + + { "KeyContainerName", "keycontainer", "", "", 0 }, + + { "NoLogo", "nologo", "", "", 0 }, + + { "NoConfig", "noconfig", "", "true", 0 }, + + { "BaseAddress", "baseaddress:", "", "", 0 }, + + { "CodePage", "codepage", "", "", 0 }, + + { "Utf8Output", "utf8output", "", "", 0 }, + + { "MainEntryPoint", "main:", "", "", 0 }, + + { "GenerateFullPaths", "fullpaths", "", "true", 0 }, + + { "FileAlignment", "filealign", "", "", 0 }, + + { "PdbFile", "pdb:", "", "", 0 }, + + { "NoStandardLib", "nostdlib", "", "true", 0 }, + { "NoStandardLib", "nostdlib-", "", "false", 0 }, + { "NoStandardLib", "nostdlib+", "", "true", 0 }, + + { "SubsystemVersion", "subsystemversion", "", "", 0 }, + + { "AdditionalLibPaths", "lib:", "", "", 0 }, + + { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, + { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, + { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, + { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, + + { 0, 0, 0, 0, 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/cmVS141CSharpFlagTable.h b/Source/cmVS141CSharpFlagTable.h new file mode 100644 index 0000000..8508581 --- /dev/null +++ b/Source/cmVS141CSharpFlagTable.h @@ -0,0 +1,120 @@ +static cmVS7FlagTable cmVS141CSharpFlagTable[] = { + { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, + + { "OutputType", "target:exe", "", "Exe", 0 }, + { "OutputType", "target:winexe", "", "Winexe", 0 }, + { "OutputType", "target:library", "", "Library", 0 }, + { "OutputType", "target:module", "", "Module", 0 }, + + { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, + + { "Platform", "platform:x86", "", "x86", 0 }, + { "Platform", "platform:Itanium", "", "Itanium", 0 }, + { "Platform", "platform:x64", "", "x64", 0 }, + { "Platform", "platform:arm", "", "arm", 0 }, + { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", + 0 }, + { "Platform", "platform:anycpu", "", "anycpu", 0 }, + + { "References", "reference:", "mit alias", "", 0 }, + { "References", "reference:", "dateiliste", "", 0 }, + { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, + { "", "link", "", "", 0 }, + + { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired }, + { "ApplicationIcon", "win32icon", "", "", + cmIDEFlagTable::UserValueRequired }, + + { "Win32Manifest", "win32manifest:", "", "true", 0 }, + + { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, + + { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, + + { "DebugSymbols", "debug", "", "true", 0 }, + { "DebugSymbols", "debug-", "", "false", 0 }, + { "DebugSymbols", "debug+", "", "true", 0 }, + + { "DebugType", "debug:none", "", "none", 0 }, + { "DebugType", "debug:full", "", "full", 0 }, + { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, + + { "Optimize", "optimize", "", "true", 0 }, + { "Optimize", "optimize-", "", "false", 0 }, + { "Optimize", "optimize+", "", "true", 0 }, + + { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, + { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, + { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, + + { "WarningsAsErrors", "warnaserror", "", "", 0 }, + { "WarningsAsErrors", "warnaserror-", "", "", 0 }, + { "WarningsAsErrors", "warnaserror+", "", "", 0 }, + + { "WarningLevel", "warn:0", "", "0", 0 }, + { "WarningLevel", "warn:1", "", "1", 0 }, + { "WarningLevel", "warn:2", "", "2", 0 }, + { "WarningLevel", "warn:3", "", "3", 0 }, + { "WarningLevel", "warn:4", "", "4", 0 }, + { "DisabledWarnings", "nowarn", "", "", 0 }, + + { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, + { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, + { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, + + { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, + { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, + { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, + + { "DefineConstants", "define:", "", "", + cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, + + { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, + { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, + { "LangVersion", "langversion:3", "", "3", 0 }, + { "LangVersion", "langversion:4", "", "4", 0 }, + { "LangVersion", "langversion:5", "", "5", 0 }, + { "LangVersion", "langversion:6", "", "6", 0 }, + { "LangVersion", "langversion:default", "", "default", 0 }, + + { "DelaySign", "delaysign", "", "true", 0 }, + { "DelaySign", "delaysign-", "", "false", 0 }, + { "DelaySign", "delaysign+", "", "true", 0 }, + + { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, + + { "KeyContainerName", "keycontainer", "", "", 0 }, + + { "NoLogo", "nologo", "", "", 0 }, + + { "NoConfig", "noconfig", "", "true", 0 }, + + { "BaseAddress", "baseaddress:", "", "", 0 }, + + { "CodePage", "codepage", "", "", 0 }, + + { "Utf8Output", "utf8output", "", "", 0 }, + + { "MainEntryPoint", "main:", "", "", 0 }, + + { "GenerateFullPaths", "fullpaths", "", "true", 0 }, + + { "FileAlignment", "filealign", "", "", 0 }, + + { "PdbFile", "pdb:", "", "", 0 }, + + { "NoStandardLib", "nostdlib", "", "true", 0 }, + { "NoStandardLib", "nostdlib-", "", "false", 0 }, + { "NoStandardLib", "nostdlib+", "", "true", 0 }, + + { "SubsystemVersion", "subsystemversion", "", "", 0 }, + + { "AdditionalLibPaths", "lib:", "", "", 0 }, + + { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, + { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, + { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, + { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, + + { 0, 0, 0, 0, 0 }, +}; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 5b99007..8ab3b04 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -59,6 +59,16 @@ static bool cmVS10IsTargetsFile(std::string const& path) return cmSystemTools::Strucmp(ext.c_str(), ".targets") == 0; } +static std::string computeProjectFileExtension(cmGeneratorTarget const* t) +{ + std::string res; + res = ".vcxproj"; + if (cmGlobalVisualStudioGenerator::TargetIsCSharpOnly(t)) { + res = ".csproj"; + } + return res; +} + cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( cmGeneratorTarget* target, cmGlobalVisualStudio10Generator* gg) { @@ -79,12 +89,16 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( &this->NsightTegraVersion[0], &this->NsightTegraVersion[1], &this->NsightTegraVersion[2], &this->NsightTegraVersion[3]); this->MSTools = !this->NsightTegra; + this->Managed = false; this->TargetCompileAsWinRT = false; this->BuildFileStream = 0; this->IsMissingFiles = false; this->DefaultArtifactDir = this->LocalGenerator->GetCurrentBinaryDirectory() + std::string("/") + this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); + this->InSourceBuild = + (strcmp(this->Makefile->GetCurrentSourceDirectory(), + this->Makefile->GetCurrentBinaryDirectory()) == 0); } cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator() @@ -101,7 +115,7 @@ cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator() return; } if (this->BuildFileStream->Close()) { - this->GlobalGenerator->FileReplacedDuringGenerate(this->PathToVcxproj); + this->GlobalGenerator->FileReplacedDuringGenerate(this->PathToProjectFile); } delete this->BuildFileStream; } @@ -152,11 +166,20 @@ void cmVisualStudio10TargetGenerator::Generate() this->GeneratorTarget->GetProperty("EXTERNAL_MSPROJECT")) { return; } + this->ProjectFileExtension = + computeProjectFileExtension(this->GeneratorTarget); + if (this->ProjectFileExtension == ".vcxproj") { + this->ProjectType = vcxproj; + this->Managed = false; + } else if (this->ProjectFileExtension == ".csproj") { + this->ProjectType = csproj; + this->Managed = true; + } // Tell the global generator the name of the project file this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME", this->Name.c_str()); - this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME_EXT", - ".vcxproj"); + this->GeneratorTarget->Target->SetProperty( + "GENERATOR_FILE_NAME_EXT", this->ProjectFileExtension.c_str()); if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) { if (!this->ComputeClOptions()) { return; @@ -177,9 +200,9 @@ void cmVisualStudio10TargetGenerator::Generate() std::string path = this->LocalGenerator->GetCurrentBinaryDirectory(); path += "/"; path += this->Name; - path += ".vcxproj"; + path += this->ProjectFileExtension; this->BuildFileStream = new cmGeneratedFileStream(path.c_str()); - this->PathToVcxproj = path; + this->PathToProjectFile = path; this->BuildFileStream->SetCopyIfDifferent(true); // Write the encoding header into the file @@ -871,7 +894,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups() std::string path = this->LocalGenerator->GetCurrentBinaryDirectory(); path += "/"; path += this->Name; - path += ".vcxproj.filters"; + path += computeProjectFileExtension(this->GeneratorTarget); + path += ".filters"; cmGeneratedFileStream fout(path.c_str()); fout.SetCopyIfDifferent(true); char magic[] = { char(0xEF), char(0xBB), char(0xBF) }; @@ -1569,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); @@ -1739,6 +1771,15 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( } } + if (csproj != this->ProjectType && clOptions.IsManaged()) { + this->Managed = true; + std::string managedType = clOptions.GetFlag("CompileAsManaged"); + if (managedType == "Safe") { + // force empty calling convention if safe clr is used + clOptions.AddFlag("CallingConvention", ""); + } + } + this->ClOptions[configName] = pOptions.release(); return true; } @@ -2650,8 +2691,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() path = lg->GetCurrentBinaryDirectory(); path += "/"; path += dt->GetName(); - path += ".vcxproj"; + path += computeProjectFileExtension(dt); } + this->ConvertToWindowsSlash(path); (*this->BuildFileStream) << cmVS10EscapeXML(path) << "\">\n"; this->WriteString("<Project>", 3); (*this->BuildFileStream) << this->GlobalGenerator->GetGUID(name.c_str()) diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a4e3adb..e68bf1a 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -145,7 +145,14 @@ private: OptionsMap RcOptions; OptionsMap MasmOptions; OptionsMap LinkOptions; - std::string PathToVcxproj; + std::string PathToProjectFile; + std::string ProjectFileExtension; + enum VsProjectType + { + vcxproj, + csproj + } ProjectType; + bool InSourceBuild; std::vector<std::string> Configurations; std::vector<TargetsFileAndConfigs> TargetsFileAndConfigsVec; cmGeneratorTarget* GeneratorTarget; @@ -154,6 +161,7 @@ private: std::string GUID; std::string Name; bool MSTools; + bool Managed; bool NsightTegra; int NsightTegraVersion[4]; bool TargetCompileAsWinRT; diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx index b928f43..afca216 100644 --- a/Source/cmVisualStudio10ToolsetOptions.cxx +++ b/Source/cmVisualStudio10ToolsetOptions.cxx @@ -7,22 +7,27 @@ #include "cmVisualStudioGeneratorOptions.h" #include "cmVS10CLFlagTable.h" +#include "cmVS10CSharpFlagTable.h" #include "cmVS10LibFlagTable.h" #include "cmVS10LinkFlagTable.h" #include "cmVS10MASMFlagTable.h" #include "cmVS10RCFlagTable.h" #include "cmVS11CLFlagTable.h" +#include "cmVS11CSharpFlagTable.h" #include "cmVS11LibFlagTable.h" #include "cmVS11LinkFlagTable.h" #include "cmVS11MASMFlagTable.h" #include "cmVS11RCFlagTable.h" #include "cmVS12CLFlagTable.h" +#include "cmVS12CSharpFlagTable.h" #include "cmVS12LibFlagTable.h" #include "cmVS12LinkFlagTable.h" #include "cmVS12MASMFlagTable.h" #include "cmVS12RCFlagTable.h" #include "cmVS140CLFlagTable.h" +#include "cmVS140CSharpFlagTable.h" #include "cmVS141CLFlagTable.h" +#include "cmVS141CSharpFlagTable.h" #include "cmVS14LibFlagTable.h" #include "cmVS14LinkFlagTable.h" #include "cmVS14MASMFlagTable.h" @@ -48,6 +53,26 @@ cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetClFlagTable( } } +cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetCSharpFlagTable( + std::string const& name, std::string const& toolset) const +{ + std::string const useToolset = this->GetToolsetName(name, toolset); + + if ((useToolset == "v141")) { + return cmVS141CSharpFlagTable; + } else if (useToolset == "v140") { + return cmVS140CSharpFlagTable; + } else if (useToolset == "v120") { + return cmVS12CSharpFlagTable; + } else if (useToolset == "v110") { + return cmVS11CSharpFlagTable; + } else if (useToolset == "v100") { + return cmVS10CSharpFlagTable; + } else { + return 0; + } +} + cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetRcFlagTable( std::string const& name, std::string const& toolset) const { diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h index bb0be15..2459f5e 100644 --- a/Source/cmVisualStudio10ToolsetOptions.h +++ b/Source/cmVisualStudio10ToolsetOptions.h @@ -19,6 +19,8 @@ class cmVisualStudio10ToolsetOptions public: cmIDEFlagTable const* GetClFlagTable(std::string const& name, std::string const& toolset) const; + cmIDEFlagTable const* GetCSharpFlagTable(std::string const& name, + std::string const& toolset) const; cmIDEFlagTable const* GetRcFlagTable(std::string const& name, std::string const& toolset) const; cmIDEFlagTable const* GetLibFlagTable(std::string const& name, 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/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 092fb47..3077340 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -22,3 +22,4 @@ run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM") run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") +run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake new file mode 100644 index 0000000..aabe537 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr/one;/usr/one/foo.txt;/usr/one/two;/usr/one/two/bar.txt;/usr/three;/usr/three/baz.txt;/usr/three/qux.txt") diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake new file mode 100644 index 0000000..57444ed --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake @@ -0,0 +1,12 @@ +execute_process(COMMAND ${RPM_EXECUTABLE} -qpd ${FOUND_FILE_1} + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE DOC_FILES_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + +string(REPLACE "\n" ";" DOC_FILES_ "${DOC_FILES_}") + +set(DOC_FILES_WANTED_ "/usr/one/foo.txt;/usr/one/two/bar.txt;/usr/three/baz.txt") +if (NOT "${DOC_FILES_}" STREQUAL "${DOC_FILES_WANTED_}") + message(FATAL_ERROR "USER_FILELIST handling error: Check filelist in spec file. Doc files were: ${DOC_FILES_}. Should have been ${DOC_FILES_WANTED_}") +endif() diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake new file mode 100644 index 0000000..acfee42 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake @@ -0,0 +1,13 @@ +install(FILES CMakeLists.txt DESTINATION one RENAME foo.txt) +install(FILES CMakeLists.txt DESTINATION one/two RENAME bar.txt) +install(FILES CMakeLists.txt DESTINATION three RENAME baz.txt) +install(FILES CMakeLists.txt DESTINATION three RENAME qux.txt) + +# We are verifying the USER_FILELIST works by comparing what +# ends up with a %doc tag in the final rpm with what we expect +# from this USER_FILELIST. +set(CPACK_RPM_USER_FILELIST + "%doc /usr/one/foo.txt" + "%doc %attr(640,root,root) /usr/one/two/bar.txt" + "%attr(600, -, root) %doc /usr/three/baz.txt" +) 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() |