diff options
-rw-r--r-- | Help/manual/cpack.1.rst | 123 | ||||
-rw-r--r-- | Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst | 3 | ||||
-rw-r--r-- | Help/release/dev/vs-shader-generator-expressions.rst | 8 | ||||
-rw-r--r-- | Modules/CPack.cmake | 15 | ||||
-rw-r--r-- | Modules/CPackDeb.cmake | 6 | ||||
-rw-r--r-- | Modules/CPackRPM.cmake | 4 | ||||
-rw-r--r-- | Modules/FindJNI.cmake | 18 | ||||
-rw-r--r-- | Modules/FindJava.cmake | 20 | ||||
-rw-r--r-- | Modules/readme.txt | 2 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 20 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 3 | ||||
-rw-r--r-- | Source/cmPolicies.h | 4 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 39 |
14 files changed, 162 insertions, 105 deletions
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst index 105bb67..87aa38d 100644 --- a/Help/manual/cpack.1.rst +++ b/Help/manual/cpack.1.rst @@ -8,92 +8,85 @@ Synopsis .. parsed-literal:: - cpack -G <generator> [<options>] + cpack [<options>] Description =========== -The "cpack" executable is the CMake packaging program. -CMake-generated build trees created for projects that use the -INSTALL_* commands have packaging support. This program will generate -the package. - -CMake is a cross-platform build system generator. Projects specify -their build process with platform-independent CMake listfiles included -in each directory of a source tree with the name CMakeLists.txt. -Users build a project by using CMake to generate a build system for a -native tool on their platform. +The ``cpack`` executable is the CMake packaging program. +CMake projects use :command:`install` commands to define the contents of +packages which can be generated in various formats by this tool. +The :module:`CPack` module greatly simplifies the creation of the input file +used by ``cpack``, allowing most aspects of the packaging configuration to be +controlled directly from the CMake project's own ``CMakeLists.txt`` files. Options ======= -``-G <generator>`` - Use the specified generator to generate package. - - CPack may support multiple native packaging systems on certain - platforms. A generator is responsible for generating input files - for particular system and invoking that systems. Possible generator - names are specified in the Generators section. +``-G <generators>`` + ``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>` + of generator names. ``cpack`` will iterate through this list and produce + package(s) in that generator's format according to the details provided in + the ``CPackConfig.cmake`` configuration file. A generator is responsible for + generating the required inputs for a particular package system and invoking + that system's package creation tools. Possible generator names are specified + in the :manual:`Generators <cmake-generators(7)>` section of the manual and + the ``--help`` option lists the generators supported for the target platform. + If this option is not given, the :variable:`CPACK_GENERATOR` variable + determines the default set of generators that will be used. ``-C <Configuration>`` - Specify the project configuration - - This option specifies the configuration that the project was build - with, for example 'Debug', 'Release'. + Specify the project configuration to be packaged (e.g. ``Debug``, + ``Release``, etc.). When the CMake project uses a multi-configuration + generator such as Xcode or Visual Studio, this option is needed to tell + ``cpack`` which built executables to include in the package. ``-D <var>=<value>`` - Set a CPack variable. - - Set a variable that can be used by the generator. + Set a CPack variable. This will override any value set for ``<var>`` in the + input file read by ``cpack``. -``--config <config file>`` - Specify the config file. - - Specify the config file to use to create the package. By default - CPackConfig.cmake in the current directory will be used. +``--config <configFile>`` + Specify the configuration file read by ``cpack`` to provide the packaging + details. By default, ``CPackConfig.cmake`` in the current directory will + be used. ``--verbose,-V`` - enable verbose output - - Run cpack with verbose output. + Run ``cpack`` with verbose output. This can be used to show more details + from the package generation tools and is suitable for project developers. ``--debug`` - enable debug output (for CPack developers) - - Run cpack with debug output (for CPack developers). + Run ``cpack`` with debug output. This option is intended mainly for the + developers of ``cpack`` itself and is not normally needed by project + developers. ``--trace`` - Put underlying cmake scripts in trace mode. + Put the underlying cmake scripts in trace mode. ``--trace-expand`` - Put underlying cmake scripts in expanded trace mode. - -``-P <package name>`` - override/define CPACK_PACKAGE_NAME - - If the package name is not specified on cpack command line - thenCPack.cmake defines it as CMAKE_PROJECT_NAME - -``-R <package version>`` - override/define CPACK_PACKAGE_VERSION - - If version is not specified on cpack command line thenCPack.cmake - defines it from CPACK_PACKAGE_VERSION_[MAJOR|MINOR|PATCH]look into - CPack.cmake for detail - -``-B <package directory>`` - override/define CPACK_PACKAGE_DIRECTORY - - The directory where CPack will be doing its packaging work.The - resulting package will be found there. Inside this directoryCPack - creates '_CPack_Packages' sub-directory which is theCPack temporary - directory. - -``--vendor <vendor name>`` - override/define CPACK_PACKAGE_VENDOR - - If vendor is not specified on cpack command line (or inside - CMakeLists.txt) thenCPack.cmake defines it with a default value + Put the underlying cmake scripts in expanded trace mode. + +``-P <packageName>`` + Override/define the value of the :variable:`CPACK_PACKAGE_NAME` variable used + for packaging. Any value set for this variable in the ``CPackConfig.cmake`` + file will then be ignored. + +``-R <packageVersion>`` + Override/define the value of the :variable:`CPACK_PACKAGE_VERSION` + variable used for packaging. It will override a value set in the + ``CPackConfig.cmake`` file or one automatically computed from + :variable:`CPACK_PACKAGE_VERSION_MAJOR`, + :variable:`CPACK_PACKAGE_VERSION_MINOR` and + :variable:`CPACK_PACKAGE_VERSION_PATCH`. + +``-B <packageDirectory>`` + Override/define :variable:`CPACK_PACKAGE_DIRECTORY`, which controls the + directory where CPack will perform its packaging work. The resultant + package(s) will be created at this location by default and a + ``_CPack_Packages`` subdirectory will also be created below this directory to + use as a working area during package creation. + +``--vendor <vendorName>`` + Override/define :variable:`CPACK_PACKAGE_VENDOR`. .. include:: OPTIONS_HELP.txt diff --git a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst index 28517e6..052ac6d 100644 --- a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst +++ b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst @@ -16,4 +16,7 @@ Supported values: ``""``, ``"pure"``, ``"safe"`` This property is only evaluated :ref:`Visual Studio Generators` for VS 2010 and above. +To be able to build managed C++ targets with VS 2017 and above the component +``C++/CLI support`` must be installed, which may not be done by default. + See also :prop_tgt:`IMPORTED_COMMON_LANGUAGE_RUNTIME` diff --git a/Help/release/dev/vs-shader-generator-expressions.rst b/Help/release/dev/vs-shader-generator-expressions.rst new file mode 100644 index 0000000..085be23 --- /dev/null +++ b/Help/release/dev/vs-shader-generator-expressions.rst @@ -0,0 +1,8 @@ +vs-shader-generator-expressions +------------------------------- + +* Added support for generator expressions for the following source file + properties: + + - :prop_sf:`VS_SHADER_DISABLE_OPTIMIZATIONS` + - :prop_sf:`VS_SHADER_ENABLE_DEBUG` diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 3ff8be6..a71f84a 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -43,9 +43,9 @@ # # * cpack runs # * it includes CPackConfig.cmake -# * it iterates over the generators listed in that file's -# CPACK_GENERATOR list variable (unless told to use just a -# specific one via -G on the command line...) +# * it iterates over the generators given by the ``-G`` command line option, +# or if no such option was specified, over the list of generators given by +# the CPACK_GENERATOR variable set in the CPackConfig.cmake input file. # * foreach generator, it then # # - sets CPACK_GENERATOR to the one currently being iterated @@ -182,12 +182,11 @@ # # .. variable:: CPACK_GENERATOR # -# List of CPack generators to use. If not specified, CPack will create a +# List of CPack generators to use. If not specified, CPack will create a # set of options CPACK_BINARY_<GENNAME> (e.g., CPACK_BINARY_NSIS) allowing -# the user to enable/disable individual generators. This variable may be -# used on the command line as well as in:: -# -# cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree +# the user to enable/disable individual generators. If the ``-G`` option +# is given on the :manual:`cpack <cpack(1)>` command line, it will override +# this variable and any CPACK_BINARY_<GENNAME> options. # # .. variable:: CPACK_OUTPUT_CONFIG_FILE # diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 444f632..067e290 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -29,8 +29,8 @@ # Here are some CPackDeb wiki resources that are here for historic reasons and # are no longer maintained but may still prove useful: # -# - https://cmake.org/Wiki/CMake:CPackConfiguration -# - https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 +# - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration +# - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#deb-unix-only # # List of CPackDEB specific variables: # @@ -278,7 +278,7 @@ # You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value # if you use this feature, because if you don't :code:`dpkg-shlibdeps` # may fail to find your own shared libs. -# See https://cmake.org/Wiki/CMake_RPATH_handling. +# See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling # # .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG # diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 87385de..8d8eab3 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -40,8 +40,8 @@ # Here are some CPackRPM wiki resources that are here for historic reasons and # are no longer maintained but may still prove useful: # -# - https://cmake.org/Wiki/CMake:CPackConfiguration -# - https://cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 +# - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration +# - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#rpm-unix-only # # List of CPackRPM specific variables: # diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index 4a56a1c..ff8d353 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -129,9 +129,21 @@ if (WIN32) ERROR_QUIET) if (NOT _JNI_RESULT) string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\JDK\\\\[0-9\.]+" _JNI_VERSIONS "${_JNI_VERSIONS}") - foreach (_JNI_HINT IN LISTS _JNI_VERSIONS) - list(APPEND _JNI_HINTS "[${_JNI_HINT}\\MSI;INSTALLDIR]") - endforeach() + if (_JNI_VERSIONS) + # sort versions. Most recent first + ## handle version 9 apart from other versions to get correct ordering + set (_JNI_V9 ${_JNI_VERSIONS}) + list (FILTER _JNI_VERSIONS EXCLUDE REGEX "JDK\\\\9") + list (SORT _JNI_VERSIONS) + list (REVERSE _JNI_VERSIONS) + list (FILTER _JNI_V9 INCLUDE REGEX "JDK\\\\9") + list (SORT _JNI_V9) + list (REVERSE _JNI_V9) + list (APPEND _JNI_VERSIONS ${_JNI_V9}) + foreach (_JNI_HINT IN LISTS _JNI_VERSIONS) + list(APPEND _JNI_HINTS "[${_JNI_HINT}\\MSI;INSTALLDIR]") + endforeach() + endif() endif() foreach (_JNI_HINT IN LISTS _JNI_HINTS) diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index f8e3d98..95e551f 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -84,10 +84,22 @@ if (WIN32) OUTPUT_VARIABLE _JAVA_VERSIONS ERROR_QUIET) if (NOT _JAVA_RESULT) - string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\${_KIND}\\\\[0-9\.]+" _JAVA_VERSIONS "${_JAVA_VERSIONS}") - foreach (_JAVA_HINT IN LISTS _JAVA_VERSIONS) - list(APPEND _JAVA_HINTS "[${_JAVA_HINT}\\MSI;INSTALLDIR]/bin") - endforeach() + string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\${_KIND}\\\\[0-9.]+" _JAVA_VERSIONS "${_JAVA_VERSIONS}") + if (_JAVA_VERSIONS) + # sort versions. Most recent first + ## handle version 9 apart from other versions to get correct ordering + set (_JAVA_V9 ${_JAVA_VERSIONS}) + list (FILTER _JAVA_VERSIONS EXCLUDE REGEX "${_KIND}\\\\9") + list (SORT _JAVA_VERSIONS) + list (REVERSE _JAVA_VERSIONS) + list (FILTER _JAVA_V9 INCLUDE REGEX "${_KIND}\\\\9") + list (SORT _JAVA_V9) + list (REVERSE _JAVA_V9) + list (APPEND _JAVA_VERSIONS ${_JAVA_V9}) + foreach (_JAVA_HINT IN LISTS _JAVA_VERSIONS) + list(APPEND _JAVA_HINTS "[${_JAVA_HINT}\\MSI;INSTALLDIR]/bin") + endforeach() + endif() endif() endmacro() diff --git a/Modules/readme.txt b/Modules/readme.txt index 1e0c13b..a629478 100644 --- a/Modules/readme.txt +++ b/Modules/readme.txt @@ -1,4 +1,4 @@ See the "Find Modules" section of the cmake-developer(7) manual page. For more information about how to contribute modules to CMake, see this page: -https://cmake.org/Wiki/CMake:Module_Maintainers +https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/dev/Module-Maintainers diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 12dfdb6..72ae68b 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 11) -set(CMake_VERSION_PATCH 20180430) +set(CMake_VERSION_PATCH 20180501) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index b6ff38b..87ef5b6 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -33,23 +33,25 @@ static const char* cmDocumentationName[][2] = { }; static const char* cmDocumentationUsage[][2] = { - { nullptr, " cpack -G <generator> [options]" }, + // clang-format off + { nullptr, " cpack [options]" }, { nullptr, nullptr } + // clang-format on }; static const char* cmDocumentationOptions[][2] = { - { "-G <generator>", "Use the specified generator to generate package." }, + { "-G <generators>", "Override/define CPACK_GENERATOR" }, { "-C <Configuration>", "Specify the project configuration" }, { "-D <var>=<value>", "Set a CPack variable." }, - { "--config <config file>", "Specify the config file." }, - { "--verbose,-V", "enable verbose output" }, + { "--config <configFile>", "Specify the config file." }, + { "--verbose,-V", "Enable verbose output" }, { "--trace", "Put underlying cmake scripts in trace mode." }, { "--trace-expand", "Put underlying cmake scripts in expanded trace mode." }, - { "--debug", "enable debug output (for CPack developers)" }, - { "-P <package name>", "override/define CPACK_PACKAGE_NAME" }, - { "-R <package version>", "override/define CPACK_PACKAGE_VERSION" }, - { "-B <package directory>", "override/define CPACK_PACKAGE_DIRECTORY" }, - { "--vendor <vendor name>", "override/define CPACK_PACKAGE_VENDOR" }, + { "--debug", "Enable debug output (for CPack developers)" }, + { "-P <packageName>", "Override/define CPACK_PACKAGE_NAME" }, + { "-R <packageVersion>", "Override/define CPACK_PACKAGE_VERSION" }, + { "-B <packageDirectory>", "Override/define CPACK_PACKAGE_DIRECTORY" }, + { "--vendor <vendorName>", "Override/define CPACK_PACKAGE_VENDOR" }, { nullptr, nullptr } }; diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 2704c40..2a1abba 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -19,6 +19,9 @@ function(cm_check_cxx_feature name) string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}") # Filter out warnings caused by user flags. string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") + # Filter out warnings caused by local configuration. + string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}") + string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}") # If using the feature causes warnings, treat it as broken/unavailable. if(check_output MATCHES "[Ww]arning") set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE) diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 9b9ef60..7190c36 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -252,9 +252,7 @@ class cmMakefile; /** \class cmPolicies * \brief Handles changes in CMake behavior and policies * - * See the cmake wiki section on - * <a href="https://cmake.org/Wiki/CMake/Policies">policies</a> - * for an overview of this class's purpose + * See the cmake-policies(7) manual for an overview of this class's purpose. */ class cmPolicies { diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 6074ae6..5497469 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1691,12 +1691,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) } // Figure out if debug information should be generated if (const char* sed = sf->GetProperty("VS_SHADER_ENABLE_DEBUG")) { - shaderEnableDebug = cmSystemTools::IsOn(sed) ? "true" : "false"; + shaderEnableDebug = sed; toolHasSettings = true; } // Figure out if optimizations should be disabled if (const char* sdo = sf->GetProperty("VS_SHADER_DISABLE_OPTIMIZATIONS")) { - shaderDisableOptimizations = cmSystemTools::IsOn(sdo) ? "true" : "false"; + shaderDisableOptimizations = sdo; toolHasSettings = true; } if (const char* sofn = sf->GetProperty("VS_SHADER_OBJECT_FILE_NAME")) { @@ -1838,12 +1838,39 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) } } if (!shaderEnableDebug.empty()) { - this->WriteElemEscapeXML("EnableDebuggingInformation", shaderEnableDebug, - 3); + cmGeneratorExpression ge; + std::unique_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(shaderEnableDebug); + + for (size_t i = 0; i != this->Configurations.size(); ++i) { + const char* enableDebug = + cge->Evaluate(this->LocalGenerator, this->Configurations[i]); + if (strlen(enableDebug) > 0) { + Elem el(*this->BuildFileStream, 3); + el.StartElement("EnableDebuggingInformation"); + el.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" + + this->Configurations[i] + "|" + this->Platform + "'"); + el.Content(cmSystemTools::IsOn(enableDebug) ? "true" : "false"); + } + } } if (!shaderDisableOptimizations.empty()) { - this->WriteElemEscapeXML("DisableOptimizations", - shaderDisableOptimizations, 3); + cmGeneratorExpression ge; + std::unique_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(shaderDisableOptimizations); + + for (size_t i = 0; i != this->Configurations.size(); ++i) { + const char* disableOptimizations = + cge->Evaluate(this->LocalGenerator, this->Configurations[i]); + if (strlen(disableOptimizations) > 0) { + Elem el(*this->BuildFileStream, 3); + el.StartElement("DisableOptimizations"); + el.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" + + this->Configurations[i] + "|" + this->Platform + "'"); + el.Content(cmSystemTools::IsOn(disableOptimizations) ? "true" + : "false"); + } + } } if (!shaderObjectFileName.empty()) { this->WriteElemEscapeXML("ObjectFileOutput", shaderObjectFileName, 3); |