summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/prop_tgt/UNITY_BUILD.rst36
-rw-r--r--Help/release/3.16.rst4
-rw-r--r--Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst4
-rw-r--r--Help/variable/CMAKE_STATIC_LINKER_FLAGS.rst10
-rw-r--r--Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG.rst12
-rw-r--r--Help/variable/CMAKE_UNITY_BUILD.rst10
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in2
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in16
-rw-r--r--Modules/CMakePlatformId.h.in3
-rw-r--r--Modules/Compiler/IAR-ASM.cmake7
-rw-r--r--Modules/Compiler/IAR-C.cmake5
-rw-r--r--Modules/Compiler/IAR-CXX.cmake6
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake2
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake3
-rw-r--r--Modules/FindHDF5.cmake4
-rw-r--r--Modules/FindOpenMP.cmake2
-rw-r--r--Modules/FindPostgreSQL.cmake5
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake7
-rw-r--r--Source/CMakeVersion.cmake90
-rw-r--r--Source/cmVisualStudio10ToolsetOptions.cxx3
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Templates/MSBuild/FlagTables/v142_CSharp.json574
-rw-r--r--Tests/CMakeLists.txt12
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt6
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp12
-rw-r--r--Tests/Objective-C/cxx-file-extension-test/CMakeLists.txt8
-rw-r--r--Tests/Objective-C/cxx-file-extension-test/main.m8
-rw-r--r--Tests/RunCMake/CommandLine/C-no-file-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/C_basic-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/C_basic-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/C_basic.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_fullpath.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_initial-cache.txt5
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt8
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/Cno-file-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake15
39 files changed, 812 insertions, 89 deletions
diff --git a/Help/prop_tgt/UNITY_BUILD.rst b/Help/prop_tgt/UNITY_BUILD.rst
index beac5d4..2faad92 100644
--- a/Help/prop_tgt/UNITY_BUILD.rst
+++ b/Help/prop_tgt/UNITY_BUILD.rst
@@ -5,27 +5,33 @@ Should the target source files be processed into batches for
faster compilation. This feature is known as "Unity build",
or "Jumbo build".
-The `C` and `CXX` source files are grouped separately.
+The ``C`` and ``CXX`` source files are grouped separately.
This property is initialized by the value of the
:variable:`CMAKE_UNITY_BUILD` variable if it is set when
a target is created.
-.. note ::
+.. note::
- It's not recommended to directly set :prop_tgt:`UNITY_BUILD`
- to `ON`, but to instead set :variable:`CMAKE_UNITY_BUILD` from
- the command line. However, it IS recommended to set
- :prop_tgt:`UNITY_BUILD` to `OFF` if you need to ensure that a
- target doesn't get a unity build.
+ It's not recommended to directly set :prop_tgt:`UNITY_BUILD`
+ to ``ON``, but to instead set :variable:`CMAKE_UNITY_BUILD` from
+ the command line. However, it IS recommended to set
+ :prop_tgt:`UNITY_BUILD` to ``OFF`` if you need to ensure that a
+ target doesn't get a unity build.
The batch size can be specified by setting
:prop_tgt:`UNITY_BUILD_BATCH_SIZE`.
The batching of source files is done by adding new sources files
-wich will `#include` the source files, and exclude them from
-building by setting :prop_sf:`HEADER_FILE_ONLY` to `ON`.
+which will ``#include`` the source files, and exclude them from
+building by setting :prop_sf:`HEADER_FILE_ONLY` to ``ON``.
+.. note::
+
+ Marking the original sources with :prop_sf:`HEADER_FILE_ONLY`
+ is considered an implementation detail that may change in the
+ future because it does not work well in combination with
+ the :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable.
ODR (One definition rule) errors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,11 +51,11 @@ The source files that have :prop_sf:`COMPILE_OPTIONS`,
With the :prop_tgt:`UNITY_BUILD_CODE_BEFORE_INCLUDE` and
:prop_tgt:`UNITY_BUILD_CODE_AFTER_INCLUDE` one can specify code
to be injected in the unity source file before and after every
-`#include` statement.
+``#include`` statement.
-.. note ::
+.. note::
- The order of source files defined in the `CMakeLists.txt` will
- be preserved into the generated unity source files. This can
- be used to manually enforce a specific grouping based on the
- :prop_tgt:`UNITY_BUILD_BATCH_SIZE`.
+ The order of source files defined in the ``CMakeLists.txt`` will
+ be preserved into the generated unity source files. This can
+ be used to manually enforce a specific grouping based on the
+ :prop_tgt:`UNITY_BUILD_BATCH_SIZE` target property.
diff --git a/Help/release/3.16.rst b/Help/release/3.16.rst
index a14effe..7992f2d 100644
--- a/Help/release/3.16.rst
+++ b/Help/release/3.16.rst
@@ -115,6 +115,10 @@ Variables
specify the resource encoding for the the :generator:`Eclipse CDT4` extra
generator.
+* The :variable:`CMAKE_UNITY_BUILD` variable was added to initialize the
+ :prop_tgt:`UNITY_BUILD` target property to tell generators to batch
+ include source files for faster compilation times.
+
Properties
----------
diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index 8776279..4548abc 100644
--- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -28,3 +28,7 @@ form. The format of the JSON file looks like:
.. note::
This option is implemented only by :ref:`Makefile Generators`
and the :generator:`Ninja`. It is ignored on other generators.
+
+ This option currently does not work well in combination with
+ the :prop_tgt:`UNITY_BUILD` target property or the
+ :variable:`CMAKE_UNITY_BUILD` variable.
diff --git a/Help/variable/CMAKE_STATIC_LINKER_FLAGS.rst b/Help/variable/CMAKE_STATIC_LINKER_FLAGS.rst
index 9c38673..1a810ce 100644
--- a/Help/variable/CMAKE_STATIC_LINKER_FLAGS.rst
+++ b/Help/variable/CMAKE_STATIC_LINKER_FLAGS.rst
@@ -1,6 +1,12 @@
CMAKE_STATIC_LINKER_FLAGS
-------------------------
-Linker flags to be used to create static libraries.
+Flags to be used to create static libraries. These flags will be passed
+to the archiver when creating a static library.
-These flags will be used by the linker when creating a static library.
+See also :variable:`CMAKE_STATIC_LINKER_FLAGS_<CONFIG>`.
+
+.. note::
+ Static libraries do not actually link. They are essentially archives
+ of object files. The use of the name "linker" in the name of this
+ variable is kept for compatibility.
diff --git a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG.rst b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG.rst
index b9f8003..e561dc6 100644
--- a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG.rst
+++ b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG.rst
@@ -1,7 +1,13 @@
CMAKE_STATIC_LINKER_FLAGS_<CONFIG>
----------------------------------
-Flags to be used when linking a static library.
+Flags to be used to create static libraries. These flags will be passed
+to the archiver when creating a static library in the ``<CONFIG>``
+configuration.
-Same as ``CMAKE_C_FLAGS_*`` but used by the linker when creating static
-libraries.
+See also :variable:`CMAKE_STATIC_LINKER_FLAGS`.
+
+.. note::
+ Static libraries do not actually link. They are essentially archives
+ of object files. The use of the name "linker" in the name of this
+ variable is kept for compatibility.
diff --git a/Help/variable/CMAKE_UNITY_BUILD.rst b/Help/variable/CMAKE_UNITY_BUILD.rst
index 3096954..bbcfd68 100644
--- a/Help/variable/CMAKE_UNITY_BUILD.rst
+++ b/Help/variable/CMAKE_UNITY_BUILD.rst
@@ -1,6 +1,12 @@
CMAKE_UNITY_BUILD
-----------------
-Default value for :prop_tgt:`UNITY_BUILD` of targets.
+Initializes the :prop_tgt:`UNITY_BUILD` target property on targets
+as they are created. Set to ``ON`` to batch compilation of multiple
+sources within each target. This feature is known as "Unity build",
+or "Jumbo build". By default this variable is not set and so does
+not enable unity builds on targets.
-By default ``CMAKE_UNITY_BUILD`` is ``OFF``.
+.. note::
+ This option currently does not work well in combination with
+ the :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable.
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index ef65021..efb8abf 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -45,7 +45,7 @@ set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
-foreach (lang OBJC OBJCXX)
+foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 34639b4..a743ce7 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -27,10 +27,20 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
-#if defined(_MSC_VER) && defined(_MSVC_LANG)
-#define CXX_STD _MSVC_LANG
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
+# if defined(__INTEL_CXX11_MODE__)
+# if defined(__cpp_aggregate_nsdmi)
+# define CXX_STD 201402L
+# else
+# define CXX_STD 201103L
+# endif
+# else
+# define CXX_STD 199711L
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
+# define CXX_STD _MSVC_LANG
#else
-#define CXX_STD __cplusplus
+# define CXX_STD __cplusplus
#endif
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 95465ce..64a00b3 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -177,6 +177,9 @@
# elif defined(__ICCV850__)
# define ARCHITECTURE_ID "V850"
+# elif defined(__ICC8051__)
+# define ARCHITECTURE_ID "8051"
+
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake
index 413d9e2..936d4ae 100644
--- a/Modules/Compiler/IAR-ASM.cmake
+++ b/Modules/Compiler/IAR-ASM.cmake
@@ -40,7 +40,12 @@ elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
__compiler_iar_xlink(ASM)
- set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS r85;asm;msa)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s85;asm;msa)
+
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_xlink(ASM)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s51;asm;msa)
else()
message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.")
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index 9ad1ba0..e27fdfc 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -65,6 +65,11 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850")
__compiler_check_default_language_standard(C 1.10 90 4.10 99)
set(CMAKE_C_OUTPUT_EXTENSION ".r85")
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
+ __compiler_iar_xlink(C)
+ __compiler_check_default_language_standard(C 6.10 90 8.10 99)
+ set(CMAKE_C_OUTPUT_EXTENSION ".r51")
+
else()
message(FATAL_ERROR "CMAKE_C_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.")
endif()
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 549d242..eca89c5 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -72,6 +72,12 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850")
__compiler_iar_xlink(CXX)
__compiler_check_default_language_standard(CXX 1.10 98)
set(CMAKE_C_OUTPUT_EXTENSION ".r85")
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
+ __compiler_iar_xlink(CXX)
+ __compiler_check_default_language_standard(CXX 6.10 98)
+ set(CMAKE_C_OUTPUT_EXTENSION ".r51")
+
else()
message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected. This should be automatic." )
endif()
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index 7e17778..0a026b2 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -31,7 +31,7 @@ set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000)
# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
-# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__))
+# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 100)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__VER__) - (((__VER__) / 100)*100))
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__SUBVERSION__)
diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake
index 6258cf3..6ef3759 100644
--- a/Modules/Compiler/IAR-FindBinUtils.cmake
+++ b/Modules/Compiler/IAR-FindBinUtils.cmake
@@ -46,7 +46,8 @@ set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR" OR
"${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850")
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850" OR
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
# Find the "xlink" linker and "xar" archiver:
find_program(CMAKE_IAR_LINKER xlink HINTS ${__iar_hints}
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 08863c8..b488418 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -761,7 +761,7 @@ mark_as_advanced( HDF5_DIFF_EXECUTABLE )
if( NOT HDF5_FOUND )
# seed the initial lists of libraries to find with items we know we need
set(HDF5_C_LIBRARY_NAMES hdf5)
- set(HDF5_C_HL_LIBRARY_NAMES hdf5_hl)
+ set(HDF5_C_HL_LIBRARY_NAMES hdf5_hl ${HDF5_C_LIBRARY_NAMES} )
set(HDF5_CXX_LIBRARY_NAMES hdf5_cpp ${HDF5_C_LIBRARY_NAMES})
set(HDF5_CXX_HL_LIBRARY_NAMES hdf5_hl_cpp ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_CXX_LIBRARY_NAMES})
@@ -772,7 +772,7 @@ if( NOT HDF5_FOUND )
foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS)
# find the HDF5 include directories
if("${__lang}" STREQUAL "Fortran")
- set(HDF5_INCLUDE_FILENAME hdf5.mod)
+ set(HDF5_INCLUDE_FILENAME hdf5.mod HDF5.mod)
elseif("${__lang}" STREQUAL "CXX")
set(HDF5_INCLUDE_FILENAME H5Cpp.h)
else()
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index def23bb..ab9d73a 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -128,6 +128,8 @@ int main(void) {
#ifdef _OPENMP
omp_get_max_threads();
return 0;
+#elif defined(__HIP_DEVICE_COMPILE__)
+ return 0;
#else
breaks_on_purpose
#endif
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index dfece22..cfa4ebc 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -87,7 +87,7 @@ set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to wher
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
- "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+ "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
# Define additional search paths for root directories.
set( PostgreSQL_ROOT_DIRECTORIES
@@ -107,8 +107,11 @@ foreach(suffix ${PostgreSQL_KNOWN_VERSIONS})
list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
"pgsql-${suffix}/lib")
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
+ "postgresql${suffix}"
+ "postgresql/${suffix}"
"pgsql-${suffix}/include")
list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
+ "postgresql${suffix}/server"
"postgresql/${suffix}/server"
"pgsql-${suffix}/include/server")
endif()
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index e3eeea4..0e1429d 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -258,6 +258,7 @@ if(MSVC)
cmake_host_system_information(RESULT _vs_dir QUERY VS_${_vs_ver}_DIR) # undocumented query
if(IS_DIRECTORY "${_vs_dir}")
file(GLOB _vs_glob_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
+ list(REVERSE _vs_glob_redist_paths)
list(APPEND _vs_redist_paths ${_vs_glob_redist_paths})
endif()
unset(_vs_glob_redist_paths)
@@ -287,6 +288,9 @@ if(MSVC)
"${MSVC_CRT_DIR}/msvcp${v}.dll"
)
if(NOT vs VERSION_LESS 14)
+ if(EXISTS "${MSVC_CRT_DIR}/vcruntime${v}_1.dll")
+ list(APPEND __install__libs "${MSVC_CRT_DIR}/vcruntime${v}_1.dll")
+ endif()
list(APPEND __install__libs
"${MSVC_CRT_DIR}/vcruntime${v}.dll"
"${MSVC_CRT_DIR}/concrt${v}.dll"
@@ -305,6 +309,9 @@ if(MSVC)
"${MSVC_CRT_DIR}/msvcp${v}d.dll"
)
if(NOT vs VERSION_LESS 14)
+ if(EXISTS "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll")
+ list(APPEND __install__libs "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll")
+ endif()
list(APPEND __install__libs
"${MSVC_CRT_DIR}/vcruntime${v}d.dll"
"${MSVC_CRT_DIR}/concrt${v}d.dll"
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 0f2a2d2..9e785da 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -19,55 +19,57 @@ else()
set(CMake_VERSION_IS_RELEASE 0)
endif()
-if(EXISTS ${CMake_SOURCE_DIR}/.git)
- find_package(Git QUIET)
- if(GIT_FOUND)
- macro(_git)
- execute_process(
- COMMAND ${GIT_EXECUTABLE} ${ARGN}
- WORKING_DIRECTORY ${CMake_SOURCE_DIR}
- RESULT_VARIABLE _git_res
- OUTPUT_VARIABLE _git_out OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_VARIABLE _git_err ERROR_STRIP_TRAILING_WHITESPACE
- )
- endmacro()
- endif()
-endif()
-
-# Try to identify the current development source version.
-if(COMMAND _git)
- # Get the commit checked out in this work tree.
- _git(log -n 1 HEAD "--pretty=format:%h %s" --)
- set(git_info "${_git_out}")
-else()
- # Get the commit exported by 'git archive'.
+if(NOT CMake_VERSION_NO_GIT)
+ # If this source was exported by 'git archive', use its commit info.
set(git_info [==[$Format:%h %s$]==])
-endif()
-
-# Extract commit information if available.
-if(git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* (.*)$")
- # Have commit information.
- set(git_hash "${CMAKE_MATCH_1}")
- set(git_subject "${CMAKE_MATCH_2}")
- # If this is not the exact commit of a release, add dev info.
- if(NOT "${git_subject}" MATCHES "^[Cc][Mm]ake ${CMake_VERSION}$")
- set(CMake_VERSION "${CMake_VERSION}-g${git_hash}")
+ # Otherwise, try to identify the current development source version.
+ if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
+ AND EXISTS ${CMake_SOURCE_DIR}/.git)
+ find_package(Git QUIET)
+ if(GIT_FOUND)
+ macro(_git)
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} ${ARGN}
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ RESULT_VARIABLE _git_res
+ OUTPUT_VARIABLE _git_out OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _git_err ERROR_STRIP_TRAILING_WHITESPACE
+ )
+ endmacro()
+ endif()
+ if(COMMAND _git)
+ # Get the commit checked out in this work tree.
+ _git(log -n 1 HEAD "--pretty=format:%h %s" --)
+ set(git_info "${_git_out}")
+ endif()
endif()
- # If this is a work tree, check whether it is dirty.
- if(COMMAND _git)
- _git(update-index -q --refresh)
- _git(diff-index --name-only HEAD --)
- if(_git_out)
- set(CMake_VERSION_IS_DIRTY 1)
+ # Extract commit information if available.
+ if(git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* (.*)$")
+ # Have commit information.
+ set(git_hash "${CMAKE_MATCH_1}")
+ set(git_subject "${CMAKE_MATCH_2}")
+
+ # If this is not the exact commit of a release, add dev info.
+ if(NOT "${git_subject}" MATCHES "^[Cc][Mm]ake ${CMake_VERSION}$")
+ set(CMake_VERSION "${CMake_VERSION}-g${git_hash}")
+ endif()
+
+ # If this is a work tree, check whether it is dirty.
+ if(COMMAND _git)
+ _git(update-index -q --refresh)
+ _git(diff-index --name-only HEAD --)
+ if(_git_out)
+ set(CMake_VERSION_IS_DIRTY 1)
+ endif()
+ endif()
+ else()
+ # No commit information.
+ if(NOT CMake_VERSION_IS_RELEASE)
+ # Generic development version.
+ set(CMake_VERSION "${CMake_VERSION}-git")
endif()
- endif()
-else()
- # No commit information.
- if(NOT CMake_VERSION_IS_RELEASE)
- # Generic development version.
- set(CMake_VERSION "${CMake_VERSION}-git")
endif()
endif()
diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx
index a490e03..7fc33e6 100644
--- a/Source/cmVisualStudio10ToolsetOptions.cxx
+++ b/Source/cmVisualStudio10ToolsetOptions.cxx
@@ -34,8 +34,7 @@ std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName(
std::string const useToolset = this->GetToolsetName(name, toolset);
if (useToolset == "v142") {
- // FIXME: Add CSharp flag table for v142.
- return "v141";
+ return "v142";
} else if (useToolset == "v141") {
return "v141";
} else if (useToolset == "v140") {
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 50f47af..f63a264 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -423,6 +423,8 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
}
std::cout << "loading initial cache file " << path << "\n";
+ // Resolve script path specified on command line relative to $PWD.
+ path = cmSystemTools::CollapseFullPath(path);
this->ReadListFile(args, path);
} else if (arg.find("-P", 0) == 0) {
i++;
diff --git a/Templates/MSBuild/FlagTables/v142_CSharp.json b/Templates/MSBuild/FlagTables/v142_CSharp.json
new file mode 100644
index 0000000..5989aea
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v142_CSharp.json
@@ -0,0 +1,574 @@
+[
+ {
+ "name": "ProjectName",
+ "switch": "out:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:exe",
+ "comment": "",
+ "value": "Exe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:winexe",
+ "comment": "",
+ "value": "Winexe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:library",
+ "comment": "",
+ "value": "Library",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:module",
+ "comment": "",
+ "value": "Module",
+ "flags": []
+ },
+ {
+ "name": "DocumentationFile",
+ "switch": "doc",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x86",
+ "comment": "",
+ "value": "x86",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:Itanium",
+ "comment": "",
+ "value": "Itanium",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x64",
+ "comment": "",
+ "value": "x64",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:arm",
+ "comment": "",
+ "value": "arm",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu32bitpreferred",
+ "comment": "",
+ "value": "anycpu32bitpreferred",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu",
+ "comment": "",
+ "value": "anycpu",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "mit alias",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "dateiliste",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AddModules",
+ "switch": "addmodule:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Win32Resource",
+ "switch": "win32res:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationIcon",
+ "switch": "win32icon:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationManifest",
+ "switch": "win32manifest:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "NoWin32Manifest",
+ "switch": "nowin32manifest",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineDebug",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": [
+ "Continue"
+ ]
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:none",
+ "comment": "",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:full",
+ "comment": "",
+ "value": "full",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:pdbonly",
+ "comment": "",
+ "value": "pdbonly",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:0",
+ "comment": "",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:1",
+ "comment": "",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:2",
+ "comment": "",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "NoWarn",
+ "switch": "nowarn:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineConstants",
+ "switch": "define:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable",
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-1",
+ "comment": "",
+ "value": "ISO-1",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-2",
+ "comment": "",
+ "value": "ISO-2",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:5",
+ "comment": "",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:6",
+ "comment": "",
+ "value": "6",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:default",
+ "comment": "",
+ "value": "default",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyOriginatorKeyFile",
+ "switch": "keyfile",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "KeyContainerName",
+ "switch": "keycontainer",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoConfig",
+ "switch": "noconfig",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "baseaddress:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "CodePage",
+ "switch": "codepage",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "Utf8Output",
+ "switch": "utf8output",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "MainEntryPoint",
+ "switch": "main:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "GenerateFullPaths",
+ "switch": "fullpaths",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FileAlignment",
+ "switch": "filealign",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "PdbFile",
+ "switch": "pdb:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SubsystemVersion",
+ "switch": "subsystemversion",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibPaths",
+ "switch": "lib:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:none",
+ "comment": "Do Not Send Report",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:queue",
+ "comment": "Queue For Next Login",
+ "value": "queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:send",
+ "comment": "Send Automatically",
+ "value": "send",
+ "flags": []
+ }
+]
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 32b580b..b29638b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2353,6 +2353,18 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Objective-C/c-file-extension-test")
+ add_test(Objective-C.cxx-file-extension-test ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Objective-C/cxx-file-extension-test"
+ "${CMake_BINARY_DIR}/Tests/Objective-C/cxx-file-extension-test"
+ --build-two-config
+ ${build_generator_args}
+ --build-project cxx-file-extension-test
+ --build-options ${build_options}
+ --test-command cxx-file-extension-test
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Objective-C/cxx-file-extension-test")
+
add_test(Objective-C.objc-file-extension-test ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Objective-C/objc-file-extension-test"
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 060fb49..ef9198d 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -130,6 +130,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"
+ AND CMAKE_CXX_SIMULATE_VERSION VERSION_LESS 19.10)
+ list(REMOVE_ITEM CXX_non_features
+ cxx_relaxed_constexpr
+ )
+ endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
if (CMAKE_CXX_COMIPLER_VERSION VERSION_EQUAL 15.0)
list(REMOVE_ITEM CXX_non_features
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index 3ee60a6..e6b3ff6 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -2,7 +2,17 @@
template <long l>
struct Outputter;
-#if defined(_MSC_VER) && defined(_MSVC_LANG)
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
+# if defined(__INTEL_CXX11_MODE__)
+# if defined(__cpp_aggregate_nsdmi)
+# define CXX_STD 201402L
+# else
+# define CXX_STD 201103L
+# endif
+# else
+# define CXX_STD 199711L
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus
diff --git a/Tests/Objective-C/cxx-file-extension-test/CMakeLists.txt b/Tests/Objective-C/cxx-file-extension-test/CMakeLists.txt
new file mode 100644
index 0000000..eb065e4
--- /dev/null
+++ b/Tests/Objective-C/cxx-file-extension-test/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(cxx-file-extension-test)
+
+string(APPEND CMAKE_CXX_FLAGS " -std=c++11")
+set(CMAKE_CXX_STANDARD 14)
+
+add_executable(cxx-file-extension-test main.m)
diff --git a/Tests/Objective-C/cxx-file-extension-test/main.m b/Tests/Objective-C/cxx-file-extension-test/main.m
new file mode 100644
index 0000000..1c159a9
--- /dev/null
+++ b/Tests/Objective-C/cxx-file-extension-test/main.m
@@ -0,0 +1,8 @@
+#ifndef __OBJC__
+# error "Compiler cannot compile Objective-C"
+#endif
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
index 2a4ee64..b65a349 100644
--- a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
+++ b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
@@ -1,3 +1,3 @@
-^CMake Error: Error processing file: nosuchcachefile.txt
+^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine/C-no-file-build/nosuchcachefile.txt
CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/C-no-file-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/C_basic-stderr.txt b/Tests/RunCMake/CommandLine/C_basic-stderr.txt
new file mode 100644
index 0000000..62d0cd5
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic-stderr.txt
@@ -0,0 +1,4 @@
+initial-cache.txt: CMAKE_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+initial-cache.txt: CMAKE_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic-build
+CMakeLists.txt: INITIAL_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+CMakeLists.txt: INITIAL_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic-build
diff --git a/Tests/RunCMake/CommandLine/C_basic-stdout.txt b/Tests/RunCMake/CommandLine/C_basic-stdout.txt
new file mode 100644
index 0000000..74a938e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic-stdout.txt
@@ -0,0 +1 @@
+loading initial cache file ../C_basic_initial-cache.txt
diff --git a/Tests/RunCMake/CommandLine/C_basic.cmake b/Tests/RunCMake/CommandLine/C_basic.cmake
new file mode 100644
index 0000000..1a56593
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic.cmake
@@ -0,0 +1,2 @@
+message("CMakeLists.txt: INITIAL_SOURCE_DIR: ${INITIAL_SOURCE_DIR}")
+message("CMakeLists.txt: INITIAL_BINARY_DIR: ${INITIAL_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt b/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt
new file mode 100644
index 0000000..f382a01
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt
@@ -0,0 +1,4 @@
+initial-cache.txt: CMAKE_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+initial-cache.txt: CMAKE_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic_fullpath-build
+CMakeLists.txt: INITIAL_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+CMakeLists.txt: INITIAL_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic_fullpath-build
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt b/Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt
new file mode 100644
index 0000000..32724f5
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt
@@ -0,0 +1 @@
+loading initial cache file .*/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath.cmake b/Tests/RunCMake/CommandLine/C_basic_fullpath.cmake
new file mode 100644
index 0000000..1a56593
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_fullpath.cmake
@@ -0,0 +1,2 @@
+message("CMakeLists.txt: INITIAL_SOURCE_DIR: ${INITIAL_SOURCE_DIR}")
+message("CMakeLists.txt: INITIAL_BINARY_DIR: ${INITIAL_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt b/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt
new file mode 100644
index 0000000..e7a8ac9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt
@@ -0,0 +1,5 @@
+set(INITIAL_SOURCE_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "defined in initial.cmake")
+set(INITIAL_BINARY_DIR "${CMAKE_BINARY_DIR}" CACHE PATH "defined in initial.cmake")
+
+message("initial-cache.txt: CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
+message("initial-cache.txt: CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt b/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt
index 0d8f72e..4720a6f 100644
--- a/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt
@@ -1,8 +1,8 @@
initial-cache.txt: CMAKE_SOURCE_DIR: .*/C_buildsrcdir/src
-initial-cache.txt: CMAKE_BINARY_DIR: .*/C_buildsrcdir-build/DummyBuildDir
+initial-cache.txt: CMAKE_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
PreLoad.cmake: CMAKE_SOURCE_DIR: .*/C_buildsrcdir/src
-PreLoad.cmake: CMAKE_BINARY_DIR: .*/C_buildsrcdir-build/DummyBuildDir
+PreLoad.cmake: CMAKE_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
CMakeLists.txt: INITIAL_SOURCE_DIR: .*/C_buildsrcdir/src
-CMakeLists.txt: INITIAL_BINARY_DIR: .*/C_buildsrcdir-build/DummyBuildDir
+CMakeLists.txt: INITIAL_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
CMakeLists.txt: PRELOAD_SOURCE_DIR: .*/C_buildsrcdir/src
-CMakeLists.txt: PRELOAD_BINARY_DIR: .*/C_buildsrcdir-build/DummyBuildDir
+CMakeLists.txt: PRELOAD_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt b/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt
index c69b11e..862cfeb 100644
--- a/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt
@@ -1,2 +1,2 @@
-loading initial cache file .*/C_buildsrcdir/initial-cache.txt
+loading initial cache file .*initial-cache.txt
.*
diff --git a/Tests/RunCMake/CommandLine/Cno-file-stderr.txt b/Tests/RunCMake/CommandLine/Cno-file-stderr.txt
index 67a2032..416686c 100644
--- a/Tests/RunCMake/CommandLine/Cno-file-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Cno-file-stderr.txt
@@ -1,3 +1,3 @@
-^CMake Error: Error processing file: nosuchcachefile.txt
+^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine/Cno-file-build/nosuchcachefile.txt
CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/Cno-file-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index efd1cc2..b608d33 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -110,6 +110,14 @@ project(ExplicitDirsMissing LANGUAGES NONE)
file(REMOVE_RECURSE "${binary_dir}")
run_cmake_with_options(B-S -B${binary_dir} -S${source_dir})
+ message("copied to ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt")
+ file(COPY ${RunCMake_SOURCE_DIR}/C_buildsrcdir/initial-cache.txt DESTINATION ${RunCMake_TEST_BINARY_DIR})
+
+ # CMAKE_BINARY_DIR should be determined by -B if specified, and CMAKE_SOURCE_DIR determined by -S if specified.
+ # Path to initial-cache.txt is relative to the $PWD, which is normally set to ${RunCMake_TEST_BINARY_DIR}.
+ run_cmake_with_options(C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C initial-cache.txt)
+ # Test that full path works, too.
+ run_cmake_with_options(C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt)
endfunction()
run_ExplicitDirs()
@@ -406,9 +414,10 @@ run_cmake_command(P_working-dir ${CMAKE_COMMAND} -DEXPECTED_WORKING_DIR=${RunCMa
# Tests the values of CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRENT_SOURCE_DIR.
run_cmake_command(P_working-dir ${CMAKE_COMMAND} -DEXPECTED_WORKING_DIR=${RunCMake_BINARY_DIR}/P_working-dir-build -P ${RunCMake_SOURCE_DIR}/P_working-dir.cmake -S something_else -B something_else_1)
-# CMAKE_BINARY_DIR should be determined by -B if specified, and CMAKE_SOURCE_DIR determined by -S if specified.
-run_cmake_with_options(C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C ${RunCMake_SOURCE_DIR}/C_buildsrcdir/initial-cache.txt)
-
+# Place an initial cache where C_basic will find it when passed the relative path "..".
+file(COPY ${RunCMake_SOURCE_DIR}/C_basic_initial-cache.txt DESTINATION ${RunCMake_BINARY_DIR})
+run_cmake_with_options(C_basic -C ../C_basic_initial-cache.txt)
+run_cmake_with_options(C_basic_fullpath -C ${RunCMake_BINARY_DIR}/C_basic_initial-cache.txt)
set(RunCMake_TEST_OPTIONS
"-DFOO=-DBAR:BOOL=BAZ")