summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.rst14
-rw-r--r--CompileFlags.cmake4
-rw-r--r--Help/command/add_custom_command.rst2
-rw-r--r--Help/dev/README.rst9
-rw-r--r--Help/dev/source.rst42
-rw-r--r--Help/generator/Visual Studio 7 .NET 2003.rst10
-rw-r--r--Help/manual/cmake-developer.7.rst24
-rw-r--r--Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst2
-rw-r--r--Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst2
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst2
-rw-r--r--Help/release/dev/remove-vs7.1-generator.rst4
-rw-r--r--Help/variable/CMAKE_CFG_INTDIR.rst2
-rw-r--r--Help/variable/CMAKE_MFC_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_VS_DEVENV_COMMAND.rst2
-rw-r--r--Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst2
-rw-r--r--Modules/AutogenInfo.cmake.in1
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake6
-rw-r--r--Modules/CMakeDetermineCSharpCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake2
-rw-r--r--Modules/CMakeVS7BackwardCompatibility.cmake16
-rw-r--r--Modules/CPackRPM.cmake13
-rw-r--r--Modules/CTest.cmake6
-rw-r--r--Modules/Compiler/Intel.cmake2
-rw-r--r--Modules/FindBoost.cmake5
-rw-r--r--Modules/FindOpenSSL.cmake4
-rw-r--r--Modules/FindwxWidgets.cmake22
-rw-r--r--Modules/GNUInstallDirs.cmake44
-rw-r--r--Modules/Platform/Linux-GNU.cmake1
-rw-r--r--Modules/Platform/Windows-df.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx2
-rw-r--r--Source/cmComputeLinkInformation.cxx20
-rw-r--r--Source/cmExportBuildFileGenerator.cxx9
-rw-r--r--Source/cmGeneratorExpressionNode.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx226
-rw-r--r--Source/cmGeneratorTarget.h42
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx68
-rw-r--r--Source/cmGlobalVisualStudio71Generator.h29
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx14
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx7
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h3
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx40
-rw-r--r--Source/cmInstallTargetGenerator.cxx5
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx35
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx3
-rw-r--r--Source/cmMakefileTargetGenerator.cxx19
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx70
-rw-r--r--Source/cmOSXBundleGenerator.cxx5
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx45
-rw-r--r--Source/cmQtAutoGenerators.cxx63
-rw-r--r--Source/cmQtAutoGenerators.h8
-rw-r--r--Source/cmServerProtocol.cxx6
-rw-r--r--Source/cmStateTypes.h6
-rw-r--r--Source/cmSystemTools.cxx42
-rw-r--r--Source/cmSystemTools.h2
-rw-r--r--Source/cmTarget.cxx142
-rw-r--r--Source/cmTarget.h8
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx17
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx4
-rw-r--r--Source/cmake.cxx5
-rw-r--r--Source/kwsys/.gitattributes16
-rw-r--r--Source/kwsys/CMakeLists.txt1
-rw-r--r--Source/kwsys/Encoding.hxx.in11
-rw-r--r--Source/kwsys/EncodingCXX.cxx58
-rw-r--r--Source/kwsys/FStream.hxx.in4
-rw-r--r--Source/kwsys/SystemTools.cxx138
-rw-r--r--Source/kwsys/SystemTools.hxx.in8
-rw-r--r--Source/kwsys/testEncoding.cxx83
-rw-r--r--Source/kwsys/testSystemTools.cxx79
-rw-r--r--Tests/BuildDepends/CMakeLists.txt2
-rw-r--r--Tests/CMakeLists.txt13
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/CMakeLists.txt6
-rw-r--r--Tests/Preprocess/CMakeLists.txt10
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Common.cmake1
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt2
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Root-stderr.txt2
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt2
-rw-r--r--Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt2
-rw-r--r--Tests/RunCMake/RunCMake.cmake3
-rw-r--r--Tests/RunCMake/VSSolution/RunCMakeTest.cmake2
-rwxr-xr-xUtilities/Scripts/update-kwsys.bash3
92 files changed, 906 insertions, 782 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 434f0f4..e219763 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -25,6 +25,7 @@ To contribute patches:
#. Fork the upstream `CMake Repository`_ into a personal account.
#. Run `Utilities/SetupForDevelopment.sh`_ for local configuration.
+#. See the `CMake Source Code Guide`_ for coding guidelines.
#. Base all new work on the upstream ``master`` branch.
#. Create commits making incremental, distinct, logically complete changes.
#. Push a topic branch to a personal repository fork on GitLab.
@@ -35,20 +36,9 @@ The merge request will enter the `CMake Review Process`_ for consideration.
.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh
+.. _`CMake Source Code Guide`: Help/dev/source.rst
.. _`CMake Review Process`: Help/dev/review.rst
-Code Style
-==========
-
-We use `clang-format`_ to define our style for C++ code in the CMake source
-tree. See the `.clang-format`_ configuration file for our style settings.
-Use ``clang-format`` version 3.8 or higher to format source files.
-See also the `Utilities/Scripts/clang-format.bash`_ script.
-
-.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html
-.. _`.clang-format`: .clang-format
-.. _`Utilities/Scripts/clang-format.bash`: Utilities/Scripts/clang-format.bash
-
License
=======
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index c875e6f..d70e3af 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -4,10 +4,6 @@
#-----------------------------------------------------------------------------
# set some special flags for different compilers
#
-if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
- set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif()
-
if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel")
set(_INTEL_WINDOWS 1)
endif()
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 80e7edf..d038406 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -215,7 +215,7 @@ of the following is specified:
``PRE_BUILD``
Run before any other rules are executed within the target.
- This is supported only on Visual Studio 7 or later.
+ This is supported only on Visual Studio 8 or later.
For all other generators ``PRE_BUILD`` will be treated as
``PRE_LINK``.
``PRE_LINK``
diff --git a/Help/dev/README.rst b/Help/dev/README.rst
index 0dc512a..163be97 100644
--- a/Help/dev/README.rst
+++ b/Help/dev/README.rst
@@ -29,3 +29,12 @@ following documents:
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`CMake Review Process`: review.rst
.. _`CMake Testing Process`: testing.rst
+
+Developer Documentation
+=======================
+
+CMake developer documentation is provided by the following documents:
+
+* The `CMake Source Code Guide`_.
+
+.. _`CMake Source Code Guide`: source.rst
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
new file mode 100644
index 0000000..3ac9aca
--- /dev/null
+++ b/Help/dev/source.rst
@@ -0,0 +1,42 @@
+CMake Source Code Guide
+***********************
+
+The following is a guide to the CMake source code for developers.
+See documentation on `CMake Development`_ for more information.
+
+.. _`CMake Development`: README.rst
+
+C++ Code Style
+==============
+
+We use `clang-format`_ version **3.8** to define our style for C++ code in
+the CMake source tree. See the `.clang-format`_ configuration file for our
+style settings. Use the `Utilities/Scripts/clang-format.bash`_ script to
+format source code. It automatically runs ``clang-format`` on the set of
+source files for which we enforce style. The script also has options to
+format only a subset of files, such as those that are locally modified.
+
+.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html
+.. _`.clang-format`: ../../.clang-format
+.. _`Utilities/Scripts/clang-format.bash`: ../../Utilities/Scripts/clang-format.bash
+
+C++ Subset Permitted
+====================
+
+CMake supports compiling as C++98 in addition to C++11 and C++14.
+In order to support building on older toolchains some constructs
+need to be handled with care:
+
+* Use ``CM_AUTO_PTR`` instead of ``std::auto_ptr``.
+
+ The ``std::auto_ptr`` template is deprecated in C++11. We want to use it
+ so we can build on C++98 compilers but we do not want to turn off compiler
+ warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR``
+ macro instead.
+
+* Use ``size_t`` instead of ``std::size_t``.
+
+ Various implementations have differing implementation of ``size_t``.
+ When assigning the result of ``.size()`` on a container for example,
+ the result should be assigned to ``size_t`` not to ``std::size_t``,
+ ``unsigned int`` or similar types.
diff --git a/Help/generator/Visual Studio 7 .NET 2003.rst b/Help/generator/Visual Studio 7 .NET 2003.rst
index 1c086a0..d4c7869 100644
--- a/Help/generator/Visual Studio 7 .NET 2003.rst
+++ b/Help/generator/Visual Studio 7 .NET 2003.rst
@@ -1,10 +1,6 @@
Visual Studio 7 .NET 2003
-------------------------
-Deprecated. Generates Visual Studio .NET 2003 project files.
-
-.. note::
- This generator is deprecated and will be removed
- in a future version of CMake. It will still be
- possible to build with VS 7.1 tools using the
- :generator:`NMake Makefiles` generator.
+Removed. This once generated Visual Studio .NET 2003 project files, but
+the generator has been removed since CMake 3.9. It is still possible to
+build with VS 7.1 tools using the :generator:`NMake Makefiles` generator.
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index f77d8c0..cd509ac 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -13,30 +13,6 @@ Introduction
This manual is intended for reference by developers modifying the CMake
source tree itself, and by those authoring externally-maintained modules.
-
-Permitted C++ Subset
-====================
-
-CMake is required to build with ancient C++ compilers and standard library
-implementations. Some common C++ constructs may not be used in CMake in order
-to build with such toolchains.
-
-std::auto_ptr
--------------
-
-The ``std::auto_ptr`` template is deprecated in C++11. We want to use it
-so we can build on C++98 compilers but we do not want to turn off compiler
-warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR``
-macro instead.
-
-size_t
-------
-
-Various implementations have differing implementation of ``size_t``. When
-assigning the result of ``.size()`` on a container for example, the result
-should be assigned to ``size_t`` not to ``std::size_t``, ``unsigned int`` or
-similar types.
-
Adding Compile Features
=======================
diff --git a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
index eb91832..dcd2a4e 100644
--- a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
+++ b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
@@ -17,7 +17,7 @@ pairs. Each such pair will be transformed into an entry in the
solution global section. Whitespace around key and value is ignored.
List elements which do not contain an equal sign are skipped.
-This property only works for Visual Studio 7 and above; it is ignored
+This property only works for Visual Studio 8 and above; it is ignored
on other generators. The property only applies when set on a
directory whose CMakeLists.txt contains a project() command.
diff --git a/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst b/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst
index fbcd9e6..200e8e6 100644
--- a/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst
+++ b/Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst
@@ -17,6 +17,6 @@ pairs. Each such pair will be transformed into an entry in the
solution global section. Whitespace around key and value is ignored.
List elements which do not contain an equal sign are skipped.
-This property only works for Visual Studio 7 and above; it is ignored
+This property only works for Visual Studio 8 and above; it is ignored
on other generators. The property only applies when set on a
directory whose CMakeLists.txt contains a project() command.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
index 19270a5..a14e48c 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
@@ -3,6 +3,6 @@ EXCLUDE_FROM_DEFAULT_BUILD
Exclude target from "Build Solution".
-This property is only used by Visual Studio generators 7 and above.
+This property is only used by Visual Studio generators.
When set to TRUE, the target will not be built when you press "Build
Solution".
diff --git a/Help/release/dev/remove-vs7.1-generator.rst b/Help/release/dev/remove-vs7.1-generator.rst
new file mode 100644
index 0000000..72ffafb
--- /dev/null
+++ b/Help/release/dev/remove-vs7.1-generator.rst
@@ -0,0 +1,4 @@
+remove-vs7.1-generator
+----------------------
+
+* The :generator:`Visual Studio 7 .NET 2003` generator has been removed.
diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst
index ba25a35..c36599a 100644
--- a/Help/variable/CMAKE_CFG_INTDIR.rst
+++ b/Help/variable/CMAKE_CFG_INTDIR.rst
@@ -12,7 +12,7 @@ Example values:
::
- $(ConfigurationName) = Visual Studio 7, 8, 9
+ $(ConfigurationName) = Visual Studio 8, 9
$(Configuration) = Visual Studio 10
$(CONFIGURATION) = Xcode
. = Make-based tools
diff --git a/Help/variable/CMAKE_MFC_FLAG.rst b/Help/variable/CMAKE_MFC_FLAG.rst
index 1543677..5a392bf 100644
--- a/Help/variable/CMAKE_MFC_FLAG.rst
+++ b/Help/variable/CMAKE_MFC_FLAG.rst
@@ -5,7 +5,7 @@ Tell cmake to use MFC for an executable or dll.
This can be set in a ``CMakeLists.txt`` file and will enable MFC in the
application. It should be set to ``1`` for the static MFC library, and ``2``
-for the shared MFC library. This is used in Visual Studio 7
+for the shared MFC library. This is used in Visual Studio
project files. The CMakeSetup dialog used MFC and the ``CMakeLists.txt``
looks like this:
diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
index 14cc50a..51b42dd 100644
--- a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
+++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
@@ -1,7 +1,7 @@
CMAKE_VS_DEVENV_COMMAND
-----------------------
-The generators for :generator:`Visual Studio 7` and above set this
+The generators for :generator:`Visual Studio 8 2005` and above set this
variable to the ``devenv.com`` command installed with the corresponding
Visual Studio version. Note that this variable may be empty on
Visual Studio Express editions because they do not provide this tool.
diff --git a/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst b/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst
index 0be10e5..6d196f9 100644
--- a/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst
+++ b/Help/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.rst
@@ -1,7 +1,7 @@
CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
--------------------------------------
-When generating for :generator:`Visual Studio 7` or greater with the Intel
+When generating for :generator:`Visual Studio 8 2005` or greater with the Intel
Fortran plugin installed, this specifies the ``.vfproj`` project file format
version. This is intended for internal use by CMake and should not be
used by project code.
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index fcecb6c..5e945bc 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -21,6 +21,7 @@ set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS @_moc_options@)
set(AM_MOC_RELAXED_MODE @_moc_relaxed_mode@)
set(AM_MOC_DEPEND_FILTERS @_moc_depend_filters@)
+set(AM_MOC_PREDEFS_CMD @_moc_predefs_cmd@)
# UIC settings
set(AM_UIC_SKIP @_uic_skip@)
set(AM_UIC_TARGET_OPTIONS @_uic_target_options@)
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 228e063..5d86d73 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -2,12 +2,6 @@
# file Copyright.txt or https://cmake.org/licensing for details.
-# Nothing here yet
-if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
- include(CMakeVS7BackwardCompatibility)
- set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif()
-
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway,
# so just get through this with at least some size for the types.
diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake
index 1b8dd02..55b2fb3 100644
--- a/Modules/CMakeDetermineCSharpCompiler.cmake
+++ b/Modules/CMakeDetermineCSharpCompiler.cmake
@@ -1,7 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^789]|[789][0-9])")
+if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
message(FATAL_ERROR
"C# is currently only supported for Microsoft Visual Studio 2010 and later.")
endif()
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 55a6f0c..89ac9fa 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -6,7 +6,7 @@ include(${CMAKE_ROOT}/Modules//CMakeParseImplicitLinkInfo.cmake)
if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR
("${CMAKE_GENERATOR}" MATCHES "Ninja") OR
- ("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[7-9][0-9])") ) )
+ ("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[89][0-9])") ) )
message(FATAL_ERROR "CUDA language not currently supported by \"${CMAKE_GENERATOR}\" generator")
endif()
diff --git a/Modules/CMakeVS7BackwardCompatibility.cmake b/Modules/CMakeVS7BackwardCompatibility.cmake
deleted file mode 100644
index cf477c8..0000000
--- a/Modules/CMakeVS7BackwardCompatibility.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-
-# hard code these for fast backwards compatibility tests
-set (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
-set (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
-set (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
-set (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
-set (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
-set (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
-set (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
-set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
- "Does the compiler support ansi for scope.")
-set (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
-set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index cc54032..fa2a6e4 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -911,6 +911,19 @@
#
# * Mandatory : YES
# * Default : "/"
+#
+# .. VARIABLE:: CPACK_RPM_BUILDREQUIRES
+#
+# List of source rpm build dependencies.
+#
+# * Mandatory : NO
+# * Default : -
+#
+# May be used to set source RPM build dependencies (BuildRequires). Note that
+# you must enclose the complete build requirements string between quotes, for
+# example::
+#
+# set(CPACK_RPM_BUILDREQUIRES "python >= 2.5.0, cmake >= 2.8")
# Author: Eric Noulard with the help of Alexander Neundorf.
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 7aeb5be..9370596 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -54,15 +54,11 @@ in the ``CTestConfig.cmake`` file.
option(BUILD_TESTING "Build the testing tree." ON)
# function to turn generator name into a version string
-# like vs7 vs71 vs8 vs9
+# like vs8 vs9
function(GET_VS_VERSION_STRING generator var)
string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
NUMBER "${generator}")
- if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
- set(ver_string "vs71")
- else()
set(ver_string "vs${NUMBER}")
- endif()
set(${var} ${ver_string} PARENT_SCOPE)
endfunction()
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake
index 02968b4..06d01f1 100644
--- a/Modules/Compiler/Intel.cmake
+++ b/Modules/Compiler/Intel.cmake
@@ -22,5 +22,7 @@ else()
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
+
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}" "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endmacro()
endif()
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index c3cf341..093d8c9 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -896,7 +896,7 @@ endfunction()
# This function would append corresponding directories if MSVC is a current compiler,
# so having `BOOST_ROOT` would be enough to specify to find everything.
#
-macro(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir)
+function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir)
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_arch_suffix 64)
@@ -919,8 +919,9 @@ macro(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlib
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-8.0)
endif()
+ set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE)
endif()
-endmacro()
+endfunction()
#
# End functions/macros
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 117811c..1209560 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -145,6 +145,7 @@ if(WIN32 AND NOT CYGWIN)
find_library(LIB_EAY_DEBUG
NAMES
libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
+ libcrypto${_OPENSSL_MSVC_RT_MODE}d
libcryptod
libeay32${_OPENSSL_MSVC_RT_MODE}d
libeay32d
@@ -157,6 +158,7 @@ if(WIN32 AND NOT CYGWIN)
find_library(LIB_EAY_RELEASE
NAMES
libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}
+ libcrypto${_OPENSSL_MSVC_RT_MODE}
libcrypto
libeay32${_OPENSSL_MSVC_RT_MODE}
libeay32
@@ -170,6 +172,7 @@ if(WIN32 AND NOT CYGWIN)
find_library(SSL_EAY_DEBUG
NAMES
libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
+ libssl${_OPENSSL_MSVC_RT_MODE}d
libssld
ssleay32${_OPENSSL_MSVC_RT_MODE}d
ssleay32d
@@ -182,6 +185,7 @@ if(WIN32 AND NOT CYGWIN)
find_library(SSL_EAY_RELEASE
NAMES
libssl${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}
+ libssl${_OPENSSL_MSVC_RT_MODE}
libssl
ssleay32${_OPENSSL_MSVC_RT_MODE}
ssleay32
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index bc906e5..af4daf0 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -893,6 +893,28 @@ else()
endif()
endif()
+# Check that all libraries are present, as wx-config does not check it
+set(_wx_lib_missing "")
+foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
+ if("${_wx_lib_}" MATCHES "^-l(.*)")
+ set(_wx_lib_name "${CMAKE_MATCH_1}")
+ unset(_wx_lib_found CACHE)
+ find_library(_wx_lib_found NAMES ${_wx_lib_name} HINTS ${wxWidgets_LIBRARY_DIRS})
+ if(_wx_lib_found STREQUAL _wx_lib_found-NOTFOUND)
+ list(APPEND _wx_lib_missing ${_wx_lib_name})
+ endif()
+ unset(_wx_lib_found CACHE)
+ endif()
+endforeach()
+
+if (_wx_lib_missing)
+ string(REPLACE ";" " " _wx_lib_missing "${_wx_lib_missing}")
+ DBG_MSG_V("wxWidgets not found due to following missing libraries: ${_wx_lib_missing}")
+ set(wxWidgets_FOUND FALSE)
+ unset(wxWidgets_LIBRARIES)
+endif()
+unset(_wx_lib_missing)
+
# Check if a specfic version was requested by find_package().
if(wxWidgets_FOUND)
find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 9599f27..64bd09e 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -45,6 +45,8 @@
# modifiable architecture-independent data (``com``)
# ``LOCALSTATEDIR``
# modifiable single-machine data (``var``)
+# ``RUNSTATEDIR``
+# run-time variable data (``LOCALSTATEDIR/run``)
# ``LIBDIR``
# object code libraries (``lib`` or ``lib64``
# or ``lib/<multiarch-tuple>`` on Debian)
@@ -75,10 +77,10 @@
#
# ``/``
#
-# For ``<dir>`` other than the ``SYSCONFDIR`` and ``LOCALSTATEDIR``,
-# the value of ``CMAKE_INSTALL_<dir>`` is prefixed with ``usr/`` if
-# it is not user-specified as an absolute path. For example, the
-# ``INCLUDEDIR`` value ``include`` becomes ``usr/include``.
+# For ``<dir>`` other than the ``SYSCONFDIR``, ``LOCALSTATEDIR`` and
+# ``RUNSTATEDIR``, the value of ``CMAKE_INSTALL_<dir>`` is prefixed
+# with ``usr/`` if it is not user-specified as an absolute path.
+# For example, the ``INCLUDEDIR`` value ``include`` becomes ``usr/include``.
# This is required by the `GNU Coding Standards`_, which state:
#
# When building the complete GNU system, the prefix will be empty
@@ -86,20 +88,21 @@
#
# ``/usr``
#
-# For ``<dir>`` equal to ``SYSCONFDIR`` or ``LOCALSTATEDIR``, the
-# ``CMAKE_INSTALL_FULL_<dir>`` is computed by prepending just ``/``
-# to the value of ``CMAKE_INSTALL_<dir>`` if it is not user-specified
-# as an absolute path. For example, the ``SYSCONFDIR`` value ``etc``
-# becomes ``/etc``. This is required by the `GNU Coding Standards`_.
+# For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
+# ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
+# prepending just ``/`` to the value of ``CMAKE_INSTALL_<dir>``
+# if it is not user-specified as an absolute path.
+# For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc``.
+# This is required by the `GNU Coding Standards`_.
#
# ``/opt/...``
#
-# For ``<dir>`` equal to ``SYSCONFDIR`` or ``LOCALSTATEDIR``, the
-# ``CMAKE_INSTALL_FULL_<dir>`` is computed by *appending* the prefix
-# to the value of ``CMAKE_INSTALL_<dir>`` if it is not user-specified
-# as an absolute path. For example, the ``SYSCONFDIR`` value ``etc``
-# becomes ``/etc/opt/...``. This is defined by the
-# `Filesystem Hierarchy Standard`_.
+# For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
+# ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
+# *appending* the prefix to the value of ``CMAKE_INSTALL_<dir>``
+# if it is not user-specified as an absolute path.
+# For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``.
+# This is defined by the `Filesystem Hierarchy Standard`_.
#
# .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
#
@@ -287,6 +290,9 @@ _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DAT
_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}"
"Documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
+_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_RUNSTATEDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/run"
+ "Run-time variable data (LOCALSTATEDIR/run)")
+
#-----------------------------------------------------------------------------
mark_as_advanced(
@@ -296,6 +302,7 @@ mark_as_advanced(
CMAKE_INSTALL_SYSCONFDIR
CMAKE_INSTALL_SHAREDSTATEDIR
CMAKE_INSTALL_LOCALSTATEDIR
+ CMAKE_INSTALL_RUNSTATEDIR
CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_OLDINCLUDEDIR
@@ -314,7 +321,7 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var)
# - CMAKE_INSTALL_PREFIX == /usr
# - CMAKE_INSTALL_PREFIX == /opt/...
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
- if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR")
+ if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}")
else()
if (NOT "${${var}}" MATCHES "^usr/")
@@ -323,13 +330,13 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var)
set(${absvar} "/${${var}}")
endif()
elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
- if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR")
+ if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}")
else()
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/.*")
- if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR")
+ if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}")
else()
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
@@ -351,6 +358,7 @@ foreach(dir
SYSCONFDIR
SHAREDSTATEDIR
LOCALSTATEDIR
+ RUNSTATEDIR
LIBDIR
INCLUDEDIR
OLDINCLUDEDIR
diff --git a/Modules/Platform/Linux-GNU.cmake b/Modules/Platform/Linux-GNU.cmake
index 6878254..ce30a26 100644
--- a/Modules/Platform/Linux-GNU.cmake
+++ b/Modules/Platform/Linux-GNU.cmake
@@ -12,4 +12,5 @@ macro(__linux_compiler_gnu lang)
# We pass this for historical reasons. Projects may have
# executables that use dlopen but do not set ENABLE_EXPORTS.
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}" "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endmacro()
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index b31cb11..c59be45 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -30,7 +30,7 @@ set(CMAKE_Fortran_LINK_EXECUTABLE
set(CMAKE_CREATE_WIN32_EXE /winapp)
set(CMAKE_CREATE_CONSOLE_EXE )
-if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+if(CMAKE_GENERATOR MATCHES "Visual Studio 8")
set (CMAKE_NO_BUILD_TYPE 1)
endif()
# does the compiler support pdbtype and is it the newer compiler
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 9219dae..ea6e0e2 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 8)
-set(CMake_VERSION_PATCH 20170419)
+set(CMake_VERSION_PATCH 20170421)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index 701481d..b48bf12 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -85,8 +85,6 @@ int main(int argc, char* argv[])
int length;
while (cmsysProcess_WaitForData(cp, &data, &length, 0)) {
// Translate NULL characters in the output into valid text.
- // Visual Studio 7 puts these characters in the output of its
- // build process.
for (int i = 0; i < length; ++i) {
if (data[i] == '\0') {
data[i] = ' ';
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 80e7e7d..b273443 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -500,7 +500,10 @@ bool cmComputeLinkInformation::Compute()
cmGeneratorTarget const* tgt = *i;
bool implib = (this->UseImportLibrary &&
(tgt->GetType() == cmStateEnums::SHARED_LIBRARY));
- std::string lib = tgt->GetFullPath(this->Config, implib, true);
+ cmStateEnums::ArtifactType artifact = implib
+ ? cmStateEnums::ImportLibraryArtifact
+ : cmStateEnums::RuntimeBinaryArtifact;
+ std::string lib = tgt->GetFullPath(this->Config, artifact, true);
this->OldLinkDirItems.push_back(lib);
}
}
@@ -596,8 +599,11 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// platform. Add it now.
std::string linkItem;
linkItem = this->LoaderFlag;
+ cmStateEnums::ArtifactType artifact = this->UseImportLibrary
+ ? cmStateEnums::ImportLibraryArtifact
+ : cmStateEnums::RuntimeBinaryArtifact;
- std::string exe = tgt->GetFullPath(config, this->UseImportLibrary, true);
+ std::string exe = tgt->GetFullPath(config, artifact, true);
linkItem += exe;
this->Items.push_back(Item(linkItem, true, tgt));
this->Depends.push_back(exe);
@@ -617,9 +623,12 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
bool implib =
(this->UseImportLibrary &&
(impexe || tgt->GetType() == cmStateEnums::SHARED_LIBRARY));
+ cmStateEnums::ArtifactType artifact = implib
+ ? cmStateEnums::ImportLibraryArtifact
+ : cmStateEnums::RuntimeBinaryArtifact;
// Pass the full path to the target file.
- std::string lib = tgt->GetFullPath(config, implib, true);
+ std::string lib = tgt->GetFullPath(config, artifact, true);
if (!this->LinkDependsNoShared ||
tgt->GetType() != cmStateEnums::SHARED_LIBRARY) {
this->Depends.push_back(lib);
@@ -689,7 +698,10 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
// linked will be able to find it.
std::string lib;
if (tgt) {
- lib = tgt->GetFullPath(this->Config, this->UseImportLibrary);
+ cmStateEnums::ArtifactType artifact = this->UseImportLibrary
+ ? cmStateEnums::ImportLibraryArtifact
+ : cmStateEnums::RuntimeBinaryArtifact;
+ lib = tgt->GetFullPath(this->Config, artifact);
this->AddLibraryRuntimeInfo(lib, tgt);
} else {
lib = item;
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 978a7a1..a1c424a 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -200,9 +200,11 @@ void cmExportBuildFileGenerator::SetImportLocationProperty(
prop += suffix;
std::string value;
if (target->IsAppBundleOnApple()) {
- value = target->GetFullPath(config, false);
+ value =
+ target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
} else {
- value = target->GetFullPath(config, false, true);
+ value = target->GetFullPath(config,
+ cmStateEnums::RuntimeBinaryArtifact, true);
}
properties[prop] = value;
}
@@ -212,7 +214,8 @@ void cmExportBuildFileGenerator::SetImportLocationProperty(
mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
std::string prop = "IMPORTED_IMPLIB";
prop += suffix;
- std::string value = target->GetFullPath(config, true);
+ std::string value =
+ target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact);
target->GetImplibGNUtoMS(value, value, "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
properties[prop] = value;
}
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 77a4962..e065a74 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1607,7 +1607,10 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
"executables with ENABLE_EXPORTS.");
return std::string();
}
- return target->GetFullPath(context->Config, target->HasImportLibrary());
+ cmStateEnums::ArtifactType artifact = target->HasImportLibrary()
+ ? cmStateEnums::ImportLibraryArtifact
+ : cmStateEnums::RuntimeBinaryArtifact;
+ return target->GetFullPath(context->Config, artifact);
}
};
@@ -1668,7 +1671,8 @@ struct TargetFilesystemArtifactResultCreator<ArtifactNameTag>
cmGeneratorExpressionContext* context,
const GeneratorExpressionContent* /*unused*/)
{
- return target->GetFullPath(context->Config, false, true);
+ return target->GetFullPath(context->Config,
+ cmStateEnums::RuntimeBinaryArtifact, true);
}
};
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5161f09..10a7706 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -216,52 +216,60 @@ const char* cmGeneratorTarget::GetProperty(const std::string& prop) const
return this->Target->GetProperty(prop);
}
-const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
+const char* cmGeneratorTarget::GetOutputTargetType(
+ cmStateEnums::ArtifactType artifact) const
{
switch (this->GetType()) {
case cmStateEnums::SHARED_LIBRARY:
if (this->IsDLLPlatform()) {
- if (implib) {
- // A DLL import library is treated as an archive target.
- return "ARCHIVE";
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ // A DLL shared library is treated as a runtime target.
+ return "RUNTIME";
+ case cmStateEnums::ImportLibraryArtifact:
+ // A DLL import library is treated as an archive target.
+ return "ARCHIVE";
}
- // A DLL shared library is treated as a runtime target.
- return "RUNTIME";
} else {
// For non-DLL platforms shared libraries are treated as
// library targets.
return "LIBRARY";
}
+ break;
case cmStateEnums::STATIC_LIBRARY:
// Static libraries are always treated as archive targets.
return "ARCHIVE";
case cmStateEnums::MODULE_LIBRARY:
- if (implib) {
- // Module libraries are always treated as library targets.
- return "ARCHIVE";
- } else {
- // Module import libraries are treated as archive targets.
- return "LIBRARY";
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ // Module import libraries are treated as archive targets.
+ return "LIBRARY";
+ case cmStateEnums::ImportLibraryArtifact:
+ // Module libraries are always treated as library targets.
+ return "ARCHIVE";
}
+ break;
case cmStateEnums::EXECUTABLE:
- if (implib) {
- // Executable import libraries are treated as archive targets.
- return "ARCHIVE";
- } else {
- // Executables are always treated as runtime targets.
- return "RUNTIME";
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ // Executables are always treated as runtime targets.
+ return "RUNTIME";
+ case cmStateEnums::ImportLibraryArtifact:
+ // Executable import libraries are treated as archive targets.
+ return "ARCHIVE";
}
+ break;
default:
break;
}
return "";
}
-std::string cmGeneratorTarget::GetOutputName(const std::string& config,
- bool implib) const
+std::string cmGeneratorTarget::GetOutputName(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
// Lookup/compute/cache the output name for this configuration.
- OutputNameKey key(config, implib);
+ OutputNameKey key(config, artifact);
cmGeneratorTarget::OutputNameMapType::iterator i =
this->OutputNameMap.find(key);
if (i == this->OutputNameMap.end()) {
@@ -271,7 +279,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
// Compute output name.
std::vector<std::string> props;
- std::string type = this->GetOutputTargetType(implib);
+ std::string type = this->GetOutputTargetType(artifact);
std::string configUpper = cmSystemTools::UpperCase(config);
if (!type.empty() && !configUpper.empty()) {
// <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
@@ -653,9 +661,10 @@ const char* cmGeneratorTarget::GetLocation(const std::string& config) const
{
static std::string location;
if (this->IsImported()) {
- location = this->Target->ImportedGetFullPath(config, false);
+ location = this->Target->ImportedGetFullPath(
+ config, cmStateEnums::RuntimeBinaryArtifact);
} else {
- location = this->GetFullPath(config, false);
+ location = this->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
}
return location.c_str();
}
@@ -692,7 +701,8 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
{
static std::string location;
if (this->IsImported()) {
- location = this->Target->ImportedGetFullPath("", false);
+ location = this->Target->ImportedGetFullPath(
+ "", cmStateEnums::RuntimeBinaryArtifact);
return location.c_str();
}
@@ -712,7 +722,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
}
}
location += "/";
- location += this->GetFullName("", false);
+ location += this->GetFullName("", cmStateEnums::RuntimeBinaryArtifact);
return location.c_str();
}
@@ -1157,7 +1167,8 @@ std::string cmGeneratorTarget::GetCompilePDBName(
std::string prefix;
std::string base;
std::string suffix;
- this->GetFullNameInternal(config, false, prefix, base, suffix);
+ this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+ prefix, base, suffix);
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(config);
@@ -1518,7 +1529,8 @@ static bool shouldAddContentLevel(
std::string cmGeneratorTarget::GetAppBundleDirectory(
const std::string& config, BundleDirectoryLevel level) const
{
- std::string fpath = this->GetFullName(config, false);
+ std::string fpath =
+ this->GetFullName(config, cmStateEnums::RuntimeBinaryArtifact);
fpath += ".";
const char* ext = this->GetProperty("BUNDLE_EXTENSION");
if (!ext) {
@@ -1544,7 +1556,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(
const std::string& config, BundleDirectoryLevel level) const
{
std::string fpath;
- fpath += this->GetOutputName(config, false);
+ fpath += this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
fpath += ".";
const char* ext = this->GetProperty("BUNDLE_EXTENSION");
if (!ext) {
@@ -1568,7 +1580,7 @@ std::string cmGeneratorTarget::GetFrameworkDirectory(
const std::string& config, BundleDirectoryLevel level) const
{
std::string fpath;
- fpath += this->GetOutputName(config, false);
+ fpath += this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
fpath += ".";
const char* ext = this->GetProperty("BUNDLE_EXTENSION");
if (!ext) {
@@ -1582,13 +1594,13 @@ std::string cmGeneratorTarget::GetFrameworkDirectory(
return fpath;
}
-std::string cmGeneratorTarget::GetFullName(const std::string& config,
- bool implib) const
+std::string cmGeneratorTarget::GetFullName(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
if (this->IsImported()) {
- return this->GetFullNameImported(config, implib);
+ return this->GetFullNameImported(config, artifact);
}
- return this->GetFullNameInternal(config, implib);
+ return this->GetFullNameInternal(config, artifact);
}
std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
@@ -1881,13 +1893,11 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
}
}
-void cmGeneratorTarget::GetFullNameComponents(std::string& prefix,
- std::string& base,
- std::string& suffix,
- const std::string& config,
- bool implib) const
+void cmGeneratorTarget::GetFullNameComponents(
+ std::string& prefix, std::string& base, std::string& suffix,
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
- this->GetFullNameInternal(config, implib, prefix, base, suffix);
+ this->GetFullNameInternal(config, artifact, prefix, base, suffix);
}
std::string cmGeneratorTarget::BuildBundleDirectory(
@@ -1908,10 +1918,10 @@ std::string cmGeneratorTarget::BuildBundleDirectory(
}
std::string cmGeneratorTarget::GetMacContentDirectory(
- const std::string& config, bool implib) const
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
// Start with the output directory for the target.
- std::string fpath = this->GetDirectory(config, implib);
+ std::string fpath = this->GetDirectory(config, artifact);
fpath += "/";
BundleDirectoryLevel level = ContentLevel;
if (this->IsFrameworkOnApple()) {
@@ -2872,7 +2882,8 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const
}
// Get the directory.
- std::string dir = this->GetDirectory(config, false);
+ std::string dir =
+ this->GetDirectory(config, cmStateEnums::RuntimeBinaryArtifact);
// Add each name.
std::string f;
@@ -2901,7 +2912,7 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const
gg->AddToManifest(f);
}
if (!impName.empty()) {
- f = this->GetDirectory(config, true);
+ f = this->GetDirectory(config, cmStateEnums::ImportLibraryArtifact);
f += "/";
f += impName;
gg->AddToManifest(f);
@@ -2919,19 +2930,20 @@ std::string cmGeneratorTarget::GetImportedLibName(
}
std::string cmGeneratorTarget::GetFullPath(const std::string& config,
- bool implib, bool realname) const
+ cmStateEnums::ArtifactType artifact,
+ bool realname) const
{
if (this->IsImported()) {
- return this->Target->ImportedGetFullPath(config, implib);
+ return this->Target->ImportedGetFullPath(config, artifact);
}
- return this->NormalGetFullPath(config, implib, realname);
+ return this->NormalGetFullPath(config, artifact, realname);
}
-std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
- bool implib,
- bool realname) const
+std::string cmGeneratorTarget::NormalGetFullPath(
+ const std::string& config, cmStateEnums::ArtifactType artifact,
+ bool realname) const
{
- std::string fpath = this->GetDirectory(config, implib);
+ std::string fpath = this->GetDirectory(config, artifact);
fpath += "/";
if (this->IsAppBundleOnApple()) {
fpath = this->BuildBundleDirectory(fpath, config, FullLevel);
@@ -2939,12 +2951,18 @@ std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
}
// Add the full name of the target.
- if (implib) {
- fpath += this->GetFullName(config, true);
- } else if (realname) {
- fpath += this->NormalGetRealName(config);
- } else {
- fpath += this->GetFullName(config, false);
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ if (realname) {
+ fpath += this->NormalGetRealName(config);
+ } else {
+ fpath +=
+ this->GetFullName(config, cmStateEnums::RuntimeBinaryArtifact);
+ }
+ break;
+ case cmStateEnums::ImportLibraryArtifact:
+ fpath += this->GetFullName(config, cmStateEnums::ImportLibraryArtifact);
+ break;
}
return fpath;
}
@@ -3021,7 +3039,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
std::string prefix;
std::string base;
std::string suffix;
- this->GetFullNameInternal(config, false, prefix, base, suffix);
+ this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+ prefix, base, suffix);
// The library name.
name = prefix + base + suffix;
@@ -3046,7 +3065,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
// The import library name.
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->GetType() == cmStateEnums::MODULE_LIBRARY) {
- impName = this->GetFullNameInternal(config, true);
+ impName =
+ this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact);
} else {
impName = "";
}
@@ -3087,7 +3107,8 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
std::string prefix;
std::string base;
std::string suffix;
- this->GetFullNameInternal(config, false, prefix, base, suffix);
+ this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+ prefix, base, suffix);
// The executable name.
name = prefix + base + suffix;
@@ -3107,19 +3128,20 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
#endif
// The import library name.
- impName = this->GetFullNameInternal(config, true);
+ impName =
+ this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact);
// The program database file name.
pdbName = this->GetPDBName(config);
}
-std::string cmGeneratorTarget::GetFullNameInternal(const std::string& config,
- bool implib) const
+std::string cmGeneratorTarget::GetFullNameInternal(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
std::string prefix;
std::string base;
std::string suffix;
- this->GetFullNameInternal(config, implib, prefix, base, suffix);
+ this->GetFullNameInternal(config, artifact, prefix, base, suffix);
return prefix + base + suffix;
}
@@ -3128,22 +3150,21 @@ const char* cmGeneratorTarget::ImportedGetLocation(
{
static std::string location;
assert(this->IsImported());
- location = this->Target->ImportedGetFullPath(config, false);
+ location = this->Target->ImportedGetFullPath(
+ config, cmStateEnums::RuntimeBinaryArtifact);
return location.c_str();
}
-std::string cmGeneratorTarget::GetFullNameImported(const std::string& config,
- bool implib) const
+std::string cmGeneratorTarget::GetFullNameImported(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
return cmSystemTools::GetFilenameName(
- this->Target->ImportedGetFullPath(config, implib));
+ this->Target->ImportedGetFullPath(config, artifact));
}
-void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
- bool implib,
- std::string& outPrefix,
- std::string& outBase,
- std::string& outSuffix) const
+void cmGeneratorTarget::GetFullNameInternal(
+ const std::string& config, cmStateEnums::ArtifactType artifact,
+ std::string& outPrefix, std::string& outBase, std::string& outSuffix) const
{
// Use just the target name for non-main target types.
if (this->GetType() != cmStateEnums::STATIC_LIBRARY &&
@@ -3156,9 +3177,12 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
return;
}
+ const bool isImportedLibraryArtifact =
+ (artifact == cmStateEnums::ImportLibraryArtifact);
+
// Return an empty name for the import library if this platform
// does not support import libraries.
- if (implib &&
+ if (isImportedLibraryArtifact &&
!this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
outPrefix = "";
outBase = "";
@@ -3171,14 +3195,16 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
if (this->GetType() != cmStateEnums::SHARED_LIBRARY &&
this->GetType() != cmStateEnums::MODULE_LIBRARY &&
this->GetType() != cmStateEnums::EXECUTABLE) {
- implib = false;
+ artifact = cmStateEnums::RuntimeBinaryArtifact;
}
// Compute the full name for main target types.
- const char* targetPrefix = (implib ? this->GetProperty("IMPORT_PREFIX")
- : this->GetProperty("PREFIX"));
- const char* targetSuffix = (implib ? this->GetProperty("IMPORT_SUFFIX")
- : this->GetProperty("SUFFIX"));
+ const char* targetPrefix =
+ (isImportedLibraryArtifact ? this->GetProperty("IMPORT_PREFIX")
+ : this->GetProperty("PREFIX"));
+ const char* targetSuffix =
+ (isImportedLibraryArtifact ? this->GetProperty("IMPORT_SUFFIX")
+ : this->GetProperty("SUFFIX"));
const char* configPostfix = CM_NULLPTR;
if (!config.empty()) {
std::string configProp = cmSystemTools::UpperCase(config);
@@ -3190,8 +3216,8 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
configPostfix = CM_NULLPTR;
}
}
- const char* prefixVar = this->Target->GetPrefixVariableInternal(implib);
- const char* suffixVar = this->Target->GetSuffixVariableInternal(implib);
+ const char* prefixVar = this->Target->GetPrefixVariableInternal(artifact);
+ const char* suffixVar = this->Target->GetSuffixVariableInternal(artifact);
// Check for language-specific default prefix and suffix.
std::string ll = this->GetLinkerLanguage(config);
@@ -3235,14 +3261,15 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
outPrefix = targetPrefix ? targetPrefix : "";
// Append the target name or property-specified name.
- outBase += this->GetOutputName(config, implib);
+ outBase += this->GetOutputName(config, artifact);
// Append the per-configuration postfix.
outBase += configPostfix ? configPostfix : "";
// Name shared libraries with their version number on some platforms.
if (const char* soversion = this->GetProperty("SOVERSION")) {
- if (this->GetType() == cmStateEnums::SHARED_LIBRARY && !implib &&
+ if (this->GetType() == cmStateEnums::SHARED_LIBRARY &&
+ !isImportedLibraryArtifact &&
this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION")) {
outBase += "-";
outBase += soversion;
@@ -3264,7 +3291,8 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
std::string prefix;
std::string base;
std::string suffix;
- this->GetFullNameInternal(config, false, prefix, base, suffix);
+ this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+ prefix, base, suffix);
std::vector<std::string> props;
std::string configUpper = cmSystemTools::UpperCase(config);
@@ -4416,26 +4444,31 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries(
return iface.Exists ? &iface : CM_NULLPTR;
}
-std::string cmGeneratorTarget::GetDirectory(const std::string& config,
- bool implib) const
+std::string cmGeneratorTarget::GetDirectory(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
if (this->IsImported()) {
// Return the directory from which the target is imported.
return cmSystemTools::GetFilenamePath(
- this->Target->ImportedGetFullPath(config, implib));
+ this->Target->ImportedGetFullPath(config, artifact));
}
if (OutputInfo const* info = this->GetOutputInfo(config)) {
// Return the directory in which the target will be built.
- return implib ? info->ImpDir : info->OutDir;
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ return info->OutDir;
+ case cmStateEnums::ImportLibraryArtifact:
+ return info->ImpDir;
+ }
}
return "";
}
-bool cmGeneratorTarget::UsesDefaultOutputDir(const std::string& config,
- bool implib) const
+bool cmGeneratorTarget::UsesDefaultOutputDir(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
std::string dir;
- return this->ComputeOutputDir(config, implib, dir);
+ return this->ComputeOutputDir(config, artifact, dir);
}
cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
@@ -4469,8 +4502,10 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
i = this->OutputInfoMap.insert(entry).first;
// Compute output directories.
- this->ComputeOutputDir(config, false, info.OutDir);
- this->ComputeOutputDir(config, true, info.ImpDir);
+ this->ComputeOutputDir(config, cmStateEnums::RuntimeBinaryArtifact,
+ info.OutDir);
+ this->ComputeOutputDir(config, cmStateEnums::ImportLibraryArtifact,
+ info.ImpDir);
if (!this->ComputePDBOutputDir("PDB", config, info.PdbDir)) {
info.PdbDir = info.OutDir;
}
@@ -4490,14 +4525,15 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
}
bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
- bool implib, std::string& out) const
+ cmStateEnums::ArtifactType artifact,
+ std::string& out) const
{
bool usesDefaultOutputDir = false;
std::string conf = config;
// Look for a target property defining the target output directory
// based on the target type.
- std::string targetTypeName = this->GetOutputTargetType(implib);
+ std::string targetTypeName = this->GetOutputTargetType(artifact);
const char* propertyName = CM_NULLPTR;
std::string propertyNameStr = targetTypeName;
if (!propertyNameStr.empty()) {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index fd3f479..8a687e8 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -204,9 +204,12 @@ public:
/** Get the full path to the target according to the settings in its
makefile and the configuration type. */
- std::string GetFullPath(const std::string& config = "", bool implib = false,
- bool realname = false) const;
- std::string NormalGetFullPath(const std::string& config, bool implib,
+ std::string GetFullPath(
+ const std::string& config = "",
+ cmStateEnums::ArtifactType artifact = cmStateEnums::RuntimeBinaryArtifact,
+ bool realname = false) const;
+ std::string NormalGetFullPath(const std::string& config,
+ cmStateEnums::ArtifactType artifact,
bool realname) const;
std::string NormalGetRealName(const std::string& config) const;
@@ -234,7 +237,8 @@ public:
/** Get the full name of the target according to the settings in its
makefile. */
std::string GetFullName(const std::string& config = "",
- bool implib = false) const;
+ cmStateEnums::ArtifactType artifact =
+ cmStateEnums::RuntimeBinaryArtifact) const;
/** @return the Mac framework directory without the base. */
std::string GetFrameworkDirectory(const std::string& config,
@@ -279,7 +283,8 @@ public:
void GetFullNameComponents(std::string& prefix, std::string& base,
std::string& suffix,
const std::string& config = "",
- bool implib = false) const;
+ cmStateEnums::ArtifactType artifact =
+ cmStateEnums::RuntimeBinaryArtifact) const;
/** Append to @a base the bundle directory hierarchy up to a certain @a level
* and return it. */
@@ -288,8 +293,8 @@ public:
BundleDirectoryLevel level) const;
/** @return the mac content directory for this target. */
- std::string GetMacContentDirectory(const std::string& config = CM_NULLPTR,
- bool implib = false) const;
+ std::string GetMacContentDirectory(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const;
/** @return folder prefix for IDEs. */
std::string GetEffectiveFolderName() const;
@@ -356,7 +361,7 @@ public:
std::vector<cmGeneratorTarget*>& objlibs) const;
std::string GetFullNameImported(const std::string& config,
- bool implib) const;
+ cmStateEnums::ArtifactType artifact) const;
/** Get source files common to all configurations and diagnose cases
with per-config sources. Excludes sources added by a TARGET_OBJECTS
@@ -416,7 +421,8 @@ public:
subdirectory for that configuration. Otherwise just the canonical
output directory is given. */
std::string GetDirectory(const std::string& config = "",
- bool implib = false) const;
+ cmStateEnums::ArtifactType artifact =
+ cmStateEnums::RuntimeBinaryArtifact) const;
/** Get the directory in which to place the target compiler .pdb file.
If the configuration name is given then the generator will add its
@@ -430,7 +436,8 @@ public:
/** Return whether this target uses the default value for its output
directory. */
- bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
+ bool UsesDefaultOutputDir(const std::string& config,
+ cmStateEnums::ArtifactType artifact) const;
// Cache target output paths for each configuration.
struct OutputInfo
@@ -471,7 +478,8 @@ public:
std::string GetCompilePDBPath(const std::string& config = "") const;
// Get the target base name.
- std::string GetOutputName(const std::string& config, bool implib) const;
+ std::string GetOutputName(const std::string& config,
+ cmStateEnums::ArtifactType artifact) const;
void AddSource(const std::string& src);
void AddTracedSources(std::vector<std::string> const& srcs);
@@ -654,8 +662,9 @@ private:
mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
std::string GetFullNameInternal(const std::string& config,
- bool implib) const;
- void GetFullNameInternal(const std::string& config, bool implib,
+ cmStateEnums::ArtifactType artifact) const;
+ void GetFullNameInternal(const std::string& config,
+ cmStateEnums::ArtifactType artifact,
std::string& outPrefix, std::string& outBase,
std::string& outSuffix) const;
@@ -663,7 +672,7 @@ private:
mutable LinkClosureMapType LinkClosureMap;
// Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
- const char* GetOutputTargetType(bool implib) const;
+ const char* GetOutputTargetType(cmStateEnums::ArtifactType artifact) const;
void ComputeVersionedName(std::string& vName, std::string const& prefix,
std::string const& base, std::string const& suffix,
@@ -789,7 +798,8 @@ private:
cmLinkImplementationLibraries const* GetLinkImplementationLibrariesInternal(
const std::string& config, const cmGeneratorTarget* head) const;
- bool ComputeOutputDir(const std::string& config, bool implib,
+ bool ComputeOutputDir(const std::string& config,
+ cmStateEnums::ArtifactType artifact,
std::string& out) const;
typedef std::map<std::string, OutputInfo> OutputInfoMapType;
@@ -801,7 +811,7 @@ private:
void ComputeModuleDefinitionInfo(std::string const& config,
ModuleDefinitionInfo& info) const;
- typedef std::pair<std::string, bool> OutputNameKey;
+ typedef std::pair<std::string, cmStateEnums::ArtifactType> OutputNameKey;
typedef std::map<OutputNameKey, std::string> OutputNameMapType;
mutable OutputNameMapType OutputNameMap;
mutable std::set<cmLinkItem> UtilityItems;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index aae01ca..e61cbd9 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -246,7 +246,7 @@ void cmGlobalNinjaGenerator::WriteBuild(
bool useResponseFile = false;
if (cmdLineLimit < 0 ||
(cmdLineLimit > 0 &&
- (args.size() + buildstr.size() + assignments.size()) >
+ (args.size() + buildstr.size() + assignments.size() + 1000) >
static_cast<size_t>(cmdLineLimit))) {
variable_assignments.str(std::string());
cmGlobalNinjaGenerator::WriteVariable(variable_assignments, "RSP_FILE",
@@ -983,8 +983,8 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::STATIC_LIBRARY:
case cmStateEnums::MODULE_LIBRARY: {
- outputs.push_back(this->ConvertToNinjaPath(
- target->GetFullPath(configName, false, realname)));
+ outputs.push_back(this->ConvertToNinjaPath(target->GetFullPath(
+ configName, cmStateEnums::RuntimeBinaryArtifact, realname)));
break;
}
case cmStateEnums::OBJECT_LIBRARY:
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 3f8d381..aeceb8d 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -13,58 +13,6 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
: cmGlobalVisualStudio7Generator(cm, platformName)
{
this->ProjectConfigurationSectionName = "ProjectConfiguration";
- this->Version = VS71;
-}
-
-std::string cmGlobalVisualStudio71Generator::GetUserMacrosDirectory()
-{
- // Macros not supported on Visual Studio 7.1 and earlier because
- // they do not appear to work *during* a build when called by an
- // outside agent...
- //
- return "";
-
-#if 0
- //
- // The COM result from calling a Visual Studio macro with 7.1 indicates
- // that the call succeeds, but the macro does not appear to execute...
- //
- // So, I am leaving this code here to show how to do it, but have not
- // yet figured out what the issue is in terms of why the macro does not
- // appear to execute...
- //
- std::string base;
- std::string path;
-
- // base begins with the VisualStudioProjectsLocation reg value...
- if (cmSystemTools::ReadRegistryValue(
- "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\7.1;"
- "VisualStudioProjectsLocation",
- base))
- {
- cmSystemTools::ConvertToUnixSlashes(base);
-
- // 7.1 macros folder:
- path = base + "/VSMacros71";
- }
-
- // path is (correctly) still empty if we did not read the base value from
- // the Registry value
- return path;
-#endif
-}
-
-std::string cmGlobalVisualStudio71Generator::GetUserMacrosRegKeyBase()
-{
- // Macros not supported on Visual Studio 7.1 and earlier because
- // they do not appear to work *during* a build when called by an
- // outside agent...
- //
- return "";
-
-#if 0
- return "Software\\Microsoft\\VisualStudio\\7.1\\vsmacros";
-#endif
}
void cmGlobalVisualStudio71Generator::WriteSLNFile(
@@ -91,11 +39,6 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(
std::ostringstream targetsSlnString;
this->WriteTargetsToSolution(targetsSlnString, root, orderedProjectTargets);
- // VS 7 does not support folders specified first.
- if (this->GetVersion() <= VS71) {
- fout << targetsSlnString.str();
- }
-
// Generate folder specification.
bool useFolderProperty = this->UseFolderProperty();
if (useFolderProperty) {
@@ -103,9 +46,7 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(
}
// Now write the actual target specification content.
- if (this->GetVersion() > VS71) {
- fout << targetsSlnString.str();
- }
+ fout << targetsSlnString.str();
// Write out the configurations information for the solution
fout << "Global\n";
@@ -280,10 +221,3 @@ void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 8.00\n";
}
-
-void cmGlobalVisualStudio71Generator::GetDocumentation(
- cmDocumentationEntry& entry)
-{
- entry.Name = cmGlobalVisualStudio71Generator::GetActualName();
- entry.Brief = "Deprecated. Generates Visual Studio .NET 2003 project files.";
-}
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index c65a84a..0ce02aa 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -15,37 +15,8 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator
public:
cmGlobalVisualStudio71Generator(cmake* cm,
const std::string& platformName = "");
- static cmGlobalGeneratorFactory* NewFactory()
- {
- return new cmGlobalGeneratorSimpleFactory<
- cmGlobalVisualStudio71Generator>();
- }
-
- ///! Get the name for the generator.
- virtual std::string GetName() const
- {
- return cmGlobalVisualStudio71Generator::GetActualName();
- }
- static std::string GetActualName() { return "Visual Studio 7 .NET 2003"; }
-
- /** Get the documentation entry for this generator. */
- static void GetDocumentation(cmDocumentationEntry& entry);
-
- /**
- * Where does this version of Visual Studio look for macros for the
- * current user? Returns the empty string if this version of Visual
- * Studio does not implement support for VB macros.
- */
- virtual std::string GetUserMacrosDirectory();
-
- /**
- * What is the reg key path to "vsmacros" for this version of Visual
- * Studio?
- */
- virtual std::string GetUserMacrosRegKeyBase();
protected:
- virtual const char* GetIDEVersion() { return "7.1"; }
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
virtual void WriteSolutionConfigurations(
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 3849175..14ec72f 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -54,7 +54,6 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
this->DefaultPlatformName = platformName;
}
this->ExtraFlagTable = cmVS7ExtraFlagTable;
- this->Version = VS7;
}
cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator()
@@ -294,19 +293,6 @@ void cmGlobalVisualStudio7Generator::Generate()
if (!cmSystemTools::GetErrorOccuredFlag()) {
this->CallVisualStudioMacro(MacroReload);
}
-
- if (this->Version == VS71 && !this->CMakeInstance->GetIsInTryCompile()) {
- const char* cmakeWarnVS71 =
- this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS71");
- if (!cmakeWarnVS71 || !cmSystemTools::IsOff(cmakeWarnVS71)) {
- this->CMakeInstance->IssueMessage(
- cmake::WARNING,
- "The \"Visual Studio 7 .NET 2003\" generator is deprecated "
- "and will be removed in a future version of CMake."
- "\n"
- "Add CMAKE_WARN_VS71=OFF to the cache to disable this warning.");
- }
- }
}
void cmGlobalVisualStudio7Generator::OutputSLNFile(
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 634db7f..1fcb5ac 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -153,13 +153,6 @@ void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout)
fout << "# Visual Studio 2005\n";
}
-void cmGlobalVisualStudio8Generator::GetDocumentation(
- cmDocumentationEntry& entry)
-{
- entry.Name = cmGlobalVisualStudio8Generator::GetActualName();
- entry.Brief = "Generates Visual Studio 8 2005 project files.";
-}
-
std::string cmGlobalVisualStudio8Generator::GetGenerateStampList()
{
return "generate.stamp.list";
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 03fa077..4723b83 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -20,9 +20,6 @@ public:
///! Get the name for the generator.
virtual std::string GetName() const { return this->Name; }
- /** Get the documentation entry for this generator. */
- static void GetDocumentation(cmDocumentationEntry& entry);
-
/** Get the name of the main stamp list file. */
static std::string GetGenerateStampList();
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index 60344f3..c12a933 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -32,8 +32,6 @@ public:
/** Known versions of Visual Studio. */
enum VSVersion
{
- VS7 = 70,
- VS71 = 71,
VS8 = 80,
VS9 = 90,
VS10 = 100,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 8c1c0e7..4213751 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1817,7 +1817,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
gtgt->GetType() == cmStateEnums::MODULE_LIBRARY ||
gtgt->GetType() == cmStateEnums::EXECUTABLE) {
if (this->XcodeVersion >= 21) {
- if (!gtgt->UsesDefaultOutputDir(configName, false)) {
+ if (!gtgt->UsesDefaultOutputDir(configName,
+ cmStateEnums::RuntimeBinaryArtifact)) {
std::string pncdir = gtgt->GetDirectory(configName);
buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
this->CreateString(pncdir));
@@ -2009,6 +2010,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
BuildObjectListOrString dirs(this, this->XcodeVersion >= 30);
BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
+ BuildObjectListOrString sysdirs(this, this->XcodeVersion >= 30);
+ BuildObjectListOrString sysfdirs(this, this->XcodeVersion >= 30);
+ const bool emitSystemIncludes = this->XcodeVersion >= 83;
+
std::vector<std::string> includes;
this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, "C",
configName);
@@ -2022,11 +2027,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
frameworkDir += "/../";
frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
if (emitted.insert(frameworkDir).second) {
- fdirs.Add(this->XCodeEscapePath(frameworkDir));
+ std::string incpath = this->XCodeEscapePath(frameworkDir);
+ if (emitSystemIncludes &&
+ gtgt->IsSystemIncludeDirectory(frameworkDir, configName)) {
+ sysfdirs.Add(incpath);
+ } else {
+ fdirs.Add(incpath);
+ }
}
} else {
std::string incpath = this->XCodeEscapePath(*i);
- dirs.Add(incpath);
+ if (emitSystemIncludes &&
+ gtgt->IsSystemIncludeDirectory(*i, configName)) {
+ sysdirs.Add(incpath);
+ } else {
+ dirs.Add(incpath);
+ }
}
}
// Add framework search paths needed for linking.
@@ -2035,7 +2051,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
for (std::vector<std::string>::const_iterator fdi = fwDirs.begin();
fdi != fwDirs.end(); ++fdi) {
if (emitted.insert(*fdi).second) {
- fdirs.Add(this->XCodeEscapePath(*fdi));
+ std::string incpath = this->XCodeEscapePath(*fdi);
+ if (emitSystemIncludes &&
+ gtgt->IsSystemIncludeDirectory(*fdi, configName)) {
+ sysfdirs.Add(incpath);
+ } else {
+ fdirs.Add(incpath);
+ }
}
}
}
@@ -2045,8 +2067,16 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
if (!dirs.IsEmpty()) {
buildSettings->AddAttribute("HEADER_SEARCH_PATHS", dirs.CreateList());
}
+ if (!sysfdirs.IsEmpty()) {
+ buildSettings->AddAttribute("SYSTEM_FRAMEWORK_SEARCH_PATHS",
+ sysfdirs.CreateList());
+ }
+ if (!sysdirs.IsEmpty()) {
+ buildSettings->AddAttribute("SYSTEM_HEADER_SEARCH_PATHS",
+ sysdirs.CreateList());
+ }
- if (this->XcodeVersion >= 60) {
+ if (this->XcodeVersion >= 60 && !emitSystemIncludes) {
// Add those per-language flags in addition to HEADER_SEARCH_PATHS to gain
// system include directory awareness. We need to also keep on setting
// HEADER_SEARCH_PATHS to work around a missing compile options flag for
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 6ecf42d..1827ed3 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -103,7 +103,10 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
fromDirConfig += cmake::GetCMakeFilesDirectory();
fromDirConfig += "/CMakeRelink.dir/";
} else {
- fromDirConfig = this->Target->GetDirectory(config, this->ImportLibrary);
+ cmStateEnums::ArtifactType artifact = this->ImportLibrary
+ ? cmStateEnums::ImportLibraryArtifact
+ : cmStateEnums::RuntimeBinaryArtifact;
+ fromDirConfig = this->Target->GetDirectory(config, artifact);
fromDirConfig += "/";
}
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a36e1f6..f86c034 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -898,8 +898,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
// end of <Tool Name=VCMIDLTool
// Add manifest tool settings.
- if (targetBuilds &&
- this->GetVersion() >= cmGlobalVisualStudioGenerator::VS8) {
+ if (targetBuilds) {
const char* manifestTool = "VCManifestTool";
if (this->FortranProject) {
manifestTool = "VFManifestTool";
@@ -1040,8 +1039,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
fout << "\t\t\t<Tool\n"
<< "\t\t\t\tName=\"" << tool << "\"\n";
- if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 ||
- this->FortranProject) {
+ if (this->FortranProject) {
std::ostringstream libdeps;
this->Internal->OutputObjects(libdeps, target, configName);
if (!libdeps.str().empty()) {
@@ -1094,8 +1092,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
// libraries which may be set by the user to something bad.
fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) "
<< this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
- if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 ||
- this->FortranProject) {
+ if (this->FortranProject) {
this->Internal->OutputObjects(fout, target, configName, " ");
}
fout << " ";
@@ -1133,7 +1130,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
if (stackVal) {
fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n";
}
- temp = target->GetDirectory(configName, true);
+ temp =
+ target->GetDirectory(configName, cmStateEnums::ImportLibraryArtifact);
temp += "/";
temp += targetNameImport;
fout << "\t\t\t\tImportLibrary=\""
@@ -1179,8 +1177,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
// libraries which may be set by the user to something bad.
fout << "\t\t\t\tAdditionalDependencies=\"$(NOINHERIT) "
<< this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
- if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 ||
- this->FortranProject) {
+ if (this->FortranProject) {
this->Internal->OutputObjects(fout, target, configName, " ");
}
fout << " ";
@@ -1231,7 +1228,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
if (stackVal) {
fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"";
}
- temp = target->GetDirectory(configName, true);
+ temp =
+ target->GetDirectory(configName, cmStateEnums::ImportLibraryArtifact);
temp += "/";
temp += targetNameImport;
fout << "\t\t\t\tImportLibrary=\""
@@ -1376,10 +1374,9 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
cmSourceFile const* sf = sources[si].Source;
sourcesIndex[sf] = si;
if (!sf->GetObjectLibrary().empty()) {
- if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 ||
- this->FortranProject) {
- // VS < 8 does not support per-config source locations so we
- // list object library content on the link line instead.
+ if (this->FortranProject) {
+ // Intel Fortran does not support per-config source locations
+ // so we list object library content on the link line instead.
// See OutputObjects.
continue;
}
@@ -1962,11 +1959,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStart(
<< "<VisualStudioProject\n"
<< "\tProjectType=\"Visual C++\"\n";
/* clang-format on */
- if (gg->GetVersion() == cmGlobalVisualStudioGenerator::VS71) {
- fout << "\tVersion=\"7.10\"\n";
- } else {
- fout << "\tVersion=\"" << (gg->GetVersion() / 10) << ".00\"\n";
- }
+ fout << "\tVersion=\"" << (gg->GetVersion() / 10) << ".00\"\n";
const char* projLabel = target->GetProperty("PROJECT_LABEL");
if (!projLabel) {
projLabel = libName.c_str();
@@ -1976,9 +1969,7 @@ void cmLocalVisualStudio7Generator::WriteProjectStart(
keyword = "Win32Proj";
}
fout << "\tName=\"" << projLabel << "\"\n";
- if (gg->GetVersion() >= cmGlobalVisualStudioGenerator::VS8) {
- fout << "\tProjectGUID=\"{" << gg->GetGUID(libName.c_str()) << "}\"\n";
- }
+ fout << "\tProjectGUID=\"{" << gg->GetGUID(libName.c_str()) << "}\"\n";
this->WriteProjectSCC(fout, target);
if (const char* targetFrameworkVersion =
target->GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) {
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 60235d6..41025af 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -92,8 +92,10 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target,
!(isFortran && target->GetType() == cmStateEnums::SHARED_LIBRARY)) {
return pcc;
}
- std::string outDir = target->GetDirectory(config, false);
- std::string impDir = target->GetDirectory(config, true);
+ std::string outDir =
+ target->GetDirectory(config, cmStateEnums::RuntimeBinaryArtifact);
+ std::string impDir =
+ target->GetDirectory(config, cmStateEnums::ImportLibraryArtifact);
if (impDir == outDir) {
return pcc;
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 493f474..a93b42d 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -21,6 +21,7 @@
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
+#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cm_auto_ptr.hxx"
#include "cmake.h"
@@ -332,7 +333,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
} else {
cmSystemTools::MakeDirectory(outpath.c_str());
if (!targetNameImport.empty()) {
- outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
+ outpathImp = this->GeneratorTarget->GetDirectory(
+ this->ConfigName, cmStateEnums::ImportLibraryArtifact);
cmSystemTools::MakeDirectory(outpathImp.c_str());
outpathImp += "/";
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index cc8a6b3..e017b29 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -514,7 +514,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
cmSystemTools::MakeDirectory(outpath.c_str());
outpath += "/";
if (!targetNameImport.empty()) {
- outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
+ outpathImp = this->GeneratorTarget->GetDirectory(
+ this->ConfigName, cmStateEnums::ImportLibraryArtifact);
cmSystemTools::MakeDirectory(outpathImp.c_str());
outpathImp += "/";
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 92796ba..9c0520e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -30,10 +30,6 @@
#include "cm_auto_ptr.hxx"
#include "cmake.h"
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
: cmCommonTargetGenerator(target)
, OSXBundleGenerator(CM_NULLPTR)
@@ -509,8 +505,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY ||
this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) {
- targetFullPathReal =
- this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
+ targetFullPathReal = this->GeneratorTarget->GetFullPath(
+ this->ConfigName, cmStateEnums::RuntimeBinaryArtifact, true);
targetFullPathPDB =
this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
targetFullPathPDB += "/";
@@ -1495,15 +1491,6 @@ void cmMakefileTargetGenerator::CreateLinkScript(
makefile_depends.push_back(linkScriptName);
}
-static size_t calculateCommandLineLengthLimit()
-{
-#if defined(_SC_ARG_MAX)
- return ((size_t)sysconf(_SC_ARG_MAX)) - 1000;
-#else
- return 0;
-#endif
-}
-
bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
std::string const& l) const
{
@@ -1517,7 +1504,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
}
// Check for a system limit.
- if (size_t const limit = calculateCommandLineLengthLimit()) {
+ if (size_t const limit = cmSystemTools::CalculateCommandLineLengthLimit()) {
// Compute the total length of our list of object files with room
// for argument separation and quoting. This does not convert paths
// relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so the
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index aaeb659..cfc91bd 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -5,11 +5,9 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
-#include <limits>
#include <map>
#include <set>
#include <sstream>
-#include <stddef.h>
#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
@@ -35,10 +33,6 @@
#include "cm_auto_ptr.hxx"
#include "cmake.h"
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
cmGeneratorTarget* target)
: cmNinjaTargetGenerator(target)
@@ -491,10 +485,9 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
cmGeneratorTarget& gt = *this->GetGeneratorTarget();
const std::string cfgName = this->GetConfigName();
std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName));
- std::string targetOutputReal =
- this->ConvertToNinjaPath(gt.GetFullPath(cfgName,
- /*implib=*/false,
- /*realname=*/true));
+ std::string targetOutputReal = this->ConvertToNinjaPath(
+ gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
+ /*realname=*/true));
cmakeCommand += targetOutputReal;
cmakeCommand += " || true";
linkCmds.push_back(cmakeCommand);
@@ -546,36 +539,6 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
return std::vector<std::string>();
}
-static int calculateCommandLineLengthLimit(int linkRuleLength)
-{
- static int const limits[] = {
-#ifdef _WIN32
- 8000,
-#endif
-#if defined(__linux)
- // #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h
- ((int)sysconf(_SC_PAGESIZE) * 32) - 1000,
-#endif
- std::numeric_limits<int>::max()
- };
-
- size_t const arrSz = cmArraySize(limits);
- int sz = *std::min_element(limits, limits + arrSz);
-#if defined(_SC_ARG_MAX)
- // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
- int const szArgMax = static_cast<int>(sysconf(_SC_ARG_MAX));
- // a return value of -1 signifies an unrestricted value
- if (szArgMax != -1) {
- sz = std::min(sz, szArgMax - 1000);
- }
-#endif
- if (sz == std::numeric_limits<int>::max()) {
- return 0;
- }
-
- return sz - linkRuleLength;
-}
-
void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
{
cmGeneratorTarget& genTarget = *this->GetGeneratorTarget();
@@ -616,9 +579,8 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
std::string const targetOutputReal = ConvertToNinjaPath(
genTarget.ObjectDirectory + "cmake_device_link" + objExt);
- std::string const targetOutputImplib =
- ConvertToNinjaPath(genTarget.GetFullPath(cfgName,
- /*implib=*/true));
+ std::string const targetOutputImplib = ConvertToNinjaPath(
+ genTarget.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
this->DeviceLinkObject = targetOutputReal;
@@ -761,8 +723,9 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
// Device linking currently doesn't support response files so
// do not check if the user has explicitly forced a response file.
- int const commandLineLengthLimit = calculateCommandLineLengthLimit(
- globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule()));
+ int const commandLineLengthLimit =
+ static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
+ globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule());
const std::string rspfile =
std::string(cmake::GetCMakeFilesDirectoryPostSlash()) +
@@ -788,13 +751,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmGeneratorTarget& gt = *this->GetGeneratorTarget();
const std::string cfgName = this->GetConfigName();
std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName));
- std::string targetOutputReal =
- ConvertToNinjaPath(gt.GetFullPath(cfgName,
- /*implib=*/false,
- /*realname=*/true));
- std::string targetOutputImplib =
- ConvertToNinjaPath(gt.GetFullPath(cfgName,
- /*implib=*/true));
+ std::string targetOutputReal = ConvertToNinjaPath(
+ gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
+ /*realname=*/true));
+ std::string targetOutputImplib = ConvertToNinjaPath(
+ gt.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
if (gt.IsAppBundleOnApple()) {
// Create the app bundle
@@ -1048,8 +1009,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
!(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA");
int commandLineLengthLimit = -1;
if (!lang_supports_response || !this->ForceResponseFile()) {
- commandLineLengthLimit = calculateCommandLineLengthLimit(
- globalGen.GetRuleCmdLength(this->LanguageLinkerRule()));
+ commandLineLengthLimit =
+ static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
+ globalGen.GetRuleCmdLength(this->LanguageLinkerRule());
}
const std::string rspfile =
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index c09feef..332fa83 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
@@ -213,8 +214,8 @@ std::string cmOSXBundleGenerator::InitMacOSXContentDirectory(
{
// Construct the full path to the content subdirectory.
- std::string macdir = this->GT->GetMacContentDirectory(this->ConfigName,
- /*implib*/ false);
+ std::string macdir = this->GT->GetMacContentDirectory(
+ this->ConfigName, cmStateEnums::RuntimeBinaryArtifact);
macdir += "/";
macdir += pkgloc;
cmSystemTools::MakeDirectory(macdir.c_str());
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index e6d9a9f..239b18d 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -96,6 +96,41 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target)
return qtMajorVersion;
}
+static std::string GetQtMinorVersion(cmGeneratorTarget const* target,
+ const std::string& qtMajorVersion)
+{
+ cmMakefile* makefile = target->Target->GetMakefile();
+ std::string qtMinorVersion;
+ if (qtMajorVersion == "5") {
+ qtMinorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MINOR");
+ }
+ if (qtMinorVersion.empty()) {
+ qtMinorVersion = makefile->GetSafeDefinition("QT_VERSION_MINOR");
+ }
+
+ const char* targetQtVersion =
+ target->GetLinkInterfaceDependentStringProperty("QT_MINOR_VERSION", "");
+ if (targetQtVersion != CM_NULLPTR) {
+ qtMinorVersion = targetQtVersion;
+ }
+ return qtMinorVersion;
+}
+
+static bool QtVersionGreaterOrEqual(const std::string& major,
+ const std::string& minor,
+ unsigned long requestMajor,
+ unsigned long requestMinor)
+{
+ unsigned long majorUL(0);
+ unsigned long minorUL(0);
+ if (cmSystemTools::StringToULong(major.c_str(), &majorUL) &&
+ cmSystemTools::StringToULong(minor.c_str(), &minorUL)) {
+ return (majorUL > requestMajor) ||
+ (majorUL == requestMajor && minorUL >= requestMinor);
+ }
+ return false;
+}
+
static void GetCompileDefinitionsAndDirectories(
cmGeneratorTarget const* target, const std::string& config,
std::string& incs, std::string& defs)
@@ -258,6 +293,12 @@ static void MocSetupAutoTarget(
AddDefinitionEscaped(makefile, "_moc_depend_filters",
GetSafeProperty(target, "AUTOMOC_DEPEND_FILTERS"));
+ if (QtVersionGreaterOrEqual(
+ qtMajorVersion, GetQtMinorVersion(target, qtMajorVersion), 5, 8)) {
+ AddDefinitionEscaped(
+ makefile, "_moc_predefs_cmd",
+ makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_PREDEFINES_COMMAND"));
+ }
// Moc includes and compile definitions
{
std::string _moc_incs;
@@ -681,11 +722,11 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
if (gg->GetName().find("Visual Studio") != std::string::npos) {
cmGlobalVisualStudioGenerator* vsgg =
static_cast<cmGlobalVisualStudioGenerator*>(gg);
- // Under VS >= 7 use a PRE_BUILD event instead of a separate target to
+ // Under VS use a PRE_BUILD event instead of a separate target to
// reduce the number of targets loaded into the IDE.
// This also works around a VS 11 bug that may skip updating the target:
// https://connect.microsoft.com/VisualStudio/feedback/details/769495
- usePRE_BUILD = vsgg->GetVersion() >= cmGlobalVisualStudioGenerator::VS7;
+ usePRE_BUILD = true;
}
#endif
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 88ec9e8..d142693 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -360,6 +360,8 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
InfoGet(makefile, "AM_QT_MOC_EXECUTABLE", this->MocExecutable);
InfoGet(makefile, "AM_QT_UIC_EXECUTABLE", this->UicExecutable);
InfoGet(makefile, "AM_QT_RCC_EXECUTABLE", this->RccExecutable);
+
+ InfoGet(makefile, "AM_MOC_PREDEFS_CMD", this->MocPredefsCmd);
// Check Qt version
if ((this->QtMajorVersion != "4") && (this->QtMajorVersion != "5")) {
this->LogError("AutoGen: Error: Unsupported Qt version: " +
@@ -579,6 +581,12 @@ void cmQtAutoGenerators::Init(cmMakefile* makefile)
this->MocCppFilenameAbs = this->CurrentBinaryDir + this->MocCppFilenameRel;
+ // Moc predefs file
+ if (!this->MocPredefsCmd.empty()) {
+ this->MocPredefsFileRel = this->AutogenBuildSubDir + "moc_predefs.h";
+ this->MocPredefsFileAbs = this->CurrentBinaryDir + this->MocPredefsFileRel;
+ }
+
// Init file path checksum generator
fpathCheckSum.setupParentDirs(this->CurrentSourceDir, this->CurrentBinaryDir,
this->ProjectSourceDir,
@@ -1142,6 +1150,50 @@ bool cmQtAutoGenerators::MocGenerateAll(
return true;
}
+ // Generate moc_predefs
+ if (!this->MocPredefsCmd.empty()) {
+ if (!this->MakeParentDirectory(this->MocPredefsFileAbs)) {
+ this->LogError("AutoMoc: Error creating directory for " +
+ this->MocPredefsFileRel);
+ return false;
+ }
+ this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel);
+
+ std::vector<std::string> cmd = this->MocPredefsCmd;
+ cmd.insert(cmd.end(), this->MocIncludes.begin(), this->MocIncludes.end());
+ for (std::vector<std::string>::const_iterator it =
+ this->MocDefinitions.begin();
+ it != this->MocDefinitions.end(); ++it) {
+ cmd.push_back("-D" + (*it));
+ }
+ cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end());
+
+ std::string output;
+ bool moc_predefsGenerated = this->RunCommand(cmd, output, false);
+ if (!moc_predefsGenerated) {
+ return false;
+ }
+
+ // actually write the file
+ cmsys::ofstream outfile;
+ outfile.open(this->MocPredefsFileAbs.c_str(), std::ios::trunc);
+ if (!outfile) {
+ moc_predefsGenerated = false;
+ this->LogError("AutoMoc: Error opening " + this->MocPredefsFileRel);
+ } else {
+ outfile << output;
+ // Check for write errors
+ if (!outfile.good()) {
+ moc_predefsGenerated = false;
+ this->LogError("AutoMoc: Error writing " + this->MocPredefsFileRel);
+ }
+ }
+
+ if (!moc_predefsGenerated) {
+ return false;
+ }
+ }
+
bool mocCompFileGenerated = false;
bool mocCompChanged = false;
@@ -1305,6 +1357,10 @@ bool cmQtAutoGenerators::MocGenerateFile(
cmd.push_back("-D" + (*it));
}
cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end());
+ if (!this->MocPredefsFileAbs.empty()) {
+ cmd.push_back("--include");
+ cmd.push_back(this->MocPredefsFileAbs);
+ }
#ifdef _WIN32
cmd.push_back("-DWIN32");
#endif
@@ -1805,7 +1861,7 @@ bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename) const
* @return True on success
*/
bool cmQtAutoGenerators::RunCommand(const std::vector<std::string>& command,
- std::string& output) const
+ std::string& output, bool verbose) const
{
// Log command
if (this->Verbose) {
@@ -1813,8 +1869,9 @@ bool cmQtAutoGenerators::RunCommand(const std::vector<std::string>& command,
}
// Execute command
int retVal = 0;
- bool res =
- cmSystemTools::RunSingleCommand(command, &output, &output, &retVal);
+ bool res = cmSystemTools::RunSingleCommand(
+ command, &output, &output, &retVal, CM_NULLPTR,
+ verbose ? cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE);
return (res && (retVal == 0));
}
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index d359059..24c0a33 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -143,8 +143,8 @@ private:
const char* basePrefix,
const char* baseSuffix) const;
bool MakeParentDirectory(const std::string& filename) const;
- bool RunCommand(const std::vector<std::string>& command,
- std::string& output) const;
+ bool RunCommand(const std::vector<std::string>& command, std::string& output,
+ bool verbose = true) const;
bool FindHeader(std::string& header, const std::string& testBasePath) const;
@@ -177,6 +177,8 @@ private:
// - Moc
std::string MocCppFilenameRel;
std::string MocCppFilenameAbs;
+ std::string MocPredefsFileRel;
+ std::string MocPredefsFileAbs;
std::vector<std::string> MocSkipList;
std::vector<std::string> MocIncludePaths;
std::vector<std::string> MocIncludes;
@@ -198,6 +200,8 @@ private:
MacroFilter MacroFilters[2];
cmsys::RegularExpression RegExpMocInclude;
cmsys::RegularExpression RegExpUicInclude;
+ // - moc_predefs
+ std::vector<std::string> MocPredefsCmd;
// - Flags
bool IncludeProjectDirsBefore;
bool Verbose;
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index a5c1a23..8227ab7 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -763,9 +763,11 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
if (target->HaveWellDefinedOutputFiles()) {
Json::Value artifacts = Json::arrayValue;
- artifacts.append(target->GetFullPath(config, false));
+ artifacts.append(
+ target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact));
if (target->IsDLLPlatform()) {
- artifacts.append(target->GetFullPath(config, true));
+ artifacts.append(
+ target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
const cmGeneratorTarget::OutputInfo* output =
target->GetOutputInfo(config);
if (output && !output->PdbDir.empty()) {
diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h
index b2b12b4..7d6158e 100644
--- a/Source/cmStateTypes.h
+++ b/Source/cmStateTypes.h
@@ -53,6 +53,12 @@ enum CacheEntryType
STATIC,
UNINITIALIZED
};
+
+enum ArtifactType
+{
+ RuntimeBinaryArtifact,
+ ImportLibraryArtifact
+};
}
#endif
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 8dc6571..39625ae 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -570,6 +570,46 @@ std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
return args;
}
+size_t cmSystemTools::CalculateCommandLineLengthLimit()
+{
+ size_t sz =
+#ifdef _WIN32
+ // There's a maximum of 65536 bytes and thus 32768 WCHARs on Windows
+ // However, cmd.exe itself can only handle 8191 WCHARs and Ninja for
+ // example uses it to spawn processes.
+ size_t(8191);
+#elif defined(__linux)
+ // MAX_ARG_STRLEN is the maximum length of a string permissible for
+ // the execve() syscall on Linux. It's defined as (PAGE_SIZE * 32)
+ // in Linux's binfmts.h
+ static_cast<size_t>(sysconf(_SC_PAGESIZE) * 32);
+#else
+ size_t(0);
+#endif
+
+#if defined(_SC_ARG_MAX)
+ // ARG_MAX is the maximum size of the command and environment
+ // that can be passed to the exec functions on UNIX.
+ // The value in limits.h does not need to be present and may
+ // depend upon runtime memory constraints, hence sysconf()
+ // should be used to query it.
+ long szArgMax = sysconf(_SC_ARG_MAX);
+ // A return value of -1 signifies an undetermined limit, but
+ // it does not imply an infinite limit, and thus is ignored.
+ if (szArgMax != -1) {
+ // We estimate the size of the environment block to be 1000.
+ // This isn't accurate at all, but leaves some headroom.
+ szArgMax = szArgMax < 1000 ? 0 : szArgMax - 1000;
+#if defined(_WIN32) || defined(__linux)
+ sz = std::min(sz, static_cast<size_t>(szArgMax));
+#else
+ sz = static_cast<size_t>(szArgMax);
+#endif
+ }
+#endif
+ return sz;
+}
+
bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
std::string* captureStdOut,
std::string* captureStdErr, int* retVal,
@@ -617,8 +657,6 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) >
0) {
// Translate NULL characters in the output into valid text.
- // Visual Studio 7 puts these characters in the output of its
- // build process.
for (int i = 0; i < length; ++i) {
if (data[i] == '\0') {
data[i] = ' ';
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 86d92be..a8a9995 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -253,6 +253,8 @@ public:
static void ParseUnixCommandLine(const char* command,
std::vector<std::string>& args);
+ static size_t CalculateCommandLineLengthLimit();
+
static void EnableMessages() { s_DisableMessages = false; }
static void DisableMessages() { s_DisableMessages = true; }
static void DisableRunCommandOutput() { s_DisableRunCommandOutput = true; }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a1e5a47..f675833 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -35,7 +35,7 @@ const char* cmTargetPropertyComputer::ComputeLocationForBuild<cmTarget>(
{
static std::string loc;
if (tgt->IsImported()) {
- loc = tgt->ImportedGetFullPath("", false);
+ loc = tgt->ImportedGetFullPath("", cmStateEnums::RuntimeBinaryArtifact);
return loc.c_str();
}
@@ -54,7 +54,8 @@ const char* cmTargetPropertyComputer::ComputeLocation<cmTarget>(
{
static std::string loc;
if (tgt->IsImported()) {
- loc = tgt->ImportedGetFullPath(config, false);
+ loc =
+ tgt->ImportedGetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
return loc.c_str();
}
@@ -63,7 +64,7 @@ const char* cmTargetPropertyComputer::ComputeLocation<cmTarget>(
gg->CreateGenerationObjects();
}
cmGeneratorTarget* gt = gg->FindGeneratorTarget(tgt->GetName());
- loc = gt->GetFullPath(config, false);
+ loc = gt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
return loc.c_str();
}
@@ -1302,58 +1303,88 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const
return cmSystemTools::IsOn(this->GetProperty(prop));
}
-const char* cmTarget::GetSuffixVariableInternal(bool implib) const
+const char* cmTarget::GetSuffixVariableInternal(
+ cmStateEnums::ArtifactType artifact) const
{
switch (this->GetType()) {
case cmStateEnums::STATIC_LIBRARY:
return "CMAKE_STATIC_LIBRARY_SUFFIX";
case cmStateEnums::SHARED_LIBRARY:
- return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
- : "CMAKE_SHARED_LIBRARY_SUFFIX");
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ return "CMAKE_SHARED_LIBRARY_SUFFIX";
+ case cmStateEnums::ImportLibraryArtifact:
+ return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+ }
+ break;
case cmStateEnums::MODULE_LIBRARY:
- return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
- : "CMAKE_SHARED_MODULE_SUFFIX");
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ return "CMAKE_SHARED_MODULE_SUFFIX";
+ case cmStateEnums::ImportLibraryArtifact:
+ return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+ }
+ break;
case cmStateEnums::EXECUTABLE:
- return (implib
- ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
- // Android GUI application packages store the native
- // binary as a shared library.
- : (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
- ? "CMAKE_SHARED_LIBRARY_SUFFIX"
- : "CMAKE_EXECUTABLE_SUFFIX"));
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ // Android GUI application packages store the native
+ // binary as a shared library.
+ return (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+ ? "CMAKE_SHARED_LIBRARY_SUFFIX"
+ : "CMAKE_EXECUTABLE_SUFFIX");
+ case cmStateEnums::ImportLibraryArtifact:
+ return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+ }
+ break;
default:
break;
}
return "";
}
-const char* cmTarget::GetPrefixVariableInternal(bool implib) const
+const char* cmTarget::GetPrefixVariableInternal(
+ cmStateEnums::ArtifactType artifact) const
{
switch (this->GetType()) {
case cmStateEnums::STATIC_LIBRARY:
return "CMAKE_STATIC_LIBRARY_PREFIX";
case cmStateEnums::SHARED_LIBRARY:
- return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX"
- : "CMAKE_SHARED_LIBRARY_PREFIX");
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ return "CMAKE_SHARED_LIBRARY_PREFIX";
+ case cmStateEnums::ImportLibraryArtifact:
+ return "CMAKE_IMPORT_LIBRARY_PREFIX";
+ }
+ break;
case cmStateEnums::MODULE_LIBRARY:
- return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX"
- : "CMAKE_SHARED_MODULE_PREFIX");
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ return "CMAKE_SHARED_MODULE_PREFIX";
+ case cmStateEnums::ImportLibraryArtifact:
+ return "CMAKE_IMPORT_LIBRARY_PREFIX";
+ }
+ break;
case cmStateEnums::EXECUTABLE:
- return (implib
- ? "CMAKE_IMPORT_LIBRARY_PREFIX"
- // Android GUI application packages store the native
- // binary as a shared library.
- : (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
- ? "CMAKE_SHARED_LIBRARY_PREFIX"
- : ""));
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ // Android GUI application packages store the native
+ // binary as a shared library.
+ return (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+ ? "CMAKE_SHARED_LIBRARY_PREFIX"
+ : "");
+ case cmStateEnums::ImportLibraryArtifact:
+ return "CMAKE_IMPORT_LIBRARY_PREFIX";
+ }
+ break;
default:
break;
}
return "";
}
-std::string cmTarget::ImportedGetFullPath(const std::string& config,
- bool pimplib) const
+std::string cmTarget::ImportedGetFullPath(
+ const std::string& config, cmStateEnums::ArtifactType artifact) const
{
assert(this->IsImported());
@@ -1372,32 +1403,37 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config,
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
this->GetMappedConfig(desired_config, &loc, &imp, suffix)) {
- if (!pimplib) {
- if (loc) {
- result = loc;
- } else {
- std::string impProp = "IMPORTED_LOCATION";
- impProp += suffix;
- if (const char* config_location = this->GetProperty(impProp)) {
- result = config_location;
- } else if (const char* location =
- this->GetProperty("IMPORTED_LOCATION")) {
- result = location;
+ switch (artifact) {
+ case cmStateEnums::RuntimeBinaryArtifact:
+ if (loc) {
+ result = loc;
+ } else {
+ std::string impProp = "IMPORTED_LOCATION";
+ impProp += suffix;
+ if (const char* config_location = this->GetProperty(impProp)) {
+ result = config_location;
+ } else if (const char* location =
+ this->GetProperty("IMPORTED_LOCATION")) {
+ result = location;
+ }
}
- }
- } else {
- if (imp) {
- result = imp;
- } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->IsExecutableWithExports()) {
- std::string impProp = "IMPORTED_IMPLIB";
- impProp += suffix;
- if (const char* config_implib = this->GetProperty(impProp)) {
- result = config_implib;
- } else if (const char* implib = this->GetProperty("IMPORTED_IMPLIB")) {
- result = implib;
+ break;
+
+ case cmStateEnums::ImportLibraryArtifact:
+ if (imp) {
+ result = imp;
+ } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->IsExecutableWithExports()) {
+ std::string impProp = "IMPORTED_IMPLIB";
+ impProp += suffix;
+ if (const char* config_implib = this->GetProperty(impProp)) {
+ result = config_implib;
+ } else if (const char* implib =
+ this->GetProperty("IMPORTED_IMPLIB")) {
+ result = implib;
+ }
}
- }
+ break;
}
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c67143a..1f00c01 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -267,11 +267,13 @@ public:
};
std::string ImportedGetFullPath(const std::string& config,
- bool implib) const;
+ cmStateEnums::ArtifactType artifact) const;
private:
- const char* GetSuffixVariableInternal(bool implib) const;
- const char* GetPrefixVariableInternal(bool implib) const;
+ const char* GetSuffixVariableInternal(
+ cmStateEnums::ArtifactType artifact) const;
+ const char* GetPrefixVariableInternal(
+ cmStateEnums::ArtifactType artifact) const;
// Use a makefile variable to set a default for the given property.
// If the variable is not defined use the given default instead.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 0aadcbf..d83662e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1051,8 +1051,8 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
std::string postfixName = cmSystemTools::UpperCase(config);
postfixName += "_POSTFIX";
- std::string assemblyName =
- this->GeneratorTarget->GetOutputName(config, false);
+ std::string assemblyName = this->GeneratorTarget->GetOutputName(
+ config, cmStateEnums::RuntimeBinaryArtifact);
if (const char* postfix = this->GeneratorTarget->GetProperty(postfixName)) {
assemblyName += postfix;
}
@@ -3020,8 +3020,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
pdb += "/";
pdb += targetNamePDB;
- std::string imLib =
- this->GeneratorTarget->GetDirectory(config.c_str(), true);
+ std::string imLib = this->GeneratorTarget->GetDirectory(
+ config.c_str(), cmStateEnums::ImportLibraryArtifact);
imLib += "/";
imLib += targetNameImport;
@@ -3401,13 +3401,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
this->ConvertToWindowsSlash(path);
(*this->BuildFileStream) << cmVS10EscapeXML(path) << "\">\n";
this->WriteString("<Project>", 3);
- if (csproj == this->ProjectType) {
- (*this->BuildFileStream) << "{";
- }
- (*this->BuildFileStream) << this->GlobalGenerator->GetGUID(name.c_str());
- if (csproj == this->ProjectType) {
- (*this->BuildFileStream) << "}";
- }
+ (*this->BuildFileStream)
+ << "{" << this->GlobalGenerator->GetGUID(name.c_str()) << "}";
(*this->BuildFileStream) << "</Project>\n";
this->WriteString("<Name>", 3);
(*this->BuildFileStream) << name << "</Name>\n";
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index abc4924..1f808c8 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -101,10 +101,6 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
// the flag to disable exception handling. When the user does
// remove the flag we need to override the IDE default of on.
switch (this->Version) {
- case cmGlobalVisualStudioGenerator::VS7:
- case cmGlobalVisualStudioGenerator::VS71:
- this->FlagMap["ExceptionHandling"] = "FALSE";
- break;
case cmGlobalVisualStudioGenerator::VS10:
case cmGlobalVisualStudioGenerator::VS11:
case cmGlobalVisualStudioGenerator::VS12:
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f0ae316..737587d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -63,7 +63,6 @@
#include "cmGlobalVisualStudio12Generator.h"
#include "cmGlobalVisualStudio14Generator.h"
#include "cmGlobalVisualStudio15Generator.h"
-#include "cmGlobalVisualStudio71Generator.h"
#include "cmGlobalVisualStudio8Generator.h"
#include "cmGlobalVisualStudio9Generator.h"
#include "cmVSSetupHelper.h"
@@ -1461,8 +1460,7 @@ void cmake::CreateDefaultGlobalGenerator()
{ "11.0", "Visual Studio 11 2012" }, //
{ "10.0", "Visual Studio 10 2010" }, //
{ "9.0", "Visual Studio 9 2008" }, //
- { "8.0", "Visual Studio 8 2005" }, //
- { "7.1", "Visual Studio 7 .NET 2003" }
+ { "8.0", "Visual Studio 8 2005" }
};
static const char* const vsEntries[] = {
"\\Setup\\VC;ProductDir", //
@@ -1672,7 +1670,6 @@ void cmake::AddDefaultGenerators()
this->Generators.push_back(cmGlobalVisualStudio10Generator::NewFactory());
this->Generators.push_back(cmGlobalVisualStudio9Generator::NewFactory());
this->Generators.push_back(cmGlobalVisualStudio8Generator::NewFactory());
- this->Generators.push_back(cmGlobalVisualStudio71Generator::NewFactory());
this->Generators.push_back(cmGlobalBorlandMakefileGenerator::NewFactory());
this->Generators.push_back(cmGlobalNMakeMakefileGenerator::NewFactory());
this->Generators.push_back(cmGlobalJOMMakefileGenerator::NewFactory());
diff --git a/Source/kwsys/.gitattributes b/Source/kwsys/.gitattributes
index 3583f39..7065eb5 100644
--- a/Source/kwsys/.gitattributes
+++ b/Source/kwsys/.gitattributes
@@ -1,15 +1,13 @@
.git* export-ignore
-*.c our-c-style
-*.c.in our-c-style
-*.cxx our-c-style
-*.h our-c-style
-*.h.in our-c-style
-*.hxx our-c-style
-*.hxx.in our-c-style
+*.c kwsys-c-style
+*.c.in kwsys-c-style
+*.cxx kwsys-c-style
+*.h kwsys-c-style
+*.h.in kwsys-c-style
+*.hxx kwsys-c-style
+*.hxx.in kwsys-c-style
*.cmake whitespace=tab-in-indent
*.rst whitespace=tab-in-indent conflict-marker-size=79
*.txt whitespace=tab-in-indent
-
-* -format.clang-format
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 28fe9e7..e15b49e 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -69,6 +69,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
FOREACH(p
CMP0025 # CMake 3.0, Compiler id for Apple Clang is now AppleClang.
+ CMP0048 # CMake 3.0, Let the project command manage version variables.
CMP0056 # CMake 3.2, Honor link flags in try_compile() source-file signature.
CMP0063 # CMake 3.3, Honor visibility properties for all target types.
)
diff --git a/Source/kwsys/Encoding.hxx.in b/Source/kwsys/Encoding.hxx.in
index bf93f50..09691fd 100644
--- a/Source/kwsys/Encoding.hxx.in
+++ b/Source/kwsys/Encoding.hxx.in
@@ -59,6 +59,17 @@ public:
static std::string ToNarrow(const std::wstring& str);
static std::string ToNarrow(const wchar_t* str);
+#if defined(_WIN32)
+ /**
+ * Convert the path to an extended length path to avoid MAX_PATH length
+ * limitations on Windows. If the input is a local path the result will be
+ * prefixed with \\?\; if the input is instead a network path, the result
+ * will be prefixed with \\?\UNC\. All output will also be converted to
+ * absolute paths with Windows-style backslashes.
+ **/
+ static std::wstring ToWindowsExtendedPath(std::string const&);
+#endif
+
#endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING
}; // class Encoding
diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx
index e904c1a..641c0e6 100644
--- a/Source/kwsys/EncodingCXX.cxx
+++ b/Source/kwsys/EncodingCXX.cxx
@@ -29,6 +29,7 @@
#if defined(_WIN32)
#include <windows.h>
+#include <ctype.h>
#include <shellapi.h>
#endif
@@ -214,6 +215,63 @@ std::string Encoding::ToNarrow(const wchar_t* wcstr)
}
return str;
}
+
+#if defined(_WIN32)
+// Convert local paths to UNC style paths
+std::wstring Encoding::ToWindowsExtendedPath(std::string const& source)
+{
+ std::wstring wsource = Encoding::ToWide(source);
+
+ // Resolve any relative paths
+ DWORD wfull_len;
+
+ /* The +3 is a workaround for a bug in some versions of GetFullPathNameW that
+ * won't return a large enough buffer size if the input is too small */
+ wfull_len = GetFullPathNameW(wsource.c_str(), 0, NULL, NULL) + 3;
+ std::vector<wchar_t> wfull(wfull_len);
+ GetFullPathNameW(wsource.c_str(), wfull_len, &wfull[0], NULL);
+
+ /* This should get the correct size without any extra padding from the
+ * previous size workaround. */
+ wfull_len = static_cast<DWORD>(wcslen(&wfull[0]));
+
+ if (wfull_len >= 2 && isalpha(wfull[0]) &&
+ wfull[1] == L':') { /* C:\Foo\bar\FooBar.txt */
+ return L"\\\\?\\" + std::wstring(&wfull[0]);
+ } else if (wfull_len >= 2 && wfull[0] == L'\\' &&
+ wfull[1] == L'\\') { /* Starts with \\ */
+ if (wfull_len >= 4 && wfull[2] == L'?' &&
+ wfull[3] == L'\\') { /* Starts with \\?\ */
+ if (wfull_len >= 8 && wfull[4] == L'U' && wfull[5] == L'N' &&
+ wfull[6] == L'C' &&
+ wfull[7] == L'\\') { /* \\?\UNC\Foo\bar\FooBar.txt */
+ return std::wstring(&wfull[0]);
+ } else if (wfull_len >= 6 && isalpha(wfull[4]) &&
+ wfull[5] == L':') { /* \\?\C:\Foo\bar\FooBar.txt */
+ return std::wstring(&wfull[0]);
+ } else if (wfull_len >= 5) { /* \\?\Foo\bar\FooBar.txt */
+ return L"\\\\?\\UNC\\" + std::wstring(&wfull[4]);
+ }
+ } else if (wfull_len >= 4 && wfull[2] == L'.' &&
+ wfull[3] == L'\\') { /* Starts with \\.\ a device name */
+ if (wfull_len >= 6 && isalpha(wfull[4]) &&
+ wfull[5] == L':') { /* \\.\C:\Foo\bar\FooBar.txt */
+ return L"\\\\?\\" + std::wstring(&wfull[4]);
+ } else if (wfull_len >=
+ 5) { /* \\.\Foo\bar\ Device name is left unchanged */
+ return std::wstring(&wfull[0]);
+ }
+ } else if (wfull_len >= 3) { /* \\Foo\bar\FooBar.txt */
+ return L"\\\\?\\UNC\\" + std::wstring(&wfull[2]);
+ }
+ }
+
+ // If this case has been reached, then the path is invalid. Leave it
+ // unchanged
+ return Encoding::ToWide(source);
+}
+#endif
+
#endif // KWSYS_STL_HAS_WSTRING
} // namespace KWSYS_NAMESPACE
diff --git a/Source/kwsys/FStream.hxx.in b/Source/kwsys/FStream.hxx.in
index d4bc6c9..a4c65fe 100644
--- a/Source/kwsys/FStream.hxx.in
+++ b/Source/kwsys/FStream.hxx.in
@@ -33,7 +33,7 @@ public:
typedef std::basic_filebuf<CharType, Traits> my_base_type;
basic_filebuf* open(char const* s, std::ios_base::openmode mode)
{
- const std::wstring wstr = Encoding::ToWide(s);
+ const std::wstring wstr = Encoding::ToWindowsExtendedPath(s);
return static_cast<basic_filebuf*>(my_base_type::open(wstr.c_str(), mode));
}
#endif
@@ -93,7 +93,7 @@ public:
#if defined(_MSC_VER)
const bool success = buf_->open(file_name, mode) != 0;
#else
- const std::wstring wstr = Encoding::ToWide(file_name);
+ const std::wstring wstr = Encoding::ToWindowsExtendedPath(file_name);
bool success = false;
std::wstring cmode = getcmode(mode);
file_ = _wfopen(wstr.c_str(), cmode.c_str());
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 100a49c..b6da368 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -216,12 +216,12 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft)
inline int Mkdir(const std::string& dir)
{
return _wmkdir(
- KWSYS_NAMESPACE::SystemTools::ConvertToWindowsExtendedPath(dir).c_str());
+ KWSYS_NAMESPACE::Encoding::ToWindowsExtendedPath(dir).c_str());
}
inline int Rmdir(const std::string& dir)
{
return _wrmdir(
- KWSYS_NAMESPACE::SystemTools::ConvertToWindowsExtendedPath(dir).c_str());
+ KWSYS_NAMESPACE::Encoding::ToWindowsExtendedPath(dir).c_str());
}
inline const char* Getcwd(char* buf, unsigned int len)
{
@@ -745,7 +745,7 @@ const char* SystemTools::GetExecutableExtension()
FILE* SystemTools::Fopen(const std::string& file, const char* mode)
{
#ifdef _WIN32
- return _wfopen(SystemTools::ConvertToWindowsExtendedPath(file).c_str(),
+ return _wfopen(Encoding::ToWindowsExtendedPath(file).c_str(),
Encoding::ToWide(mode).c_str());
#else
return fopen(file.c_str(), mode);
@@ -1159,8 +1159,7 @@ bool SystemTools::PathExists(const std::string& path)
struct stat st;
return lstat(path.c_str(), &st) == 0;
#elif defined(_WIN32)
- return (GetFileAttributesW(
- SystemTools::ConvertToWindowsExtendedPath(path).c_str()) !=
+ return (GetFileAttributesW(Encoding::ToWindowsExtendedPath(path).c_str()) !=
INVALID_FILE_ATTRIBUTES);
#else
struct stat st;
@@ -1191,9 +1190,9 @@ bool SystemTools::FileExists(const std::string& filename)
}
return access(filename.c_str(), R_OK) == 0;
#elif defined(_WIN32)
- return (GetFileAttributesW(
- SystemTools::ConvertToWindowsExtendedPath(filename).c_str()) !=
- INVALID_FILE_ATTRIBUTES);
+ return (
+ GetFileAttributesW(Encoding::ToWindowsExtendedPath(filename).c_str()) !=
+ INVALID_FILE_ATTRIBUTES);
#else
// SCO OpenServer 5.0.7/3.2's command has 711 permission.
#if defined(_SCO_DS)
@@ -1249,7 +1248,7 @@ bool SystemTools::TestFileAccess(const std::string& filename,
permissions &= ~TEST_FILE_EXECUTE;
permissions |= TEST_FILE_READ;
}
- return _waccess(SystemTools::ConvertToWindowsExtendedPath(filename).c_str(),
+ return _waccess(Encoding::ToWindowsExtendedPath(filename).c_str(),
permissions) == 0;
#else
return access(filename.c_str(), permissions) == 0;
@@ -1274,7 +1273,7 @@ int SystemTools::Stat(const std::string& path, SystemTools::Stat_t* buf)
return -1;
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- // Ideally we should use ConvertToWindowsExtendedPath to support
+ // Ideally we should use Encoding::ToWindowsExtendedPath to support
// long paths, but _wstat64 rejects paths with '?' in them, thinking
// they are wildcards.
std::wstring const& wpath = Encoding::ToWide(path);
@@ -1324,10 +1323,9 @@ bool SystemTools::Touch(const std::string& filename, bool create)
}
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- HANDLE h =
- CreateFileW(SystemTools::ConvertToWindowsExtendedPath(filename).c_str(),
- FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, 0, OPEN_EXISTING,
- FILE_FLAG_BACKUP_SEMANTICS, 0);
+ HANDLE h = CreateFileW(Encoding::ToWindowsExtendedPath(filename).c_str(),
+ FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, 0,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
if (!h) {
return false;
}
@@ -1425,14 +1423,12 @@ bool SystemTools::FileTimeCompare(const std::string& f1, const std::string& f2,
// Windows version. Get the modification time from extended file attributes.
WIN32_FILE_ATTRIBUTE_DATA f1d;
WIN32_FILE_ATTRIBUTE_DATA f2d;
- if (!GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(f1).c_str(),
- GetFileExInfoStandard, &f1d)) {
+ if (!GetFileAttributesExW(Encoding::ToWindowsExtendedPath(f1).c_str(),
+ GetFileExInfoStandard, &f1d)) {
return false;
}
- if (!GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(f2).c_str(),
- GetFileExInfoStandard, &f2d)) {
+ if (!GetFileAttributesExW(Encoding::ToWindowsExtendedPath(f2).c_str(),
+ GetFileExInfoStandard, &f2d)) {
return false;
}
@@ -1960,59 +1956,10 @@ void SystemTools::ConvertToUnixSlashes(std::string& path)
}
#ifdef _WIN32
-// Convert local paths to UNC style paths
std::wstring SystemTools::ConvertToWindowsExtendedPath(
const std::string& source)
{
- std::wstring wsource = Encoding::ToWide(source);
-
- // Resolve any relative paths
- DWORD wfull_len;
-
- /* The +3 is a workaround for a bug in some versions of GetFullPathNameW that
- * won't return a large enough buffer size if the input is too small */
- wfull_len = GetFullPathNameW(wsource.c_str(), 0, NULL, NULL) + 3;
- std::vector<wchar_t> wfull(wfull_len);
- GetFullPathNameW(wsource.c_str(), wfull_len, &wfull[0], NULL);
-
- /* This should get the correct size without any extra padding from the
- * previous size workaround. */
- wfull_len = static_cast<DWORD>(wcslen(&wfull[0]));
-
- if (wfull_len >= 2 && isalpha(wfull[0]) &&
- wfull[1] == L':') { /* C:\Foo\bar\FooBar.txt */
- return L"\\\\?\\" + std::wstring(&wfull[0]);
- } else if (wfull_len >= 2 && wfull[0] == L'\\' &&
- wfull[1] == L'\\') { /* Starts with \\ */
- if (wfull_len >= 4 && wfull[2] == L'?' &&
- wfull[3] == L'\\') { /* Starts with \\?\ */
- if (wfull_len >= 8 && wfull[4] == L'U' && wfull[5] == L'N' &&
- wfull[6] == L'C' &&
- wfull[7] == L'\\') { /* \\?\UNC\Foo\bar\FooBar.txt */
- return std::wstring(&wfull[0]);
- } else if (wfull_len >= 6 && isalpha(wfull[4]) &&
- wfull[5] == L':') { /* \\?\C:\Foo\bar\FooBar.txt */
- return std::wstring(&wfull[0]);
- } else if (wfull_len >= 5) { /* \\?\Foo\bar\FooBar.txt */
- return L"\\\\?\\UNC\\" + std::wstring(&wfull[4]);
- }
- } else if (wfull_len >= 4 && wfull[2] == L'.' &&
- wfull[3] == L'\\') { /* Starts with \\.\ a device name */
- if (wfull_len >= 6 && isalpha(wfull[4]) &&
- wfull[5] == L':') { /* \\.\C:\Foo\bar\FooBar.txt */
- return L"\\\\?\\" + std::wstring(&wfull[4]);
- } else if (wfull_len >=
- 5) { /* \\.\Foo\bar\ Device name is left unchanged */
- return std::wstring(&wfull[0]);
- }
- } else if (wfull_len >= 3) { /* \\Foo\bar\FooBar.txt */
- return L"\\\\?\\UNC\\" + std::wstring(&wfull[2]);
- }
- }
-
- // If this case has been reached, then the path is invalid. Leave it
- // unchanged
- return Encoding::ToWide(source);
+ return Encoding::ToWindowsExtendedPath(source);
}
#endif
@@ -2129,15 +2076,14 @@ bool SystemTools::FilesDiffer(const std::string& source,
#if defined(_WIN32)
WIN32_FILE_ATTRIBUTE_DATA statSource;
- if (GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(source).c_str(),
- GetFileExInfoStandard, &statSource) == 0) {
+ if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(source).c_str(),
+ GetFileExInfoStandard, &statSource) == 0) {
return true;
}
WIN32_FILE_ATTRIBUTE_DATA statDestination;
if (GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(destination).c_str(),
+ Encoding::ToWindowsExtendedPath(destination).c_str(),
GetFileExInfoStandard, &statDestination) == 0) {
return true;
}
@@ -2261,8 +2207,7 @@ bool SystemTools::CopyFileAlways(const std::string& source,
// Open files
#if defined(_WIN32)
kwsys::ifstream fin(
- Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(source))
- .c_str(),
+ Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(),
std::ios::in | std::ios::binary);
#else
kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary);
@@ -2279,8 +2224,7 @@ bool SystemTools::CopyFileAlways(const std::string& source,
#if defined(_WIN32)
kwsys::ofstream fout(
- Encoding::ToNarrow(
- SystemTools::ConvertToWindowsExtendedPath(real_destination))
+ Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(real_destination))
.c_str(),
std::ios::out | std::ios::trunc | std::ios::binary);
#else
@@ -2345,8 +2289,7 @@ bool SystemTools::CopyADirectory(const std::string& source,
{
Directory dir;
#ifdef _WIN32
- dir.Load(
- Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(source)));
+ dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)));
#else
dir.Load(source);
#endif
@@ -2384,9 +2327,8 @@ unsigned long SystemTools::FileLength(const std::string& filename)
unsigned long length = 0;
#ifdef _WIN32
WIN32_FILE_ATTRIBUTE_DATA fs;
- if (GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(filename).c_str(),
- GetFileExInfoStandard, &fs) != 0) {
+ if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(),
+ GetFileExInfoStandard, &fs) != 0) {
/* To support the full 64-bit file size, use fs.nFileSizeHigh
* and fs.nFileSizeLow to construct the 64 bit size
@@ -2420,9 +2362,8 @@ long int SystemTools::ModifiedTime(const std::string& filename)
long int mt = 0;
#ifdef _WIN32
WIN32_FILE_ATTRIBUTE_DATA fs;
- if (GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(filename).c_str(),
- GetFileExInfoStandard, &fs) != 0) {
+ if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(),
+ GetFileExInfoStandard, &fs) != 0) {
mt = windows_filetime_to_posix_time(fs.ftLastWriteTime);
}
#else
@@ -2440,9 +2381,8 @@ long int SystemTools::CreationTime(const std::string& filename)
long int ct = 0;
#ifdef _WIN32
WIN32_FILE_ATTRIBUTE_DATA fs;
- if (GetFileAttributesExW(
- SystemTools::ConvertToWindowsExtendedPath(filename).c_str(),
- GetFileExInfoStandard, &fs) != 0) {
+ if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(),
+ GetFileExInfoStandard, &fs) != 0) {
ct = windows_filetime_to_posix_time(fs.ftCreationTime);
}
#else
@@ -2656,7 +2596,7 @@ static bool DeleteJunction(const std::wstring& source)
bool SystemTools::RemoveFile(const std::string& source)
{
#ifdef _WIN32
- std::wstring const& ws = SystemTools::ConvertToWindowsExtendedPath(source);
+ std::wstring const& ws = Encoding::ToWindowsExtendedPath(source);
if (DeleteFileW(ws.c_str())) {
return true;
}
@@ -2706,8 +2646,7 @@ bool SystemTools::RemoveADirectory(const std::string& source)
Directory dir;
#ifdef _WIN32
- dir.Load(
- Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(source)));
+ dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)));
#else
dir.Load(source);
#endif
@@ -3064,8 +3003,8 @@ bool SystemTools::FileIsDirectory(const std::string& inName)
// Now check the file node type.
#if defined(_WIN32)
- DWORD attr = GetFileAttributesW(
- SystemTools::ConvertToWindowsExtendedPath(name).c_str());
+ DWORD attr =
+ GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str());
if (attr != INVALID_FILE_ATTRIBUTES) {
return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
#else
@@ -3081,8 +3020,8 @@ bool SystemTools::FileIsDirectory(const std::string& inName)
bool SystemTools::FileIsSymlink(const std::string& name)
{
#if defined(_WIN32)
- DWORD attr = GetFileAttributesW(
- SystemTools::ConvertToWindowsExtendedPath(name).c_str());
+ DWORD attr =
+ GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str());
if (attr != INVALID_FILE_ATTRIBUTES) {
return (attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
} else {
@@ -4398,8 +4337,8 @@ bool SystemTools::GetPermissions(const char* file, mode_t& mode)
bool SystemTools::GetPermissions(const std::string& file, mode_t& mode)
{
#if defined(_WIN32)
- DWORD attr = GetFileAttributesW(
- SystemTools::ConvertToWindowsExtendedPath(file).c_str());
+ DWORD attr =
+ GetFileAttributesW(Encoding::ToWindowsExtendedPath(file).c_str());
if (attr == INVALID_FILE_ATTRIBUTES) {
return false;
}
@@ -4451,8 +4390,7 @@ bool SystemTools::SetPermissions(const std::string& file, mode_t mode,
mode &= ~currentMask;
}
#ifdef _WIN32
- if (_wchmod(SystemTools::ConvertToWindowsExtendedPath(file).c_str(), mode) <
- 0)
+ if (_wchmod(Encoding::ToWindowsExtendedPath(file).c_str(), mode) < 0)
#else
if (chmod(file.c_str(), mode) < 0)
#endif
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 53abce7..0849e1d 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -265,13 +265,7 @@ public:
static void ConvertToUnixSlashes(std::string& path);
#ifdef _WIN32
- /**
- * Convert the path to an extended length path to avoid MAX_PATH length
- * limitations on Windows. If the input is a local path the result will be
- * prefixed with \\?\; if the input is instead a network path, the result
- * will be prefixed with \\?\UNC\. All output will also be converted to
- * absolute paths with Windows-style backslashes.
- **/
+ /** Calls Encoding::ToWindowsExtendedPath. */
static std::wstring ConvertToWindowsExtendedPath(const std::string&);
#endif
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx
index 03f2ec9..457e8a8 100644
--- a/Source/kwsys/testEncoding.cxx
+++ b/Source/kwsys/testEncoding.cxx
@@ -180,6 +180,88 @@ static int testCommandLineArguments()
return status;
}
+static int testToWindowsExtendedPath()
+{
+#ifdef _WIN32
+ int ret = 0;
+ if (kwsys::Encoding::ToWindowsExtendedPath(
+ "L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
+ L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
+ << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath(
+ "L:/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
+ L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\"" << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath(
+ "\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
+ L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
+ << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath(
+ "//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
+ L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\""
+ << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath("//") != L"//") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"//\"" << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\") != L"\\\\.\\") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"\\\\.\\\"" << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X") != L"\\\\.\\X") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"\\\\.\\X\"" << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X:") != L"\\\\?\\X:") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"\\\\.\\X:\"" << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X:\\") !=
+ L"\\\\?\\X:\\") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"\\\\.\\X:\\\"" << std::endl;
+ ++ret;
+ }
+
+ if (kwsys::Encoding::ToWindowsExtendedPath("NUL") != L"\\\\.\\NUL") {
+ std::cout << "Problem with ToWindowsExtendedPath "
+ << "\"NUL\"" << std::endl;
+ ++ret;
+ }
+
+ return ret;
+#else
+ return 0;
+#endif
+}
+
//----------------------------------------------------------------------------
int testEncoding(int, char* [])
{
@@ -196,6 +278,7 @@ int testEncoding(int, char* [])
ret |= testRobustEncoding();
ret |= testCommandLineArguments();
ret |= testWithNulls();
+ ret |= testToWindowsExtendedPath();
return ret;
}
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 9b08a04..d11bcae 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -585,85 +585,6 @@ static bool CheckStringOperations()
res = false;
}
-#ifdef _WIN32
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath(
- "L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
- L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
- << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath(
- "L:/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
- L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\"" << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath(
- "\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
- L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
- << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath(
- "//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
- L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath("//") != L"//") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"//\"" << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\") !=
- L"\\\\.\\") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"\\\\.\\\"" << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X") !=
- L"\\\\.\\X") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"\\\\.\\X\"" << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:") !=
- L"\\\\?\\X:") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"\\\\.\\X:\"" << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:\\") !=
- L"\\\\?\\X:\\") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"\\\\.\\X:\\\"" << std::endl;
- res = false;
- }
-
- if (kwsys::SystemTools::ConvertToWindowsExtendedPath("NUL") !=
- L"\\\\.\\NUL") {
- std::cerr << "Problem with ConvertToWindowsExtendedPath "
- << "\"NUL\"" << std::endl;
- res = false;
- }
-
-#endif
-
if (kwsys::SystemTools::ConvertToWindowsOutputPath(
"L://Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"") {
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 9b48b14..11978db 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -42,7 +42,7 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}")
list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1")
-if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])")
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^89]|[89][0-9])")
set(TEST_MULTI3 1)
list(APPEND _cmake_options "-DTEST_MULTI3=1")
endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 41168c7..60a2cbb 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -46,7 +46,7 @@ if(BUILD_TESTING)
set(CMake_TEST_DEVENV "")
if(CMAKE_VS_DEVENV_COMMAND)
set(CMake_TEST_DEVENV "${CMAKE_VS_DEVENV_COMMAND}")
- elseif(CMAKE_GENERATOR MATCHES "Visual Studio [7-9] " AND
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio [89] " AND
NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}")
endif()
@@ -325,7 +325,7 @@ if(BUILD_TESTING)
endif()
endif()
- if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^789]|[789][0-9])")
+ if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
ADD_TEST_MACRO(CSharpOnly CSharpOnly)
endif()
@@ -626,8 +626,8 @@ if(BUILD_TESTING)
endif()
# test for correct sub-project generation
- # not implemented in VS 7.0, Xcode, or Ninja
- if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 7$|Xcode|Ninja")
+ # not implemented in Xcode or Ninja
+ if(NOT CMAKE_GENERATOR MATCHES "Xcode|Ninja")
# run cmake and configure all of SubProject
# but only build the independent executable car
add_test(SubProject ${CMAKE_CTEST_COMMAND}
@@ -1942,7 +1942,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
if(MSVC AND NOT MSVC_VERSION LESS 1310
- AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7( |$)"
AND (NOT CMAKE_GENERATOR MATCHES "Visual Studio [89]( |$)"
OR CMAKE_SIZEOF_VOID_P EQUAL 4)
)
@@ -1954,7 +1953,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
ADD_TEST_MACRO(SBCS SBCS)
endif()
- if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [789]( |$)"
+ if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [89]( |$)"
AND NOT CMAKE_GENERATOR_TOOLSET)
ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx)
endif()
@@ -2153,7 +2152,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
endif()
- if(CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])" AND nasm)
+ if(CMAKE_GENERATOR MATCHES "Visual Studio ([^89]|[89][0-9])" AND nasm)
ADD_TEST_MACRO(VSNASM VSNASM)
endif()
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 2b25766..c84fa74 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -33,7 +33,7 @@ add_CMakeOnly_test(CompilerIdCXX)
if(CMAKE_Fortran_COMPILER)
add_CMakeOnly_test(CompilerIdFortran)
endif()
-if(CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])")
+if(CMAKE_GENERATOR MATCHES "Visual Studio ([^89]|[89][0-9])")
add_CMakeOnly_test(CompilerIdCSharp)
endif()
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt
index e3476df..4bffd12 100644
--- a/Tests/ObjectLibrary/CMakeLists.txt
+++ b/Tests/ObjectLibrary/CMakeLists.txt
@@ -16,11 +16,7 @@ add_custom_command(TARGET UseCshared POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CM
add_executable(UseCinternal main.c c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>)
-if("${CMAKE_GENERATOR}" MATCHES "^Visual Studio (7|7 .NET 2003)$")
- # VS 7 generators do not add objects as sources so we need a
- # dummy object to convince the IDE to build the targets below.
- set(dummy dummy.obj) # In MinGW: gcc -c dummy.c -o dummy.obj
-elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+if("${CMAKE_GENERATOR}" MATCHES "Xcode")
# Xcode does not seem to support targets without sources.
set(dummy dummy.c)
endif()
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 807a427..8c2cdc9 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -25,9 +25,6 @@ endif()
if("${CMAKE_GENERATOR}" MATCHES "Watcom WMake")
set(PP_WATCOM 1)
endif()
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$")
- set(PP_VS70 1)
-endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(PP_VS 1)
endif()
@@ -46,14 +43,11 @@ endif()
# must not have it escaped inside the configured header.
set(STRING_EXTRA "")
-if(NOT BORLAND AND NOT PP_VS70)
- # Borland, VS70 IDE: ;
+if(NOT BORLAND)
+ # Borland: ;
# The Borland compiler will simply not accept a non-escaped semicolon
# on the command line. If it is escaped \; then the escape character
# shows up in the preprocessing output too.
- #
- # The VS 7.0 IDE separates definitions on semicolons and commas with
- # no regard for quotes. Fortunately VS 7.1 and above are okay.
set(SEMICOLON "\;")
endif()
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index ffd3ae1..67a6101 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -31,7 +31,7 @@ function(run_BuildDepends CASE)
endfunction()
run_BuildDepends(C-Exe)
-if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode")
+if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
if(RunCMake_GENERATOR MATCHES "Visual Studio 10")
# VS 10 forgets to re-link when a manifest changes
set(run_BuildDepends_skip_step_2 1)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 73a4965..32c4be8 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -270,13 +270,13 @@ endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
add_RunCMake_test(include_external_msproject)
- if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([789]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND)
+ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([89]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND)
set(NO_USE_FOLDERS 1)
endif()
add_RunCMake_test(VSSolution -DNO_USE_FOLDERS=${NO_USE_FOLDERS})
endif()
-if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])")
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^89]|[89][0-9])")
add_RunCMake_test(VS10Project)
endif()
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake
deleted file mode 100644
index e69de29..0000000
--- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-OFF.cmake
+++ /dev/null
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt
deleted file mode 100644
index 2cb01ff..0000000
--- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Warning:
- The "Visual Studio 7 .NET 2003" generator is deprecated and will be removed
- in a future version of CMake.
-
- Add CMAKE_WARN_VS71=OFF to the cache to disable this warning.$
diff --git a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake
deleted file mode 100644
index e69de29..0000000
--- a/Tests/RunCMake/CommandLine/DeprecateVS71-WARN-ON.cmake
+++ /dev/null
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index b213ee2..f327f78 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -78,13 +78,6 @@ if(RunCMake_GENERATOR STREQUAL "Ninja")
unset(RunCMake_TEST_NO_CLEAN)
endif()
-if(RunCMake_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
- set(RunCMake_WARN_VS71 1)
- run_cmake(DeprecateVS71-WARN-ON)
- unset(RunCMake_WARN_VS71)
- run_cmake(DeprecateVS71-WARN-OFF)
-endif()
-
if(UNIX)
run_cmake_command(E_create_symlink-no-arg
${CMAKE_COMMAND} -E create_symlink
diff --git a/Tests/RunCMake/GNUInstallDirs/Common.cmake b/Tests/RunCMake/GNUInstallDirs/Common.cmake
index eff2d54..5f119af 100644
--- a/Tests/RunCMake/GNUInstallDirs/Common.cmake
+++ b/Tests/RunCMake/GNUInstallDirs/Common.cmake
@@ -15,6 +15,7 @@ set(dirs
LIBEXECDIR
LOCALEDIR
LOCALSTATEDIR
+ RUNSTATEDIR
MANDIR
SBINDIR
SHAREDSTATEDIR
diff --git a/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt
index aee8552..3e18410 100644
--- a/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt
+++ b/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt
@@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64)'
CMAKE_INSTALL_LIBEXECDIR='libexec'
CMAKE_INSTALL_LOCALEDIR='share/locale'
CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
CMAKE_INSTALL_MANDIR='share/man'
CMAKE_INSTALL_SBINDIR='sbin'
CMAKE_INSTALL_SHAREDSTATEDIR='com'
@@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/opt/Opt/(lib|lib64)'
CMAKE_INSTALL_FULL_LIBEXECDIR='/opt/Opt/libexec'
CMAKE_INSTALL_FULL_LOCALEDIR='/opt/Opt/share/locale'
CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var/opt/Opt'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run/opt/Opt'
CMAKE_INSTALL_FULL_MANDIR='/opt/Opt/share/man'
CMAKE_INSTALL_FULL_SBINDIR='/opt/Opt/sbin'
CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/opt/Opt/com'
diff --git a/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt
index a95400e..8c13368 100644
--- a/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt
+++ b/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt
@@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='usr/(lib|lib64)'
CMAKE_INSTALL_LIBEXECDIR='usr/libexec'
CMAKE_INSTALL_LOCALEDIR='usr/share/locale'
CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
CMAKE_INSTALL_MANDIR='usr/share/man'
CMAKE_INSTALL_SBINDIR='usr/sbin'
CMAKE_INSTALL_SHAREDSTATEDIR='usr/com'
@@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64)'
CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec'
CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale'
CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run'
CMAKE_INSTALL_FULL_MANDIR='/usr/share/man'
CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin'
CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com'
diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt
index e10c4c5..a591436 100644
--- a/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt
+++ b/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt
@@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64|lib/arch)'
CMAKE_INSTALL_LIBEXECDIR='libexec'
CMAKE_INSTALL_LOCALEDIR='share/locale'
CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
CMAKE_INSTALL_MANDIR='share/man'
CMAKE_INSTALL_SBINDIR='sbin'
CMAKE_INSTALL_SHAREDSTATEDIR='com'
@@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64|lib/arch)'
CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec'
CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale'
CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run'
CMAKE_INSTALL_FULL_MANDIR='/usr/share/man'
CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin'
CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com'
diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt
index 8dcf25b..f957e0e 100644
--- a/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt
+++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt
@@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64)'
CMAKE_INSTALL_LIBEXECDIR='libexec'
CMAKE_INSTALL_LOCALEDIR='share/locale'
CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
CMAKE_INSTALL_MANDIR='share/man'
CMAKE_INSTALL_SBINDIR='sbin'
CMAKE_INSTALL_SHAREDSTATEDIR='com'
@@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/local/(lib|lib64)'
CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec'
CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale'
CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/usr/local/var/run'
CMAKE_INSTALL_FULL_MANDIR='/usr/local/share/man'
CMAKE_INSTALL_FULL_SBINDIR='/usr/local/sbin'
CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/local/com'
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 9e2fe7a..04eadd5 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -51,9 +51,6 @@ function(run_cmake test)
if(APPLE)
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW)
endif()
- if(RunCMake_GENERATOR STREQUAL "Visual Studio 7 .NET 2003" AND NOT RunCMake_WARN_VS71)
- list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS71=OFF)
- endif()
if(RunCMake_MAKE_PROGRAM)
list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}")
endif()
diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
index 4ec3e3b..3a04db4 100644
--- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
@@ -12,6 +12,6 @@ run_cmake(StartupProject)
run_cmake(StartupProjectMissing)
run_cmake(AddPackageToDefault)
-if(RunCMake_GENERATOR MATCHES "Visual Studio ([^7]|[7][0-9])" AND NOT NO_USE_FOLDERS)
+if(NOT NO_USE_FOLDERS)
run_cmake(StartupProjectUseFolders)
endif()
diff --git a/Utilities/Scripts/update-kwsys.bash b/Utilities/Scripts/update-kwsys.bash
index d5485aa..dfbd366 100755
--- a/Utilities/Scripts/update-kwsys.bash
+++ b/Utilities/Scripts/update-kwsys.bash
@@ -15,7 +15,8 @@ readonly paths="
extract_source () {
git_archive
- disable_custom_gitattributes
+ sed -i -e '/import off/,/import on/d' "$extractdir/$name-reduced/.gitattributes"
+ sed -i -e 's/project=KWSys/project=PublicDashboard/' "$extractdir/$name-reduced/CTestConfig.cmake"
}
export HOOKS_ALLOW_KWSYS=1