summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/generator/Visual Studio 15 2017.rst12
-rw-r--r--Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst4
-rw-r--r--Help/release/3.9.rst9
-rw-r--r--Help/release/index.rst2
-rw-r--r--Modules/CMakeCUDAInformation.cmake4
-rw-r--r--Modules/Compiler/Clang-FindBinUtils.cmake2
-rw-r--r--Modules/Compiler/GNU-FindBinUtils.cmake2
-rw-r--r--Modules/FindBoost.cmake2
-rw-r--r--Modules/FindDoxygen.cmake36
-rw-r--r--Modules/FindJava.cmake4
-rw-r--r--Modules/GetPrerequisites.cmake2
-rw-r--r--Modules/Platform/Android-Common.cmake15
-rw-r--r--Modules/Platform/Android/ndk-stl-c++_shared.cmake1
-rw-r--r--Modules/UseSWIG.cmake6
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/bindexplib.cxx22
-rw-r--r--Source/cmFindBase.cxx2
-rw-r--r--Source/cmFindCommon.cxx14
-rw-r--r--Source/cmFindCommon.h5
-rw-r--r--Source/cmFindPackageCommand.cxx23
-rw-r--r--Source/cmFindPackageCommand.h1
-rw-r--r--Source/cmGeneratorTarget.cxx23
-rw-r--r--Source/cmGeneratorTarget.h5
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx20
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h9
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio15Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx20
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx19
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
-rw-r--r--Source/cmLocalGenerator.cxx26
-rw-r--r--Source/cmMakefile.cxx21
-rw-r--r--Source/cmNinjaTargetGenerator.cxx27
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx7
-rw-r--r--Source/cmQtAutoGenerators.cxx60
-rw-r--r--Source/cmServerProtocol.cxx4
-rw-r--r--Source/cmVS10RCFlagTable.h1
-rw-r--r--Source/cmVS11RCFlagTable.h1
-rw-r--r--Source/cmVS12RCFlagTable.h1
-rw-r--r--Source/cmVS140LinkFlagTable.h (renamed from Source/cmVS14LinkFlagTable.h)12
-rw-r--r--Source/cmVS141LinkFlagTable.h283
-rw-r--r--Source/cmVS14RCFlagTable.h1
-rw-r--r--Source/cmVSSetupHelper.cxx28
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx90
-rw-r--r--Source/cmVisualStudio10ToolsetOptions.cxx9
-rw-r--r--Templates/TestDriver.cxx.in4
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/CSharpLinkToCxx/CMakeLists.txt17
-rw-r--r--Tests/CSharpLinkToCxx/cli.cpp10
-rw-r--r--Tests/CSharpLinkToCxx/cli.hpp10
-rw-r--r--Tests/CSharpLinkToCxx/csharp.cs16
-rw-r--r--Tests/CudaOnly/SeparateCompilation/CMakeLists.txt9
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt1
-rw-r--r--Tests/CudaOnly/WithDefs/main.notcu4
-rw-r--r--Tests/QtAutogen/mocDepends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/mocRerun/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/Android/android_sysinc.c7
-rw-r--r--Tests/RunCMake/Android/android_sysinc.cxx7
-rw-r--r--Tests/RunCMake/Android/common.cmake16
-rw-r--r--Tests/RunCMake/Android/sysinc/dlfcn.h1
-rw-r--r--Tests/RunCMake/AutoExportDll/foo.c2
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx10
-rw-r--r--Tests/RunCMake/ObjectLibrary/OwnSources-result.txt1
-rw-r--r--Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt5
-rw-r--r--Tests/RunCMake/ObjectLibrary/OwnSources.cmake2
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VSSolution/MorePost-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/MorePre-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/OnePost-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/OnePre-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/Override1-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/Override2-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/Override3-check.cmake3
-rw-r--r--Tests/RunCMake/VSSolution/Override3.cmake4
-rw-r--r--Tests/RunCMake/VSSolution/PrePost-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VSSolution/solution_parsing.cmake3
-rw-r--r--Tests/RunCMake/find_package/PackageRoot-stderr.txt308
-rw-r--r--Tests/RunCMake/find_package/PackageRoot.cmake114
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/BarConfig.cmake9
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/FindBar.cmake3
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake6
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h0
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h0
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake9
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h0
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/foo/env_root/cmake/BarConfig.cmake9
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h0
-rw-r--r--Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt298
-rw-r--r--Tests/RunCMake/find_package/PackageRootNestedConfig.cmake135
-rw-r--r--Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt298
-rw-r--r--Tests/RunCMake/find_package/PackageRootNestedModule.cmake135
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt9
-rw-r--r--Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt1
-rw-r--r--Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake4
-rw-r--r--Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake4
-rw-r--r--Tests/RunCMake/find_package/WrongVersion-stderr.txt11
-rw-r--r--Tests/RunCMake/find_package/WrongVersion.cmake2
-rw-r--r--Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt11
-rw-r--r--Tests/RunCMake/find_package/WrongVersionConfig.cmake2
-rw-r--r--Tests/RunCMake/target_compile_features/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/alias_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/alias_target.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/cxx_not_enabled-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt4
-rw-r--r--Tests/RunCMake/target_compile_features/cxx_not_enabled.cmake2
-rw-r--r--Tests/RunCMake/target_compile_features/imported_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/imported_target.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/invalid_args-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/invalid_args.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/no_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/no_target.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/not_a_c_feature.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/not_enough_args.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/utility_target-stderr.txt2
-rw-r--r--Tests/VSResource/CMakeLists.txt4
-rw-r--r--Utilities/Sphinx/cmake.py17
-rw-r--r--Utilities/cmcurl/CMakeLists.txt2
132 files changed, 1832 insertions, 602 deletions
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index a88f8bc..2ac0449 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -15,6 +15,18 @@ a target platform name optionally at the end of this generator name:
``Visual Studio 15 2017 ARM``
Specify target platform ``ARM``.
+Instance Selection
+^^^^^^^^^^^^^^^^^^
+
+VS 2017 supports multiple installations on the same machine.
+CMake queries the Visual Studio Installer to locate VS instances.
+If more than one instance is installed we do not define which one
+is chosen by default. If the ``VS150COMNTOOLS`` environment variable
+is set and points to the ``Common7/Tools`` directory within one of
+the instances, that instance will be used. The environment variable
+must remain consistently set whenever CMake is re-run within a given
+build tree.
+
Toolset Selection
^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
index dcd2a4e..a316abe 100644
--- a/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
+++ b/Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
@@ -26,4 +26,6 @@ and ExtensibilityAddIns by default. If you set the corresponding
property, it will override the default section. For example, setting
VS_GLOBAL_SECTION_POST_ExtensibilityGlobals will override the default
contents of the ExtensibilityGlobals section, while keeping
-ExtensibilityAddIns on its default.
+ExtensibilityAddIns on its default. However, CMake will always
+add a ``SolutionGuid`` to the ``ExtensibilityGlobals`` section
+if it is not specified explicitly.
diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst
index cd9476d..14e8699 100644
--- a/Help/release/3.9.rst
+++ b/Help/release/3.9.rst
@@ -16,6 +16,8 @@ Languages
* ``CUDA`` is now supported by the :ref:`Visual Studio Generators`
for VS 2010 and above. This complements the existing support by the
:ref:`Makefile Generators` and the :generator:`Ninja` generator.
+ CUDA 8.0.61 or higher is recommended due to known bugs in the VS
+ integration by earlier versions.
* CMake is now aware of the :prop_tgt:`C++ standards <CXX_STANDARD>` and
:prop_tgt:`C standards <C_STANDARD>` and their associated meta-features for
@@ -32,6 +34,8 @@ Generators
This is an experimental feature and can be activated by setting the
:variable:`CMAKE_XCODE_GENERATE_SCHEME` variable to a ``TRUE`` value.
+* The :generator:`Xcode` generator now supports Xcode 9.
+
Commands
--------
@@ -317,3 +321,8 @@ Other Changes
* On macOS, ``RPATH`` settings such as :prop_tgt:`BUILD_WITH_INSTALL_RPATH`
no longer affect the ``install_name`` field. See policy :policy:`CMP0068`.
+
+* The :generator:`Visual Studio 14 2015` generator has been taught about
+ a change to the ``v140`` toolset made by a VS 2015 update. VS changed
+ the set of values it understands for the ``GenerateDebugInformation``
+ linker setting that produces the ``-DEBUG`` linker flag variants.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 8222d0c..6af282c 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -1,3 +1,5 @@
+:orphan:
+
CMake Release Notes
*******************
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 780e953..9bba847 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -104,7 +104,9 @@ include(CMakeCommonLanguageInclude)
# now define the following rules:
# CMAKE_CUDA_CREATE_SHARED_LIBRARY
# CMAKE_CUDA_CREATE_SHARED_MODULE
-# CMAKE_CUDA_COMPILE_OBJECT
+# CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
+# CMAKE_CUDA_COMPILE_PTX_COMPILATION
+# CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
# CMAKE_CUDA_LINK_EXECUTABLE
if(CMAKE_CUDA_HOST_COMPILER)
diff --git a/Modules/Compiler/Clang-FindBinUtils.cmake b/Modules/Compiler/Clang-FindBinUtils.cmake
index c81e77a..e2822a1 100644
--- a/Modules/Compiler/Clang-FindBinUtils.cmake
+++ b/Modules/Compiler/Clang-FindBinUtils.cmake
@@ -16,6 +16,7 @@ find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
HINTS ${__clang_hints}
DOC "LLVM archiver"
)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ranlib.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
@@ -23,3 +24,4 @@ find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
HINTS ${__clang_hints}
DOC "Generate index for LLVM archive"
)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB)
diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake
index 142636c..16b7bbd 100644
--- a/Modules/Compiler/GNU-FindBinUtils.cmake
+++ b/Modules/Compiler/GNU-FindBinUtils.cmake
@@ -22,6 +22,7 @@ find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
HINTS ${__gcc_hints}
DOC "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler"
)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ranlib.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
@@ -31,3 +32,4 @@ find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
HINTS ${__gcc_hints}
DOC "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler"
)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index cc273e0..b4abf75 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -244,6 +244,8 @@ if (NOT Boost_NO_BOOST_CMAKE)
message("Found Boost components:")
message(" ${Boost_FIND_COMPONENTS}")
endif()
+ # Restore project's policies
+ cmake_policy(POP)
return()
endif()
endif()
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 0d9e161..46bf340 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -179,7 +179,8 @@ Functions
will be converted to an absolute path relative to the current binary
directory. This is necessary because doxygen will normally be run from a
directory within the source tree so that relative source paths work as
- expected.
+ expected. If this directory does not exist, it will be recursively created
+ prior to executing the doxygen commands.
To change any of these defaults or override any other Doxygen config option,
set relevant variables before calling ``doxygen_add_docs()``. For example:
@@ -389,10 +390,10 @@ macro(_Doxygen_find_doxygen)
COMMAND "${DOXYGEN_EXECUTABLE}" --version
OUTPUT_VARIABLE DOXYGEN_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
- RESULT_VARIABLE result
+ RESULT_VARIABLE _Doxygen_version_result
)
- if(result)
- message(WARNING "Unable to determine doxygen version: ${result}")
+ if(_Doxygen_version_result)
+ message(WARNING "Unable to determine doxygen version: ${_Doxygen_version_result}")
endif()
# Create an imported target for Doxygen
@@ -619,15 +620,15 @@ if(TARGET Doxygen::doxygen)
# If doxygen was found, use it to generate a minimal default Doxyfile.
# We will delete this file after we have finished using it below to
# generate the other files that doxygen_add_docs() will use.
- set(_Doxygen_tpl "${PROJECT_BINARY_DIR}/CMakeDoxyfile.tpl")
+ set(_Doxygen_tpl "${CMAKE_BINARY_DIR}/CMakeDoxyfile.tpl")
execute_process(
COMMAND "${DOXYGEN_EXECUTABLE}" -s -g "${_Doxygen_tpl}"
OUTPUT_QUIET
- RESULT_VARIABLE result
+ RESULT_VARIABLE _Doxygen_tpl_result
)
- if(result)
+ if(_Doxygen_tpl_result)
message(FATAL_ERROR
- "Unable to generate Doxyfile template: ${result}")
+ "Unable to generate Doxyfile template: ${_Doxygen_tpl_result}")
elseif(NOT EXISTS "${_Doxygen_tpl}")
message(FATAL_ERROR
"Doxygen has failed to generate a Doxyfile template")
@@ -646,8 +647,8 @@ if(TARGET Doxygen::doxygen)
# content is only dependent on the version of Doxygen being used. Therefore
# we always put them at the top of the build tree so that they are in a
# predictable location.
- set(_doxyfile_in "${PROJECT_BINARY_DIR}/CMakeDoxyfile.in")
- set(_doxyfile_defaults "${PROJECT_BINARY_DIR}/CMakeDoxygenDefaults.cmake")
+ set(_doxyfile_in "${CMAKE_BINARY_DIR}/CMakeDoxyfile.in")
+ set(_doxyfile_defaults "${CMAKE_BINARY_DIR}/CMakeDoxygenDefaults.cmake")
file(WRITE "${_doxyfile_in}" ${_Doxygen_dne_header})
file(WRITE "${_doxyfile_defaults}" ${_Doxygen_dne_header})
@@ -896,7 +897,7 @@ doxygen_add_docs() for target ${targetName}")
# Now bring in Doxgen's defaults for those things the project has not
# already set and we have not provided above
- include("${PROJECT_BINARY_DIR}/CMakeDoxygenDefaults.cmake" OPTIONAL)
+ include("${CMAKE_BINARY_DIR}/CMakeDoxygenDefaults.cmake" OPTIONAL)
# Cleanup built HTMLs on "make clean"
# TODO Any other dirs?
@@ -1020,18 +1021,25 @@ doxygen_add_docs() for target ${targetName}")
WARN_LOGFILE
XML_OUTPUT
)
+
+ # Store the unmodified value of DOXYGEN_OUTPUT_DIRECTORY prior to invoking
+ # doxygen_quote_value() below. This will mutate the string specifically for
+ # consumption by Doxygen's config file, which we do not want when we use it
+ # later in the custom target's commands.
+ set( _original_doxygen_output_dir ${DOXYGEN_OUTPUT_DIRECTORY} )
+
foreach(_item IN LISTS _doxygen_quoted_options)
doxygen_quote_value(DOXYGEN_${_item})
endforeach()
# Prepare doxygen configuration file
- set(_doxyfile_template "${PROJECT_BINARY_DIR}/CMakeDoxyfile.in")
+ set(_doxyfile_template "${CMAKE_BINARY_DIR}/CMakeDoxyfile.in")
set(_target_doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${targetName}")
configure_file("${_doxyfile_template}" "${_target_doxyfile}")
# Add the target
- add_custom_target(
- ${targetName}
+ add_custom_target( ${targetName} VERBATIM
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${_original_doxygen_output_dir}
COMMAND "${DOXYGEN_EXECUTABLE}" "${_target_doxyfile}"
WORKING_DIRECTORY "${_args_WORKING_DIRECTORY}"
DEPENDS "${_target_doxyfile}"
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 3d32560..eb2242b 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -90,7 +90,7 @@ list(APPEND _JAVA_HINTS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.9;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.8;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.7;JavaHome]/bin"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\2.6;JavaHome]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.6;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.5;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.4;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.3;JavaHome]/bin"
@@ -143,7 +143,7 @@ if(Java_JAVA_EXECUTABLE)
if(var MATCHES "java version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\"")
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
- elseif(var MATCHES "openjdk version \"([0-9]+)-[a-z]+\"")
+ elseif(var MATCHES "openjdk version \"([0-9]+)-[A-Za-z]+\"")
# OpenJDK 9 early access builds or locally built
set(Java_VERSION_STRING "1.${CMAKE_MATCH_1}.0")
elseif(var MATCHES "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+)\"")
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 0090cdc..4e52cb3 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -609,7 +609,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(NOT is_embedded)
if(NOT IS_ABSOLUTE "${resolved_file}")
- if(lower MATCHES "^msvc[^/]+dll" AND is_system)
+ if(lower MATCHES "^(msvc|api-ms-win-)[^/]+dll" AND is_system)
message(STATUS "info: non-absolute msvc file '${file}' returning type '${type}'")
else()
message(STATUS "warning: gp_resolved_file_type non-absolute file '${file}' returning type '${type}' -- possibly incorrect")
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake
index ac72676..80a8f41 100644
--- a/Modules/Platform/Android-Common.cmake
+++ b/Modules/Platform/Android-Common.cmake
@@ -160,10 +160,19 @@ macro(__android_compiler_common lang)
# Do not do this for a standalone toolchain because it is already
# tied to a specific API version.
if(CMAKE_ANDROID_NDK)
- list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include")
+ if(CMAKE_SYSROOT_COMPILE)
+ set(_cmake_sysroot_compile "${CMAKE_SYSROOT_COMPILE}")
+ else()
+ set(_cmake_sysroot_compile "${CMAKE_SYSROOT}")
+ endif()
if(NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS)
- list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include/${CMAKE_ANDROID_ARCH_HEADER_TRIPLE}")
+ list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES
+ "${_cmake_sysroot_compile}/usr/include"
+ "${_cmake_sysroot_compile}/usr/include/${CMAKE_ANDROID_ARCH_HEADER_TRIPLE}"
+ )
+ else()
+ list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${_cmake_sysroot_compile}/usr/include")
endif()
- list(REMOVE_ITEM CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include")
+ unset(_cmake_sysroot_compile)
endif()
endmacro()
diff --git a/Modules/Platform/Android/ndk-stl-c++_shared.cmake b/Modules/Platform/Android/ndk-stl-c++_shared.cmake
index f585adb..3389408 100644
--- a/Modules/Platform/Android/ndk-stl-c++_shared.cmake
+++ b/Modules/Platform/Android/ndk-stl-c++_shared.cmake
@@ -1,4 +1,5 @@
include(Platform/Android/ndk-stl-c++)
macro(__android_stl lang)
__android_stl_cxx(${lang} libc++_shared.so)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libandroid_support.a" 0)
endmacro()
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index bfe1a6f..fc815dd 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -125,8 +125,10 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
endif()
foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSIONS})
- set(${outfiles} ${${outfiles}}
- "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}${it}")
+ set(extra_file "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}${it}")
+ list(APPEND ${outfiles} ${extra_file})
+ # Treat extra outputs as plain files regardless of language.
+ set_property(SOURCE "${extra_file}" PROPERTY LANGUAGE "")
endforeach()
endmacro()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e458a96..0f5201b 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,4 +2,4 @@
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 9)
set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_RC 3)
+#set(CMake_VERSION_RC 0)
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index cd1fb8a..e96226a 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -242,24 +242,26 @@ public:
// Check whether it is "Scalar deleting destructor" and "Vector
// deleting destructor"
- // if scalarPrefix and vectorPrefix are not found then print the
- // symbol
+ // if scalarPrefix and vectorPrefix are not found then print
+ // the symbol
const char* scalarPrefix = "??_G";
const char* vectorPrefix = "??_E";
+ // The original code had a check for
+ // symbol.find("real@") == std::string::npos)
+ // but this disallows member functions with the name "real".
if (symbol.compare(0, 4, scalarPrefix) &&
symbol.compare(0, 4, vectorPrefix)) {
SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
.Characteristics;
-
// skip symbols containing a dot
if (symbol.find('.') == std::string::npos) {
- if (SectChar & IMAGE_SCN_MEM_EXECUTE) {
- this->Symbols.insert(symbol);
- } else if (SectChar & IMAGE_SCN_MEM_READ) {
- // skip __real@ and __xmm@
- if (symbol.find("_real") == std::string::npos &&
- symbol.find("_xmm") == std::string::npos) {
- this->DataSymbols.insert(symbol);
+ if (!pSymbolTable->Type && (SectChar & IMAGE_SCN_MEM_WRITE)) {
+ // Read only (i.e. constants) must be excluded
+ this->DataSymbols.insert(symbol);
+ } else {
+ if (pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ) ||
+ (SectChar & IMAGE_SCN_MEM_EXECUTE)) {
+ this->Symbols.insert(symbol);
}
}
}
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 581c401..e378208 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -216,6 +216,8 @@ void cmFindBase::FillPackageRootPath()
paths.AddCMakePrefixPath(varName);
paths.AddEnvPrefixPath(varName);
}
+
+ paths.AddSuffixes(this->SearchPathSuffixes);
}
void cmFindBase::FillCMakeVariablePath()
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 103e692..fd0e317 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -11,7 +11,7 @@
cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL");
cmFindCommon::PathLabel cmFindCommon::PathLabel::PackageRoot(
- "PacakgeName_ROOT");
+ "PackageName_ROOT");
cmFindCommon::PathLabel cmFindCommon::PathLabel::CMake("CMAKE");
cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment(
"CMAKE_ENVIRONMENT");
@@ -231,18 +231,6 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
}
}
-void cmFindCommon::FilterPaths(const std::vector<std::string>& inPaths,
- const std::set<std::string>& ignore,
- std::vector<std::string>& outPaths)
-{
- for (std::vector<std::string>::const_iterator i = inPaths.begin();
- i != inPaths.end(); ++i) {
- if (ignore.count(*i) == 0) {
- outPaths.push_back(*i);
- }
- }
-}
-
void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore)
{
// null-terminated list of paths.
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 2eed47b..7954267 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -81,11 +81,6 @@ protected:
void GetIgnoredPaths(std::vector<std::string>& ignore);
void GetIgnoredPaths(std::set<std::string>& ignore);
- /** Remove paths in the ignore set from the supplied vector. */
- void FilterPaths(const std::vector<std::string>& inPaths,
- const std::set<std::string>& ignore,
- std::vector<std::string>& outPaths);
-
/** Compute final search path list (reroot + trailing slash). */
void ComputeFinalPaths();
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 65670e5..ca47535 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -739,7 +739,8 @@ bool cmFindPackageCommand::HandlePackageMode()
if (result && !found) {
// warn if package required or neither quiet nor in config mode
if (this->Required ||
- !(this->Quiet || (this->UseConfigFiles && !this->UseFindModules))) {
+ !(this->Quiet || (this->UseConfigFiles && !this->UseFindModules &&
+ this->ConsideredConfigs.empty()))) {
// The variable is not set.
std::ostringstream e;
std::ostringstream aw;
@@ -1089,6 +1090,9 @@ void cmFindPackageCommand::AppendSuccessInformation()
void cmFindPackageCommand::ComputePrefixes()
{
if (!this->NoDefaultPath) {
+ if (!this->NoPackageRootPath) {
+ this->FillPrefixesPackageRoot();
+ }
if (!this->NoCMakePath) {
this->FillPrefixesCMakeVariable();
}
@@ -1116,6 +1120,23 @@ void cmFindPackageCommand::ComputePrefixes()
this->ComputeFinalPaths();
}
+void cmFindPackageCommand::FillPrefixesPackageRoot()
+{
+ cmSearchPath& paths = this->LabeledPaths[PathLabel::PackageRoot];
+
+ // Add package specific search prefixes
+ // NOTE: This should be using const_reverse_iterator but HP aCC and
+ // Oracle sunCC both currently have standard library issues
+ // with the reverse iterator APIs.
+ for (std::deque<std::string>::reverse_iterator pkg =
+ this->Makefile->FindPackageModuleStack.rbegin();
+ pkg != this->Makefile->FindPackageModuleStack.rend(); ++pkg) {
+ std::string varName = *pkg + "_ROOT";
+ paths.AddCMakePath(varName);
+ paths.AddEnvPath(varName);
+ }
+}
+
void cmFindPackageCommand::FillPrefixesCMakeEnvironment()
{
cmSearchPath& paths = this->LabeledPaths[PathLabel::CMakeEnvironment];
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 318b1dc..99b0059 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -100,6 +100,7 @@ private:
void StoreVersionFound();
void ComputePrefixes();
+ void FillPrefixesPackageRoot();
void FillPrefixesCMakeEnvironment();
void FillPrefixesCMakeVariable();
void FillPrefixesSystemEnvironment();
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b93442d..329c7a9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1025,12 +1025,23 @@ cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources(
std::string const key = cmSystemTools::UpperCase(config);
KindedSourcesMapType::iterator it = this->KindedSourcesMap.find(key);
if (it != this->KindedSourcesMap.end()) {
+ if (!it->second.Initialized) {
+ std::ostringstream e;
+ e << "The SOURCES of \"" << this->GetName()
+ << "\" use a generator expression that depends on the "
+ "SOURCES themselves.";
+ this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
+ cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
+ static KindedSources empty;
+ return empty;
+ }
return it->second;
}
// Add an entry to the map for this configuration.
KindedSources& files = this->KindedSourcesMap[key];
this->ComputeKindedSources(files, config);
+ files.Initialized = true;
return files;
}
@@ -2633,18 +2644,6 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
cmDeleteAll(linkInterfaceIncludeDirectoriesEntries);
- // Add standard include directories for this language.
- std::string const standardIncludesVar =
- "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES";
- std::string const standardIncludes =
- this->Makefile->GetSafeDefinition(standardIncludesVar);
- std::vector<std::string>::size_type const before = includes.size();
- cmSystemTools::ExpandListArgument(standardIncludes, includes);
- for (std::vector<std::string>::iterator i = includes.begin() + before;
- i != includes.end(); ++i) {
- cmSystemTools::ConvertToUnixSlashes(*i);
- }
-
return includes;
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index c04d62b..52147e3 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -107,6 +107,11 @@ public:
std::set<std::string> ExpectedResxHeaders;
std::set<std::string> ExpectedXamlHeaders;
std::set<std::string> ExpectedXamlSources;
+ bool Initialized;
+ KindedSources()
+ : Initialized(false)
+ {
+ }
};
/** Get all sources needed for a configuration with kinds assigned. */
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 0e02b0a..4fff11a 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -130,6 +130,7 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
this->DefaultNasmFlagTable = cmVS10NASMFlagTable;
this->DefaultRcFlagTable = cmVS10RCFlagTable;
this->Version = VS10;
+ this->PlatformToolsetNeedsDebugEnum = false;
}
bool cmGlobalVisualStudio10Generator::MatchesGeneratorName(
@@ -195,6 +196,24 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
return false;
}
+ if (cmHasLiteralPrefix(this->GetPlatformToolsetString(), "v140")) {
+ // The GenerateDebugInformation link setting for the v140 toolset
+ // in VS 2015 was originally an enum with "No" and "Debug" values,
+ // differing from the "false" and "true" values used in older toolsets.
+ // A VS 2015 update changed it back. Parse the "link.xml" file to
+ // discover which one we need.
+ std::string const link_xml = this->VCTargetsPath + "/1033/link.xml";
+ cmsys::ifstream fin(link_xml.c_str());
+ std::string line;
+ while (fin && cmSystemTools::GetLineFromStream(fin, line)) {
+ if (line.find(" Switch=\"DEBUG\" ") != std::string::npos) {
+ this->PlatformToolsetNeedsDebugEnum =
+ line.find(" Name=\"Debug\" ") != std::string::npos;
+ break;
+ }
+ }
+ }
+
if (this->GeneratorToolsetCuda.empty()) {
// Find the highest available version of the CUDA tools.
std::vector<std::string> cudaTools;
@@ -738,6 +757,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
std::vector<std::string> cmd;
cmd.push_back(this->GetMSBuildCommand());
cmd.push_back(vcxproj);
+ cmd.push_back("/p:Configuration=Debug");
cmd.push_back(std::string("/p:VisualStudioVersion=") +
this->GetIDEVersion());
std::string out;
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 20f992a..4a5c245 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -59,6 +59,13 @@ public:
const char* GetPlatformToolsetCuda() const;
std::string const& GetPlatformToolsetCudaString() const;
+ /** Return whether we need to use No/Debug instead of false/true
+ for GenerateDebugInformation. */
+ bool GetPlatformToolsetNeedsDebugEnum() const
+ {
+ return this->PlatformToolsetNeedsDebugEnum;
+ }
+
/** Return the CMAKE_SYSTEM_NAME. */
std::string const& GetSystemName() const { return this->SystemName; }
@@ -169,6 +176,8 @@ private:
virtual std::string FindDevEnvCommand();
virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
+ bool PlatformToolsetNeedsDebugEnum;
+
bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf);
std::string VCTargetsPath;
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index df086d3..c8cf02c 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -8,8 +8,8 @@
#include "cmMakefile.h"
#include "cmVS140CLFlagTable.h"
#include "cmVS140CSharpFlagTable.h"
+#include "cmVS140LinkFlagTable.h"
#include "cmVS14LibFlagTable.h"
-#include "cmVS14LinkFlagTable.h"
#include "cmVS14MASMFlagTable.h"
#include "cmVS14RCFlagTable.h"
@@ -93,7 +93,7 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
this->DefaultClFlagTable = cmVS140CLFlagTable;
this->DefaultCSharpFlagTable = cmVS140CSharpFlagTable;
this->DefaultLibFlagTable = cmVS14LibFlagTable;
- this->DefaultLinkFlagTable = cmVS14LinkFlagTable;
+ this->DefaultLinkFlagTable = cmVS140LinkFlagTable;
this->DefaultMasmFlagTable = cmVS14MASMFlagTable;
this->DefaultRcFlagTable = cmVS14RCFlagTable;
this->Version = VS14;
diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx
index da2bf8c..ce1ba00 100644
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ b/Source/cmGlobalVisualStudio15Generator.cxx
@@ -8,6 +8,7 @@
#include "cmMakefile.h"
#include "cmVS141CLFlagTable.h"
#include "cmVS141CSharpFlagTable.h"
+#include "cmVS141LinkFlagTable.h"
#include "cmVSSetupHelper.h"
static const char vs15generatorName[] = "Visual Studio 15 2017";
@@ -85,6 +86,7 @@ cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator(
this->DefaultPlatformToolset = "v141";
this->DefaultClFlagTable = cmVS141CLFlagTable;
this->DefaultCSharpFlagTable = cmVS141CSharpFlagTable;
+ this->DefaultLinkFlagTable = cmVS141LinkFlagTable;
this->Version = VS15;
}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index f067d8f..b155f5b 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -520,6 +520,7 @@ std::string cmGlobalVisualStudio7Generator::ConvertToSolutionPath(
void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
std::ostream& fout, cmLocalGenerator* root)
{
+ std::string const guid = this->GetGUID(root->GetProjectName() + ".sln");
bool extensibilityGlobalsOverridden = false;
bool extensibilityAddInsOverridden = false;
const std::vector<std::string> propKeys =
@@ -538,11 +539,14 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
} else
continue;
if (!name.empty()) {
- if (name == "ExtensibilityGlobals" && sectionType == "postSolution")
+ bool addGuid = false;
+ if (name == "ExtensibilityGlobals" && sectionType == "postSolution") {
+ addGuid = true;
extensibilityGlobalsOverridden = true;
- else if (name == "ExtensibilityAddIns" &&
- sectionType == "postSolution")
+ } else if (name == "ExtensibilityAddIns" &&
+ sectionType == "postSolution") {
extensibilityAddInsOverridden = true;
+ }
fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n";
std::vector<std::string> keyValuePairs;
cmSystemTools::ExpandListArgument(
@@ -557,15 +561,23 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
const std::string value =
cmSystemTools::TrimWhitespace(itPair->substr(posEqual + 1));
fout << "\t\t" << key << " = " << value << "\n";
+ if (key == "SolutionGuid") {
+ addGuid = false;
+ }
}
}
+ if (addGuid) {
+ fout << "\t\tSolutionGuid = {" << guid << "}\n";
+ }
fout << "\tEndGlobalSection\n";
}
}
}
- if (!extensibilityGlobalsOverridden)
+ if (!extensibilityGlobalsOverridden) {
fout << "\tGlobalSection(ExtensibilityGlobals) = postSolution\n"
+ << "\t\tSolutionGuid = {" << guid << "}\n"
<< "\tEndGlobalSection\n";
+ }
if (!extensibilityAddInsOverridden)
fout << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
<< "\tEndGlobalSection\n";
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 45c1764..3cd14e1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -147,7 +147,7 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(
this->XcodeBuildCommandInitialized = false;
this->ObjectDirArchDefault = "$(CURRENT_ARCH)";
- this->ComputeObjectDirArch();
+ this->ObjectDirArch = this->ObjectDirArchDefault;
cm->GetState()->SetIsGeneratorMultiConfig(true);
}
@@ -1517,6 +1517,17 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
makecmd += " all";
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
+
+ cmXCodeObject* outputFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
+ i != commands.end(); ++i) {
+ std::vector<std::string> const& outputs = i->GetOutputs();
+ for (std::vector<std::string>::const_iterator j = outputs.begin();
+ j != outputs.end(); ++j) {
+ outputFiles->AddObject(this->CreateString(*j));
+ }
+ }
+ buildphase->AddAttribute("outputPaths", outputFiles);
}
void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
@@ -3087,12 +3098,12 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
}
}
- this->ComputeObjectDirArch();
+ this->ComputeObjectDirArch(mf);
}
-void cmGlobalXCodeGenerator::ComputeObjectDirArch()
+void cmGlobalXCodeGenerator::ComputeObjectDirArch(cmMakefile* mf)
{
- if (this->Architectures.size() > 1) {
+ if (this->Architectures.size() > 1 || this->UseEffectivePlatformName(mf)) {
this->ObjectDirArch = "$(CURRENT_ARCH)";
} else if (!this->Architectures.empty()) {
this->ObjectDirArch = this->Architectures[0];
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index f38fa3c..e69793b 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -247,7 +247,7 @@ private:
const cmGeneratorTarget* t) const;
void ComputeArchitectures(cmMakefile* mf);
- void ComputeObjectDirArch();
+ void ComputeObjectDirArch(cmMakefile* mf);
void addObject(cmXCodeObject* obj);
std::string PostBuildMakeTarget(std::string const& tName,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8e00303..6ce31c5 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -916,6 +916,20 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
}
+ // Add standard include directories for this language.
+ // We do not filter out implicit directories here.
+ std::string const standardIncludesVar =
+ "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES";
+ std::string const standardIncludes =
+ this->Makefile->GetSafeDefinition(standardIncludesVar);
+ std::vector<std::string>::size_type const before = includes.size();
+ cmSystemTools::ExpandListArgument(standardIncludes, includes);
+ for (std::vector<std::string>::iterator i = includes.begin() + before;
+ i != includes.end(); ++i) {
+ cmSystemTools::ConvertToUnixSlashes(*i);
+ dirs.push_back(*i);
+ }
+
for (std::vector<std::string>::const_iterator i = implicitDirs.begin();
i != implicitDirs.end(); ++i) {
if (std::find(includes.begin(), includes.end(), *i) != includes.end()) {
@@ -1577,7 +1591,11 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
const char* opt =
target->Target->GetMakefile()->GetRequiredDefinition(option_flag);
- this->AppendFlagEscape(flags, opt);
+ std::vector<std::string> optVec;
+ cmSystemTools::ExpandListArgument(opt, optVec);
+ for (size_t i = 0; i < optVec.size(); ++i) {
+ this->AppendFlagEscape(flags, optVec[i]);
+ }
return;
}
@@ -1587,7 +1605,11 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
if (const char* opt =
target->Target->GetMakefile()->GetDefinition(option_flag)) {
- this->AppendFlagEscape(flags, opt);
+ std::vector<std::string> optVec;
+ cmSystemTools::ExpandListArgument(opt, optVec);
+ for (size_t i = 0; i < optVec.size(); ++i) {
+ this->AppendFlagEscape(flags, optVec[i]);
+ }
return;
}
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 802a427..608b18a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4190,6 +4190,23 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
std::string* error) const
{
+ if (!this->GlobalGenerator->GetLanguageEnabled(lang)) {
+ std::ostringstream e;
+ if (error) {
+ e << "cannot";
+ } else {
+ e << "Cannot";
+ }
+ e << " use features from non-enabled language " << lang;
+ if (error) {
+ *error = e.str();
+ } else {
+ this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->Backtrace);
+ }
+ return CM_NULLPTR;
+ }
+
const char* featuresKnown =
this->GetDefinition("CMAKE_" + lang + "_COMPILE_FEATURES");
@@ -4201,9 +4218,9 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
e << "No";
}
e << " known features for " << lang << " compiler\n\""
- << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID")
+ << this->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID")
<< "\"\nversion "
- << this->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << ".";
+ << this->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << ".";
if (error) {
*error = e.str();
} else {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 2f4cccb..d38dbcb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1064,13 +1064,28 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
compileObjectVars.Includes = includes.c_str();
// Rule for compiling object file.
- std::string compileCmdVar = "CMAKE_";
- compileCmdVar += language;
- compileCmdVar += "_COMPILE_OBJECT";
- std::string compileCmd =
- this->GetMakefile()->GetRequiredDefinition(compileCmdVar);
std::vector<std::string> compileCmds;
- cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ if (language == "CUDA") {
+ std::string cmdVar;
+ if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_SEPARABLE_COMPILATION")) {
+ cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION");
+ } else if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_PTX_COMPILATION")) {
+ cmdVar = std::string("CMAKE_CUDA_COMPILE_PTX_COMPILATION");
+ } else {
+ cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
+ }
+ std::string compileCmd =
+ this->GetMakefile()->GetRequiredDefinition(cmdVar);
+ cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ } else {
+ const std::string cmdVar =
+ std::string("CMAKE_") + language + "_COMPILE_OBJECT";
+ std::string compileCmd =
+ this->GetMakefile()->GetRequiredDefinition(cmdVar);
+ cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ }
CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
this->GetLocalGenerator()->CreateRulePlaceholderExpander());
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 6924ba2..cecf165 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -303,6 +303,13 @@ static void AcquireScanFiles(cmGeneratorTarget const* target,
!(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
continue;
}
+ if (PropertyEnabled(sf, "GENERATED") &&
+ !target->GetPropertyAsBool("__UNDOCUMENTED_AUTOGEN_GENERATED_FILES")) {
+ // FIXME: Add a policy whose NEW behavior allows generated files.
+ // The implementation already works. We disable it here to avoid
+ // changing behavior for existing projects that do not expect it.
+ continue;
+ }
const std::string absFile =
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
// Skip flags
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 27e4928..042d111 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -971,17 +971,19 @@ bool cmQtAutoGenerators::MocParseSourceContent(
const std::string headerToMoc =
this->MocFindHeader(scannedFileAbsPath, incSubDir + incRealBasename);
if (!headerToMoc.empty()) {
- // Register moc job
- mocsIncluded[headerToMoc] = incString;
- this->MocFindDepends(headerToMoc, contentText, mocDepends);
- // Store meta information for relaxed mode
- if (relaxed && (incRealBasename == scannedFileBasename)) {
- ownMocUnderscoreInclude = incString;
- ownMocUnderscoreHeader = headerToMoc;
+ if (!this->MocSkip(headerToMoc)) {
+ // Register moc job
+ mocsIncluded[headerToMoc] = incString;
+ this->MocFindDepends(headerToMoc, contentText, mocDepends);
+ // Store meta information for relaxed mode
+ if (relaxed && (incRealBasename == scannedFileBasename)) {
+ ownMocUnderscoreInclude = incString;
+ ownMocUnderscoreHeader = headerToMoc;
+ }
}
} else {
std::ostringstream ost;
- ost << "AutoMoc: Error: " << absFilename << "\n"
+ ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
<< ", but could not find header "
<< Quoted(incRealBasename + "{" +
@@ -1004,35 +1006,38 @@ bool cmQtAutoGenerators::MocParseSourceContent(
const std::string headerToMoc =
this->MocFindHeader(scannedFileAbsPath, incSubDir + incBasename);
if (!headerToMoc.empty()) {
- // This is for KDE4 compatibility:
- fileToMoc = headerToMoc;
- if (!requiresMoc && (incBasename == scannedFileBasename)) {
- std::ostringstream ost;
- ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
+ if (!this->MocSkip(headerToMoc)) {
+ // This is for KDE4 compatibility:
+ fileToMoc = headerToMoc;
+ if (!requiresMoc && (incBasename == scannedFileBasename)) {
+ std::ostringstream ost;
+ ost
+ << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
<< ", but does not contain a Q_OBJECT or Q_GADGET macro.\n"
<< "Running moc on " << Quoted(headerToMoc) << "!\n"
<< "Include " << Quoted("moc_" + incBasename + ".cpp")
<< " for a compatibility with strict mode (see "
"CMAKE_AUTOMOC_RELAXED_MODE).\n";
- this->LogWarning(ost.str());
- } else {
- std::ostringstream ost;
- ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
- << "The file includes the moc file " << Quoted(incString)
- << " instead of " << Quoted("moc_" + incBasename + ".cpp")
- << ".\n"
- << "Running moc on " << Quoted(headerToMoc) << "!\n"
- << "Include " << Quoted("moc_" + incBasename + ".cpp")
- << " for compatibility with strict mode (see "
- "CMAKE_AUTOMOC_RELAXED_MODE).\n";
- this->LogWarning(ost.str());
+ this->LogWarning(ost.str());
+ } else {
+ std::ostringstream ost;
+ ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
+ << "The file includes the moc file " << Quoted(incString)
+ << " instead of "
+ << Quoted("moc_" + incBasename + ".cpp") << ".\n"
+ << "Running moc on " << Quoted(headerToMoc) << "!\n"
+ << "Include " << Quoted("moc_" + incBasename + ".cpp")
+ << " for compatibility with strict mode (see "
+ "CMAKE_AUTOMOC_RELAXED_MODE).\n";
+ this->LogWarning(ost.str());
+ }
}
} else {
std::ostringstream ost;
ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
- << ". which seems to be the moc file from a different "
+ << ", which seems to be the moc file from a different "
"source file. CMake also could not find a matching "
"header.";
this->LogError(ost.str());
@@ -1048,7 +1053,7 @@ bool cmQtAutoGenerators::MocParseSourceContent(
// Accept but issue a warning if moc isn't required
if (!requiresMoc) {
std::ostringstream ost;
- ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n"
+ ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
<< ", but does not contain a Q_OBJECT or Q_GADGET "
"macro.";
@@ -1160,7 +1165,6 @@ void cmQtAutoGenerators::SearchHeadersForSourceFile(
if (!this->UicSkip(absFilename) && !this->UicSkip(headerName)) {
uicHeaderFiles.insert(headerName);
}
- break;
}
}
}
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index defba77..c5b7f60 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -284,7 +284,9 @@ static bool testValue(cmState* state, const std::string& key,
std::string& value, const std::string& keyDescription,
std::string* errorMessage)
{
- const std::string cachedValue = std::string(state->GetCacheEntryValue(key));
+ const char* entry = state->GetCacheEntryValue(key);
+ const std::string cachedValue =
+ entry == nullptr ? std::string() : std::string(entry);
if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
setErrorMessage(errorMessage, std::string("\"") + key +
"\" is set but incompatible with configured " +
diff --git a/Source/cmVS10RCFlagTable.h b/Source/cmVS10RCFlagTable.h
index 32f35e5..6e2b834 100644
--- a/Source/cmVS10RCFlagTable.h
+++ b/Source/cmVS10RCFlagTable.h
@@ -1,6 +1,7 @@
static cmVS7FlagTable cmVS10RCFlagTable[] = {
// Bool Properties
{ "NullTerminateStrings", "n", "", "true", 0 },
+ { "SuppressStartupBanner", "nologo", "", "true", 0 },
{ 0, 0, 0, 0, 0 }
};
diff --git a/Source/cmVS11RCFlagTable.h b/Source/cmVS11RCFlagTable.h
index 666e434..4997fe1 100644
--- a/Source/cmVS11RCFlagTable.h
+++ b/Source/cmVS11RCFlagTable.h
@@ -1,6 +1,7 @@
static cmVS7FlagTable cmVS11RCFlagTable[] = {
// Bool Properties
{ "NullTerminateStrings", "n", "", "true", 0 },
+ { "SuppressStartupBanner", "nologo", "", "true", 0 },
{ 0, 0, 0, 0, 0 }
};
diff --git a/Source/cmVS12RCFlagTable.h b/Source/cmVS12RCFlagTable.h
index d047f824..a650f85 100644
--- a/Source/cmVS12RCFlagTable.h
+++ b/Source/cmVS12RCFlagTable.h
@@ -1,6 +1,7 @@
static cmVS7FlagTable cmVS12RCFlagTable[] = {
// Bool Properties
{ "NullTerminateStrings", "n", "", "true", 0 },
+ { "SuppressStartupBanner", "nologo", "", "true", 0 },
{ 0, 0, 0, 0, 0 }
};
diff --git a/Source/cmVS14LinkFlagTable.h b/Source/cmVS140LinkFlagTable.h
index 596f880..b9a4dc3 100644
--- a/Source/cmVS14LinkFlagTable.h
+++ b/Source/cmVS140LinkFlagTable.h
@@ -1,4 +1,4 @@
-static cmVS7FlagTable cmVS14LinkFlagTable[] = {
+static cmVS7FlagTable cmVS140LinkFlagTable[] = {
// Enum Properties
{ "ShowProgress", "", "Not Set", "NotSet", 0 },
@@ -38,7 +38,12 @@ static cmVS7FlagTable cmVS14LinkFlagTable[] = {
{ "GenerateDebugInformation", "DEBUG:FASTLINK",
"Optimize for faster linking", "DebugFastLink",
cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG", "Optimize for debugging", "Debug",
+ { "GenerateDebugInformation", "DEBUG:FULL", "Optimize for debugging", "true",
+ cmVS7FlagTable::CaseInsensitive },
+ { "GenerateDebugInformation", "DEBUG:NONE",
+ "Produces no debugging information", "false",
+ cmVS7FlagTable::CaseInsensitive },
+ { "GenerateDebugInformation", "DEBUG", "Optimize for debugging", "true",
cmVS7FlagTable::CaseInsensitive },
{ "SubSystem", "", "Not Set", "NotSet", 0 },
@@ -129,9 +134,6 @@ static cmVS7FlagTable cmVS14LinkFlagTable[] = {
{ "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
"SystemDlls", 0 },
- { "LinkControlFlowGuard", "guard:cf", "Enable Security Check with Guard",
- "Guard", 0 },
-
// Bool Properties
{ "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
{ "LinkIncremental", "INCREMENTAL", "", "true", 0 },
diff --git a/Source/cmVS141LinkFlagTable.h b/Source/cmVS141LinkFlagTable.h
new file mode 100644
index 0000000..8f0f1f4
--- /dev/null
+++ b/Source/cmVS141LinkFlagTable.h
@@ -0,0 +1,283 @@
+static cmVS7FlagTable cmVS141LinkFlagTable[] = {
+
+ // Enum Properties
+ { "ShowProgress", "", "Not Set", "NotSet", 0 },
+ { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose",
+ 0 },
+ { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib",
+ 0 },
+ { "ShowProgress", "VERBOSE:ICF",
+ "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 },
+ { "ShowProgress", "VERBOSE:REF",
+ "About data removed during optimized linking", "LinkVerboseREF", 0 },
+ { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH",
+ "LinkVerboseSAFESEH", 0 },
+ { "ShowProgress", "VERBOSE:CLR",
+ "About linker activity related to managed code", "LinkVerboseCLR", 0 },
+
+ { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 },
+ { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only",
+ "MultiplyDefinedSymbolOnly", 0 },
+ { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only",
+ "UndefinedSymbolOnly", 0 },
+
+ { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 },
+ { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only",
+ "X86Image", 0 },
+ { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only",
+ "X64Image", 0 },
+ { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only",
+ "ItaniumImage", 0 },
+
+ { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 },
+ { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable",
+ "HighestAvailable", 0 },
+ { "UACExecutionLevel", "level='requireAdministrator'",
+ "requireAdministrator", "RequireAdministrator", 0 },
+
+ { "GenerateDebugInformation", "DEBUG:FASTLINK",
+ "Generate Debug Information optimized for faster links", "DebugFastLink",
+ cmVS7FlagTable::CaseInsensitive },
+ { "GenerateDebugInformation", "DEBUG:FULL",
+ "Generate Debug Information optimized for sharing and publishing",
+ "DebugFull", cmVS7FlagTable::CaseInsensitive },
+ { "GenerateDebugInformation", "DEBUG:NONE",
+ "Produces no debugging information", "false",
+ cmVS7FlagTable::CaseInsensitive },
+ { "GenerateDebugInformation", "DEBUG", "Generate Debug Information", "true",
+ cmVS7FlagTable::CaseInsensitive },
+
+ { "SubSystem", "", "Not Set", "NotSet", 0 },
+ { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
+ { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
+ { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
+ { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
+ "EFI Application", 0 },
+ { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
+ { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
+ { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
+ 0 },
+ { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
+
+ { "Driver", "", "Not Set", "NotSet", 0 },
+ { "Driver", "Driver", "Driver", "Driver", 0 },
+ { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 },
+ { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 },
+
+ { "LinkTimeCodeGeneration", "", "Default", "Default", 0 },
+ { "LinkTimeCodeGeneration", "LTCG:incremental",
+ "Use Fast Link Time Code Generation", "UseFastLinkTimeCodeGeneration", 0 },
+ { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation",
+ "UseLinkTimeCodeGeneration", 0 },
+ { "LinkTimeCodeGeneration", "LTCG:PGInstrument",
+ "Profile Guided Optimization - Instrument", "PGInstrument", 0 },
+ { "LinkTimeCodeGeneration", "LTCG:PGOptimize",
+ "Profile Guided Optimization - Optimization", "PGOptimization", 0 },
+ { "LinkTimeCodeGeneration", "LTCG:PGUpdate",
+ "Profile Guided Optimization - Update", "PGUpdate", 0 },
+
+ { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 },
+ { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 },
+
+ { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
+ { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
+ { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
+ { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
+
+ { "TargetMachine", "", "Not Set", "NotSet", 0 },
+ { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
+ { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
+ { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
+ { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
+ { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
+ { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
+ 0 },
+ { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
+ "MachineMIPSFPU16", 0 },
+ { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
+ { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
+ { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
+ { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
+
+ { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute",
+ "MTAThreadingAttribute", 0 },
+ { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute",
+ "STAThreadingAttribute", 0 },
+ { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
+ "Default threading attribute", "DefaultThreadingAttribute", 0 },
+
+ { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage",
+ 0 },
+ { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image",
+ "ForcePureILImage", 0 },
+ { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image",
+ "ForceSafeILImage", 0 },
+ { "CLRImageType", "", "Default image type", "Default", 0 },
+
+ { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
+ { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
+ { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
+ { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
+
+ { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
+ "PromptImmediately", 0 },
+ { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
+ "QueueForNextLogin", 0 },
+ { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
+ "SendErrorReport", 0 },
+ { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report",
+ "NoErrorReport", 0 },
+
+ { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 },
+ { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled",
+ 0 },
+ { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
+ "SystemDlls", 0 },
+
+ // Bool Properties
+ { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
+ { "LinkIncremental", "INCREMENTAL", "", "true", 0 },
+ { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
+ { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 },
+ { "LinkStatus", "LTCG:STATUS", "", "true", 0 },
+ { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 },
+ { "PreventDllBinding", "ALLOWBIND", "", "true", 0 },
+ { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 },
+ { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 },
+ { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
+ { "GenerateManifest", "MANIFEST:NO", "", "false", 0 },
+ { "GenerateManifest", "MANIFEST", "", "true", 0 },
+ { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 },
+ { "UACUIAccess", "uiAccess='false'", "", "false", 0 },
+ { "UACUIAccess", "uiAccess='true'", "", "true", 0 },
+ { "ManifestEmbed", "manifest:embed", "", "true", 0 },
+ { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 },
+ { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 },
+ { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 },
+ { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 },
+ { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 },
+ { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 },
+ { "TerminalServerAware", "TSAWARE", "", "true", 0 },
+ { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 },
+ { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 },
+ { "OptimizeReferences", "OPT:NOREF", "", "false", 0 },
+ { "OptimizeReferences", "OPT:REF", "", "true", 0 },
+ { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 },
+ { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 },
+ { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 },
+ { "AppContainer", "APPCONTAINER", "", "true", 0 },
+ { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 },
+ { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 },
+ { "NoEntryPoint", "NOENTRY", "", "true", 0 },
+ { "SetChecksum", "RELEASE", "", "true", 0 },
+ { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 },
+ { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 },
+ { "FixedBaseAddress", "FIXED:NO", "", "false", 0 },
+ { "FixedBaseAddress", "FIXED", "", "true", 0 },
+ { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 },
+ { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 },
+ { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 },
+ { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 },
+ { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 },
+ { "Profile", "PROFILE", "", "true", 0 },
+ { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 },
+ { "LinkDelaySign", "DELAYSIGN", "", "true", 0 },
+ { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 },
+ { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 },
+ { "DetectOneDefinitionRule", "ODR", "", "true", 0 },
+ { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 },
+ { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 },
+ { "LinkDLL", "DLL", "", "true", 0 },
+
+ // Bool Properties With Argument
+ { "EnableUAC", "MANIFESTUAC:NO", "", "false", 0 },
+ { "EnableUAC", "MANIFESTUAC:", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "UACUIAccess", "MANIFESTUAC:", "Enable User Account Control (UAC)", "",
+ cmVS7FlagTable::UserValueRequired },
+ { "GenerateMapFile", "MAP", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "MapFileName", "MAP:", "Generate Map File", "",
+ cmVS7FlagTable::UserValueRequired },
+
+ // String List Properties
+ { "AdditionalLibraryDirectories", "LIBPATH:",
+ "Additional Library Directories", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "Natvis", "NATVIS:", "Natvis files", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ // Skip [AdditionalDependencies] - no command line Switch.
+ { "IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:",
+ "Ignore Specific Default Libraries", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "EmbedManagedResourceFile", "ASSEMBLYRESOURCE:",
+ "Embed Managed Resource File", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "AdditionalManifestDependencies", "MANIFESTDEPENDENCY:",
+ "Additional Manifest Dependencies", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "ManifestInput", "manifestinput:", "Manifest Input", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+
+ // String Properties
+ { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
+ { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue },
+ { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "",
+ cmVS7FlagTable::UserValue },
+ { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "",
+ cmVS7FlagTable::UserValue },
+ // Skip [TrackerLogDirectory] - no command line Switch.
+ { "ModuleDefinitionFile", "DEF:", "Module Definition File", "",
+ cmVS7FlagTable::UserValue },
+ { "ManifestFile", "ManifestFile:", "Manifest File", "",
+ cmVS7FlagTable::UserValue },
+ { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "",
+ cmVS7FlagTable::UserValue },
+ { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "",
+ cmVS7FlagTable::UserValue },
+ // Skip [MapFileName] - no command line Switch.
+ // Skip [MinimumRequiredVersion] - no command line Switch.
+ { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "",
+ cmVS7FlagTable::UserValue },
+ // Skip [HeapCommitSize] - no command line Switch.
+ { "StackReserveSize", "STACK:", "Stack Reserve Size", "",
+ cmVS7FlagTable::UserValue },
+ // Skip [StackCommitSize] - no command line Switch.
+ { "FunctionOrder", "ORDER:@", "Function Order", "",
+ cmVS7FlagTable::UserValue },
+ { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "",
+ cmVS7FlagTable::UserValue },
+ { "MidlCommandFile", "MIDL:@", "MIDL Commands", "",
+ cmVS7FlagTable::UserValue },
+ { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "",
+ cmVS7FlagTable::UserValue },
+ { "TypeLibraryFile", "TLBOUT:", "Type Library", "",
+ cmVS7FlagTable::UserValue },
+ { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "",
+ cmVS7FlagTable::UserValue },
+ { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File",
+ "", cmVS7FlagTable::UserValue },
+ { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:",
+ "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue },
+ { "EntryPointSymbol", "ENTRY:", "Entry Point", "",
+ cmVS7FlagTable::UserValue },
+ { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue },
+ { "ImportLibrary", "IMPLIB:", "Import Library", "",
+ cmVS7FlagTable::UserValue },
+ { "MergeSections", "MERGE:", "Merge Sections", "",
+ cmVS7FlagTable::UserValue },
+ { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue },
+ { "KeyContainer", "KEYCONTAINER:", "Key Container", "",
+ cmVS7FlagTable::UserValue },
+ // Skip [AdditionalOptions] - no command line Switch.
+ { 0, 0, 0, 0, 0 }
+};
diff --git a/Source/cmVS14RCFlagTable.h b/Source/cmVS14RCFlagTable.h
index 11e00d5..5dc8d5a 100644
--- a/Source/cmVS14RCFlagTable.h
+++ b/Source/cmVS14RCFlagTable.h
@@ -1,6 +1,7 @@
static cmVS7FlagTable cmVS14RCFlagTable[] = {
// Bool Properties
{ "NullTerminateStrings", "n", "", "true", 0 },
+ { "SuppressStartupBanner", "nologo", "", "true", 0 },
{ 0, 0, 0, 0, 0 }
};
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index c2ff664..7168f26 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -1,6 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmVSSetupHelper.h"
+#include "cmSystemTools.h"
#ifndef VSSetupConstants
#define VSSetupConstants
@@ -240,6 +241,22 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
setupHelper == NULL)
return false;
+ std::string envVSCommonToolsDir;
+
+ // FIXME: When we support VS versions beyond 2017, the version
+ // to choose will be passed in by the caller. We need to map that
+ // to a per-version name of this environment variable.
+ if (cmSystemTools::GetEnv("VS150COMNTOOLS", envVSCommonToolsDir)) {
+ cmSystemTools::ConvertToUnixSlashes(envVSCommonToolsDir);
+ }
+ // FIXME: If the environment variable value changes between runs
+ // of CMake within a given build tree the results are not defined.
+ // Instead we should save a CMAKE_GENERATOR_INSTANCE value in the cache
+ // (similar to CMAKE_GENERATOR_TOOLSET) to hold it persistently.
+ // Unfortunately doing so will require refactoring elsewhere in
+ // order to make sure the value is available in time to create
+ // the generator.
+
std::vector<VSInstanceInfo> vecVSInstances;
SmartCOMPtr<IEnumSetupInstances> enumInstances = NULL;
if (FAILED(
@@ -263,6 +280,17 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
instance = instance2 = NULL;
if (isInstalled) {
+ if (!envVSCommonToolsDir.empty()) {
+ std::string currentVSLocation(instanceInfo.VSInstallLocation.begin(),
+ instanceInfo.VSInstallLocation.end());
+ cmSystemTools::ConvertToUnixSlashes(currentVSLocation);
+ currentVSLocation += "/Common7/Tools";
+ if (cmSystemTools::ComparePath(currentVSLocation,
+ envVSCommonToolsDir)) {
+ chosenInstanceInfo = instanceInfo;
+ return true;
+ }
+ }
vecVSInstances.push_back(instanceInfo);
}
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 238c9e8..88fa19c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmVisualStudio10TargetGenerator.h"
+#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratedFileStream.h"
@@ -16,8 +17,6 @@
#include "cm_auto_ptr.hxx"
-static std::string const kWINDOWS_7_1_SDK = "Windows7.1SDK";
-
static std::string cmVS10EscapeXML(std::string arg)
{
cmSystemTools::ReplaceString(arg, "&", "&amp;");
@@ -2227,10 +2226,27 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
this->Name.c_str());
return false;
}
- if (linkLanguage == "C" || linkLanguage == "CXX" ||
- linkLanguage == "Fortran" || linkLanguage == "CSharp") {
+
+ // Choose a language whose flags to use for ClCompile.
+ static const char* clLangs[] = { "CXX", "C", "Fortran", "CSharp" };
+ std::string langForClCompile;
+ if (std::find(cmArrayBegin(clLangs), cmArrayEnd(clLangs), linkLanguage) !=
+ cmArrayEnd(clLangs)) {
+ langForClCompile = linkLanguage;
+ } else {
+ std::set<std::string> languages;
+ this->GeneratorTarget->GetLanguages(languages, configName);
+ for (const char* const* l = cmArrayBegin(clLangs);
+ l != cmArrayEnd(clLangs); ++l) {
+ if (languages.find(*l) != languages.end()) {
+ langForClCompile = *l;
+ break;
+ }
+ }
+ }
+ if (!langForClCompile.empty()) {
std::string baseFlagVar = "CMAKE_";
- baseFlagVar += linkLanguage;
+ baseFlagVar += langForClCompile;
baseFlagVar += "_FLAGS";
flags =
this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
@@ -2241,6 +2257,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
flags +=
this->GeneratorTarget->Target->GetMakefile()->GetRequiredDefinition(
flagVar.c_str());
+ this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
+ langForClCompile, configName);
}
// set the correct language
if (linkLanguage == "C") {
@@ -2249,10 +2267,6 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
if (linkLanguage == "CXX") {
clOptions.AddFlag("CompileAs", "CompileAsCpp");
}
- if (linkLanguage != "CUDA") {
- this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget,
- linkLanguage, configName.c_str());
- }
// Check IPO related warning/error.
this->GeneratorTarget->IsIPOEnabled(linkLanguage, configName);
@@ -2480,6 +2494,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
std::string(this->Makefile->GetSafeDefinition("CMAKE_CUDA_FLAGS")) +
std::string(" ") +
std::string(this->Makefile->GetSafeDefinition(configFlagsVar));
+ this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, "CUDA",
+ configName);
// Get preprocessor definitions for this directory.
std::string defineFlags =
@@ -2505,9 +2521,16 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
cudaOptions.AddTable(gg->GetCudaHostFlagTable());
cudaOptions.Reparse("AdditionalCompilerOptions");
- // `CUDA 8.0.targets` places these before nvcc! Just drop whatever
- // did not parse and hope it works.
- cudaOptions.RemoveFlag("AdditionalCompilerOptions");
+ // `CUDA 8.0.targets` places AdditionalCompilerOptions before nvcc!
+ // Pass them through -Xcompiler in AdditionalOptions instead.
+ if (const char* acoPtr = cudaOptions.GetFlag("AdditionalCompilerOptions")) {
+ std::string aco = acoPtr;
+ cudaOptions.RemoveFlag("AdditionalCompilerOptions");
+ if (!aco.empty()) {
+ aco = this->LocalGenerator->EscapeForShell(aco, false);
+ cudaOptions.AppendFlagString("AdditionalOptions", "-Xcompiler=" + aco);
+ }
+ }
cudaOptions.FixCudaCodeGeneration();
@@ -2594,8 +2617,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions(
// Suppress deprecation warnings for default GPU targets during device link.
if (cmSystemTools::VersionCompareGreaterEq(
this->GlobalGenerator->GetPlatformToolsetCudaString(), "8.0")) {
- cudaLinkOptions.AppendFlag("AdditionalOptions",
- "-Wno-deprecated-gpu-targets");
+ cudaLinkOptions.AppendFlagString("AdditionalOptions",
+ "-Wno-deprecated-gpu-targets");
}
this->CudaLinkOptions[configName] = pOptions.release();
@@ -3105,12 +3128,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
linkOptions.AddFlag("StackReserveSize", stackVal);
}
- if (this->LocalGenerator->GetVersion() >=
- cmGlobalVisualStudioGenerator::VS14) {
- linkOptions.AddFlag("GenerateDebugInformation", "No");
- } else {
- linkOptions.AddFlag("GenerateDebugInformation", "false");
- }
+ linkOptions.AddFlag("GenerateDebugInformation", "false");
std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
pdb += "/";
@@ -3157,26 +3175,14 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
"%(IgnoreSpecificDefaultLibraries)");
}
- // Hack to fix flag version selection in a common use case.
- // FIXME: Select flag table based on toolset instead of VS version.
- if (this->LocalGenerator->GetVersion() >=
- cmGlobalVisualStudioGenerator::VS14) {
- const char* toolset = gg->GetPlatformToolset();
- if (toolset &&
- (toolset == kWINDOWS_7_1_SDK || /* clang-format please break here */
- cmHasLiteralPrefix(toolset, "v80") ||
- cmHasLiteralPrefix(toolset, "v90") ||
- cmHasLiteralPrefix(toolset, "v100") ||
- cmHasLiteralPrefix(toolset, "v110") ||
- cmHasLiteralPrefix(toolset, "v120"))) {
- if (const char* debug =
- linkOptions.GetFlag("GenerateDebugInformation")) {
- // Convert value from enumeration back to boolean for older toolsets.
- if (strcmp(debug, "No") == 0) {
- linkOptions.AddFlag("GenerateDebugInformation", "false");
- } else if (strcmp(debug, "Debug") == 0) {
- linkOptions.AddFlag("GenerateDebugInformation", "true");
- }
+ // VS 2015 without all updates has a v140 toolset whose
+ // GenerateDebugInformation expects No/Debug instead of false/true.
+ if (gg->GetPlatformToolsetNeedsDebugEnum()) {
+ if (const char* debug = linkOptions.GetFlag("GenerateDebugInformation")) {
+ if (strcmp(debug, "false") == 0) {
+ linkOptions.AddFlag("GenerateDebugInformation", "No");
+ } else if (strcmp(debug, "true") == 0) {
+ linkOptions.AddFlag("GenerateDebugInformation", "Debug");
}
}
}
@@ -3475,10 +3481,6 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
->TargetIsFortranOnly(dt)) {
continue;
}
- if (csproj == this->ProjectType &&
- !this->GlobalGenerator->TargetIsCSharpOnly(dt)) {
- continue;
- }
this->WriteString("<ProjectReference Include=\"", 2);
cmLocalGenerator* lg = dt->GetLocalGenerator();
std::string name = dt->GetName();
diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx
index afca216..9a1d950 100644
--- a/Source/cmVisualStudio10ToolsetOptions.cxx
+++ b/Source/cmVisualStudio10ToolsetOptions.cxx
@@ -26,10 +26,11 @@
#include "cmVS12RCFlagTable.h"
#include "cmVS140CLFlagTable.h"
#include "cmVS140CSharpFlagTable.h"
+#include "cmVS140LinkFlagTable.h"
#include "cmVS141CLFlagTable.h"
#include "cmVS141CSharpFlagTable.h"
+#include "cmVS141LinkFlagTable.h"
#include "cmVS14LibFlagTable.h"
-#include "cmVS14LinkFlagTable.h"
#include "cmVS14MASMFlagTable.h"
#include "cmVS14RCFlagTable.h"
@@ -114,8 +115,10 @@ cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLinkFlagTable(
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
- return cmVS14LinkFlagTable;
+ if (useToolset == "v141") {
+ return cmVS141LinkFlagTable;
+ } else if (useToolset == "v140") {
+ return cmVS140LinkFlagTable;
} else if (useToolset == "v120") {
return cmVS12LinkFlagTable;
} else if (useToolset == "v110") {
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index 0d3f44f..bf61be4 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -32,8 +32,8 @@ static functionMapEntry cmakeGeneratedFunctionMapEntries[] = {
{ NULL, NULL } /* NOLINT */
};
-static const int NumTests =
- (sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
+static const int NumTests = CM_CAST(int,
+ sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
/* Allocate and create a lowercased copy of string
(note that it has to be free'd manually) */
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d138f58..d16df1c 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -331,6 +331,7 @@ if(BUILD_TESTING)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
ADD_TEST_MACRO(CSharpOnly CSharpOnly)
+ ADD_TEST_MACRO(CSharpLinkToCxx CSharpLinkToCxx)
endif()
ADD_TEST_MACRO(COnly COnly)
diff --git a/Tests/CSharpLinkToCxx/CMakeLists.txt b/Tests/CSharpLinkToCxx/CMakeLists.txt
new file mode 100644
index 0000000..c4269e0
--- /dev/null
+++ b/Tests/CSharpLinkToCxx/CMakeLists.txt
@@ -0,0 +1,17 @@
+# test if CSharp application correctly links
+# to managed C++ binary
+cmake_minimum_required(VERSION 3.9)
+project (CSharpLinkToCxx CXX CSharp)
+
+# we have to change the default flags for the
+# managed C++ project to build
+string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+
+add_library(CLIApp SHARED cli.hpp cli.cpp)
+
+target_compile_options(CLIApp PRIVATE "/clr")
+
+add_executable(CSharpLinkToCxx csharp.cs)
+
+target_link_libraries(CSharpLinkToCxx CLIApp)
diff --git a/Tests/CSharpLinkToCxx/cli.cpp b/Tests/CSharpLinkToCxx/cli.cpp
new file mode 100644
index 0000000..97ac724
--- /dev/null
+++ b/Tests/CSharpLinkToCxx/cli.cpp
@@ -0,0 +1,10 @@
+#include "cli.hpp"
+
+using namespace System;
+
+namespace CLIApp {
+void MyCli::testMyCli()
+{
+ Console::WriteLine("#message from CLIApp");
+}
+}
diff --git a/Tests/CSharpLinkToCxx/cli.hpp b/Tests/CSharpLinkToCxx/cli.hpp
new file mode 100644
index 0000000..a8c116d
--- /dev/null
+++ b/Tests/CSharpLinkToCxx/cli.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+namespace CLIApp {
+public
+ref class MyCli
+{
+public:
+ void testMyCli();
+};
+}
diff --git a/Tests/CSharpLinkToCxx/csharp.cs b/Tests/CSharpLinkToCxx/csharp.cs
new file mode 100644
index 0000000..35c5cc3
--- /dev/null
+++ b/Tests/CSharpLinkToCxx/csharp.cs
@@ -0,0 +1,16 @@
+using System;
+using CLIApp;
+
+namespace CSharpLinkToCxx
+{
+ internal class CSharpLinkToCxx
+ {
+ public static void Main(string[] args)
+ {
+ Console.WriteLine("#message from CSharpLinkToCxx");
+
+ var app = new MyCli();
+ app.testMyCli();
+ }
+ }
+}
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
index 0a2542a..3d4a170 100644
--- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
+++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
@@ -15,6 +15,15 @@ set(CMAKE_CUDA_STANDARD 11)
add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu)
+if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
+ # Test adding a flag that is not in our CUDA flag table for VS.
+ if(NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 8)
+ string(APPEND CMAKE_CUDA_FLAGS " --ftemplate-depth 50")
+ endif()
+ # Test adding a flag that nvcc should pass to the host compiler.
+ target_compile_options(CUDASeparateLibA PRIVATE -Xcompiler=-bigobj)
+endif()
+
#Having file4/file5 in a shared library causes serious problems
#with the nvcc linker and it will generate bad entries that will
#cause a segv when trying to run the executable
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 38f2a44..e25f141 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -28,6 +28,7 @@ add_executable(CudaOnlyWithDefs ${main})
target_compile_options(CudaOnlyWithDefs
PRIVATE
+ -Xcompiler=-DHOST_DEFINE
$<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>>
)
diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu
index 80ed3a5..d2eff3f 100644
--- a/Tests/CudaOnly/WithDefs/main.notcu
+++ b/Tests/CudaOnly/WithDefs/main.notcu
@@ -2,6 +2,10 @@
#include <cuda_runtime.h>
#include <iostream>
+#ifndef HOST_DEFINE
+#error "HOST_DEFINE not defined!"
+#endif
+
#ifndef PACKED_DEFINE
#error "PACKED_DEFINE not defined!"
#endif
diff --git a/Tests/QtAutogen/mocDepends/CMakeLists.txt b/Tests/QtAutogen/mocDepends/CMakeLists.txt
index 8bd72eb..a67dcfe 100644
--- a/Tests/QtAutogen/mocDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/mocDepends/CMakeLists.txt
@@ -28,6 +28,7 @@ add_executable(mocDepends1 test1.cpp
)
target_link_libraries(mocDepends1 ${QT_CORE_TARGET})
set_target_properties(mocDepends1 PROPERTIES AUTOMOC TRUE)
+set_property(TARGET mocDepends1 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
# -- Test 2 using generated library
# This tests the dependency of AUTOMOC of mocDepends2 to the
@@ -43,3 +44,4 @@ add_library(SimpleLib STATIC simpleLib.hpp simpleLib.cpp)
add_executable(mocDepends2 test2.cpp )
target_link_libraries(mocDepends2 SimpleLib ${QT_CORE_TARGET})
set_target_properties(mocDepends2 PROPERTIES AUTOMOC TRUE)
+set_property(TARGET mocDepends2 PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
diff --git a/Tests/QtAutogen/mocRerun/CMakeLists.txt b/Tests/QtAutogen/mocRerun/CMakeLists.txt
index 69ea8d7..14b077b 100644
--- a/Tests/QtAutogen/mocRerun/CMakeLists.txt
+++ b/Tests/QtAutogen/mocRerun/CMakeLists.txt
@@ -27,6 +27,7 @@ add_executable(mocRerun
${CMAKE_CURRENT_BINARY_DIR}/main.cpp
res1.qrc
)
+set_property(TARGET mocRerun PROPERTY __UNDOCUMENTED_AUTOGEN_GENERATED_FILES 1)
target_include_directories(mocRerun PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(mocRerun ${QT_CORE_TARGET})
# Write target name to text file
diff --git a/Tests/RunCMake/Android/android_sysinc.c b/Tests/RunCMake/Android/android_sysinc.c
new file mode 100644
index 0000000..18d73db
--- /dev/null
+++ b/Tests/RunCMake/Android/android_sysinc.c
@@ -0,0 +1,7 @@
+#include <dlfcn.h>
+
+#ifndef NOT_SYSTEM_DLFCN_HEADER
+#error "sysroot /usr/include appears too early"
+#endif
+
+#include "android.c"
diff --git a/Tests/RunCMake/Android/android_sysinc.cxx b/Tests/RunCMake/Android/android_sysinc.cxx
new file mode 100644
index 0000000..5c5694b
--- /dev/null
+++ b/Tests/RunCMake/Android/android_sysinc.cxx
@@ -0,0 +1,7 @@
+#include <dlfcn.h>
+
+#ifndef NOT_SYSTEM_DLFCN_HEADER
+#error "sysroot /usr/include appears too early"
+#endif
+
+#include "android.cxx"
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index bef2428..015f202 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -92,3 +92,19 @@ if(CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")
endif()
add_executable(android_c android.c)
add_executable(android_cxx android.cxx)
+
+# Test that an explicit /usr/include is ignored in favor of
+# appearing as a standard include directory at the end.
+set(sysinc_dirs)
+if(CMAKE_ANDROID_NDK)
+ if(NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS)
+ list(APPEND sysinc_dirs ${CMAKE_SYSROOT_COMPILE}/usr/include)
+ else()
+ list(APPEND sysinc_dirs ${CMAKE_SYSROOT}/usr/include)
+ endif()
+endif()
+list(APPEND sysinc_dirs ${CMAKE_CURRENT_SOURCE_DIR}/sysinc)
+add_executable(android_sysinc_c android_sysinc.c)
+target_include_directories(android_sysinc_c SYSTEM PRIVATE ${sysinc_dirs})
+add_executable(android_sysinc_cxx android_sysinc.cxx)
+target_include_directories(android_sysinc_cxx SYSTEM PRIVATE ${sysinc_dirs})
diff --git a/Tests/RunCMake/Android/sysinc/dlfcn.h b/Tests/RunCMake/Android/sysinc/dlfcn.h
new file mode 100644
index 0000000..273306c
--- /dev/null
+++ b/Tests/RunCMake/Android/sysinc/dlfcn.h
@@ -0,0 +1 @@
+#define NOT_SYSTEM_DLFCN_HEADER
diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c
index e70fbb5..4b1318b 100644
--- a/Tests/RunCMake/AutoExportDll/foo.c
+++ b/Tests/RunCMake/AutoExportDll/foo.c
@@ -13,5 +13,3 @@ int bar()
{
return 5;
}
-
-const char testconst[] = "testconst";
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index eb9c0ff..51060e8 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -13,14 +13,6 @@ int WINAPI foo();
int bar();
int objlib();
void justnop();
-
-// test const export
-#ifdef _WIN32
-// data symbols must be explicitly imported
-__declspec(dllimport) extern const char testconst[];
-#else
-extern const char testconst[];
-#endif
}
// test c++ functions
@@ -51,8 +43,6 @@ int main()
bar();
objlib();
printf("\n");
- printf("%s", testconst);
- printf("\n");
#ifdef HAS_JUSTNOP
justnop();
#endif
diff --git a/Tests/RunCMake/ObjectLibrary/OwnSources-result.txt b/Tests/RunCMake/ObjectLibrary/OwnSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/OwnSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
new file mode 100644
index 0000000..40d650e
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
+ The SOURCES of "A" use a generator expression that depends on the SOURCES
+ themselves.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ObjectLibrary/OwnSources.cmake b/Tests/RunCMake/ObjectLibrary/OwnSources.cmake
new file mode 100644
index 0000000..e7bdf8d
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/OwnSources.cmake
@@ -0,0 +1,2 @@
+add_library(A OBJECT a.c)
+target_sources(A PRIVATE $<TARGET_OBJECTS:A>)
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index fe708ce..b8eed73 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -19,6 +19,7 @@ run_cmake(LinkObjRHS1)
run_cmake(LinkObjRHS2)
run_cmake(MissingSource)
run_cmake(ObjWithObj)
+run_cmake(OwnSources)
run_cmake(PostBuild)
run_cmake(PreBuild)
run_cmake(PreLink)
diff --git a/Tests/RunCMake/VSSolution/MorePost-check.cmake b/Tests/RunCMake/VSSolution/MorePost-check.cmake
index 0f7e370..d239b28 100644
--- a/Tests/RunCMake/VSSolution/MorePost-check.cmake
+++ b/Tests/RunCMake/VSSolution/MorePost-check.cmake
@@ -1,5 +1,5 @@
parseGlobalSections(pre post MorePost)
testGlobalSection(post TestSec2 Key1=Value1 "Key2=Value with spaces")
testGlobalSection(post TestSec4 Key6=Value1 "Key7=Value with spaces" Key8=ValueWithoutSpaces)
-testGlobalSection(post ExtensibilityGlobals)
+testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/MorePre-check.cmake b/Tests/RunCMake/VSSolution/MorePre-check.cmake
index 45e7419..89b3c7e 100644
--- a/Tests/RunCMake/VSSolution/MorePre-check.cmake
+++ b/Tests/RunCMake/VSSolution/MorePre-check.cmake
@@ -1,5 +1,5 @@
parseGlobalSections(pre post MorePre)
testGlobalSection(pre TestSec1 Key1=Value1 "Key2=Value with spaces")
testGlobalSection(pre TestSec3 Key3=Value1 "Key4=Value with spaces" Key5=ValueWithoutSpaces)
-testGlobalSection(post ExtensibilityGlobals)
+testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/OnePost-check.cmake b/Tests/RunCMake/VSSolution/OnePost-check.cmake
index 6af5156..f7d3712 100644
--- a/Tests/RunCMake/VSSolution/OnePost-check.cmake
+++ b/Tests/RunCMake/VSSolution/OnePost-check.cmake
@@ -1,4 +1,4 @@
parseGlobalSections(pre post OnePost)
testGlobalSection(post TestSec2 Key1=Value1 "Key2=Value with spaces")
-testGlobalSection(post ExtensibilityGlobals)
+testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/OnePre-check.cmake b/Tests/RunCMake/VSSolution/OnePre-check.cmake
index 70b18b2..c5db139 100644
--- a/Tests/RunCMake/VSSolution/OnePre-check.cmake
+++ b/Tests/RunCMake/VSSolution/OnePre-check.cmake
@@ -1,4 +1,4 @@
parseGlobalSections(pre post OnePre)
testGlobalSection(pre TestSec1 Key1=Value1 "Key2=Value with spaces")
-testGlobalSection(post ExtensibilityGlobals)
+testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/Override1-check.cmake b/Tests/RunCMake/VSSolution/Override1-check.cmake
index a19e2e1..5905204 100644
--- a/Tests/RunCMake/VSSolution/Override1-check.cmake
+++ b/Tests/RunCMake/VSSolution/Override1-check.cmake
@@ -1,4 +1,4 @@
parseGlobalSections(pre post Override1)
testGlobalSection(post TestSec Key2=Value2 Key3=Value3)
-testGlobalSection(post ExtensibilityGlobals Key1=Value1)
+testGlobalSection(post ExtensibilityGlobals Key1=Value1 "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/Override2-check.cmake b/Tests/RunCMake/VSSolution/Override2-check.cmake
index d9656e1..c981ec0 100644
--- a/Tests/RunCMake/VSSolution/Override2-check.cmake
+++ b/Tests/RunCMake/VSSolution/Override2-check.cmake
@@ -1,4 +1,4 @@
parseGlobalSections(pre post Override2)
testGlobalSection(pre TestSec Key2=Value2 Key3=Value3)
-testGlobalSection(post ExtensibilityGlobals)
+testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns Key1=Value1)
diff --git a/Tests/RunCMake/VSSolution/Override3-check.cmake b/Tests/RunCMake/VSSolution/Override3-check.cmake
new file mode 100644
index 0000000..baee9ed
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/Override3-check.cmake
@@ -0,0 +1,3 @@
+parseGlobalSections(pre post Override3)
+testGlobalSection(post ExtensibilityGlobals Key1=Value1 "SolutionGuid={custom-guid}")
+testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/Override3.cmake b/Tests/RunCMake/VSSolution/Override3.cmake
new file mode 100644
index 0000000..a59ce19
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/Override3.cmake
@@ -0,0 +1,4 @@
+set_property(DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_ExtensibilityGlobals
+ Key1=Value1
+ SolutionGuid={custom-guid}
+ )
diff --git a/Tests/RunCMake/VSSolution/PrePost-check.cmake b/Tests/RunCMake/VSSolution/PrePost-check.cmake
index 322a689..957c964 100644
--- a/Tests/RunCMake/VSSolution/PrePost-check.cmake
+++ b/Tests/RunCMake/VSSolution/PrePost-check.cmake
@@ -2,5 +2,5 @@ parseGlobalSections(pre post PrePost)
testGlobalSection(post Postsec Key1=Value2)
testGlobalSection(pre Presec Key1=Value1 "Key2=Value with some spaces")
testGlobalSection(post Emptysec)
-testGlobalSection(post ExtensibilityGlobals)
+testGlobalSection(post ExtensibilityGlobals "SolutionGuid={00000000-0000-0000-0000-000000000000}")
testGlobalSection(post ExtensibilityAddIns)
diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
index 3a04db4..c25833d 100644
--- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
@@ -8,6 +8,7 @@ run_cmake(MorePost)
run_cmake(PrePost)
run_cmake(Override1)
run_cmake(Override2)
+run_cmake(Override3)
run_cmake(StartupProject)
run_cmake(StartupProjectMissing)
run_cmake(AddPackageToDefault)
diff --git a/Tests/RunCMake/VSSolution/solution_parsing.cmake b/Tests/RunCMake/VSSolution/solution_parsing.cmake
index 4e5bb59..4b27550 100644
--- a/Tests/RunCMake/VSSolution/solution_parsing.cmake
+++ b/Tests/RunCMake/VSSolution/solution_parsing.cmake
@@ -44,6 +44,9 @@ macro(parseGlobalSections arg_out_pre arg_out_post testName)
endif()
string(STRIP "${CMAKE_MATCH_1}" key)
string(STRIP "${CMAKE_MATCH_2}" value)
+ if(key STREQUAL "SolutionGuid" AND value MATCHES "^{[0-9A-F-]+}$")
+ set(value "{00000000-0000-0000-0000-000000000000}")
+ endif()
list(APPEND ${out_${sectionType}}_${sectionName} "${key}=${value}")
endif()
endforeach()
diff --git a/Tests/RunCMake/find_package/PackageRoot-stderr.txt b/Tests/RunCMake/find_package/PackageRoot-stderr.txt
index 07b27bd..d97c029 100644
--- a/Tests/RunCMake/find_package/PackageRoot-stderr.txt
+++ b/Tests/RunCMake/find_package/PackageRoot-stderr.txt
@@ -1,319 +1,43 @@
+----------
Foo_ROOT :
ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-
-Foo_ROOT :
-ENV{Foo_ROOT} :
-Bar_ROOT :
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND
-BAR_TEST_FILE_BAR :BAR_TEST_FILE_BAR-NOTFOUND
-BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND
-BAR_TEST_PATH_BAR :BAR_TEST_PATH_BAR-NOTFOUND
-BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_PROG_BAR :BAR_TEST_PROG_BAR-NOTFOUND
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-Bar_ROOT :
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/foo/env_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/foo/env_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/foo/env_root/bin/bar.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
-Foo_ROOT :
-ENV{Foo_ROOT} :
+find_package\(Foo\)
FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
+FOO_TEST_FILE_ZOT :FOO_TEST_FILE_ZOT-NOTFOUND
FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
+FOO_TEST_PATH_ZOT :FOO_TEST_PATH_ZOT-NOTFOUND
FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-Foo_ROOT :
-ENV{Foo_ROOT} :
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-
-Foo_ROOT :
-ENV{Foo_ROOT} :
-Bar_ROOT :
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
-BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
-BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-
-Foo_ROOT :
-ENV{Foo_ROOT} :
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
-FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
-FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
-FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-Bar_ROOT :
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
-
+----------
Foo_ROOT :.*/PackageRoot/foo/cmake_root
ENV{Foo_ROOT} :
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+find_package\(Foo\)
FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+----------
Foo_ROOT :
ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-Foo_ROOT :
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+find_package\(Foo\)
FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/env_root/include/zot/zot.h
FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/env_root/include/zot
FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+----------
Foo_ROOT :.*/PackageRoot/foo/cmake_root
ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-Foo_ROOT :.*/PackageRoot/foo/cmake_root
-ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root
-Bar_ROOT :.*/PackageRoot/bar/cmake_root
-ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+find_package\(Foo\)
FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
-BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
-BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
-BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
-BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
-BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
diff --git a/Tests/RunCMake/find_package/PackageRoot.cmake b/Tests/RunCMake/find_package/PackageRoot.cmake
index d9f41f8..39551c4 100644
--- a/Tests/RunCMake/find_package/PackageRoot.cmake
+++ b/Tests/RunCMake/find_package/PackageRoot.cmake
@@ -5,69 +5,33 @@ set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
macro(CleanUpPackageRootTest)
unset(Foo_ROOT)
unset(ENV{Foo_ROOT})
- unset(Bar_ROOT)
- unset(ENV{Bar_ROOT})
unset(FOO_TEST_FILE_FOO)
+ unset(FOO_TEST_FILE_ZOT)
unset(FOO_TEST_PATH_FOO)
+ unset(FOO_TEST_PATH_ZOT)
unset(FOO_TEST_PROG_FOO)
- unset(BAR_TEST_FILE_FOO)
- unset(BAR_TEST_FILE_BAR)
- unset(BAR_TEST_PATH_FOO)
- unset(BAR_TEST_PATH_BAR)
- unset(BAR_TEST_PROG_FOO)
- unset(BAR_TEST_PROG_BAR)
unset(FOO_TEST_FILE_FOO CACHE)
+ unset(FOO_TEST_FILE_ZOT CACHE)
unset(FOO_TEST_PATH_FOO CACHE)
+ unset(FOO_TEST_PATH_ZOT CACHE)
unset(FOO_TEST_PROG_FOO CACHE)
- unset(BAR_TEST_FILE_FOO CACHE)
- unset(BAR_TEST_FILE_BAR CACHE)
- unset(BAR_TEST_PATH_FOO CACHE)
- unset(BAR_TEST_PATH_BAR CACHE)
- unset(BAR_TEST_PROG_FOO CACHE)
- unset(BAR_TEST_PROG_BAR CACHE)
endmacro()
macro(RunPackageRootTest)
- set(orig_foo_cmake_root ${Foo_ROOT})
- set(orig_foo_env_root $ENV{Foo_ROOT})
- set(orig_bar_cmake_root ${Bar_ROOT})
- set(orig_bar_env_root $ENV{Bar_ROOT})
-
- find_package(Foo)
+ message("----------")
message("Foo_ROOT :${Foo_ROOT}")
message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}")
- message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}")
- message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}")
- message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}")
- CleanUpPackageRootTest()
message("")
- set(Foo_ROOT ${orig_foo_cmake_root})
- set(ENV{Foo_ROOT} ${orig_foo_env_root})
- set(Bar_ROOT ${orig_bar_cmake_root})
- set(ENV{Bar_ROOT} ${orig_bar_env_root})
-
- find_package(Foo COMPONENTS Bar)
- message("Foo_ROOT :${Foo_ROOT}")
- message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}")
- message("Bar_ROOT :${Bar_ROOT}")
- message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}")
+ find_package(Foo)
+ message("find_package(Foo)")
message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}")
+ message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}")
message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}")
+ message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}")
message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}")
- message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}")
- message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}")
- message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}")
- message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}")
- message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}")
- message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}")
CleanUpPackageRootTest()
message("")
-
- unset(orig_foo_cmake_root)
- unset(orig_foo_env_root)
- unset(orig_bar_cmake_root)
- unset(orig_bar_env_root)
endmacro()
RunPackageRootTest()
@@ -81,63 +45,3 @@ RunPackageRootTest()
set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
RunPackageRootTest()
-
-##
-
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-RunPackageRootTest()
-
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-##
-
-set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-RunPackageRootTest()
-
-set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-RunPackageRootTest()
-
-set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
-set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-RunPackageRootTest()
-
-##
-
-set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
-set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-##
-
-set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
-
-set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
-set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/env_root)
-set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
-set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
-RunPackageRootTest()
diff --git a/Tests/RunCMake/find_package/PackageRoot/BarConfig.cmake b/Tests/RunCMake/find_package/PackageRoot/BarConfig.cmake
new file mode 100644
index 0000000..9eaf386
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/BarConfig.cmake
@@ -0,0 +1,9 @@
+set(BAR_CMAKE_FILE ${CMAKE_CURRENT_LIST_FILE} CACHE FILEPATH "")
+find_file(BAR_TEST_FILE_FOO foo.h)
+find_file(BAR_TEST_FILE_BAR bar.h)
+find_file(BAR_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot)
+find_path(BAR_TEST_PATH_FOO foo.h)
+find_path(BAR_TEST_PATH_BAR bar.h)
+find_path(BAR_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot)
+find_program(BAR_TEST_PROG_FOO foo.exe)
+find_program(BAR_TEST_PROG_BAR bar.exe)
diff --git a/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake
index eefa49c..9eaf386 100644
--- a/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake
+++ b/Tests/RunCMake/find_package/PackageRoot/FindBar.cmake
@@ -1,6 +1,9 @@
+set(BAR_CMAKE_FILE ${CMAKE_CURRENT_LIST_FILE} CACHE FILEPATH "")
find_file(BAR_TEST_FILE_FOO foo.h)
find_file(BAR_TEST_FILE_BAR bar.h)
+find_file(BAR_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot)
find_path(BAR_TEST_PATH_FOO foo.h)
find_path(BAR_TEST_PATH_BAR bar.h)
+find_path(BAR_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot)
find_program(BAR_TEST_PROG_FOO foo.exe)
find_program(BAR_TEST_PROG_BAR bar.exe)
diff --git a/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake
index cb62390..b929c2a 100644
--- a/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake
+++ b/Tests/RunCMake/find_package/PackageRoot/FindFoo.cmake
@@ -1,7 +1,11 @@
find_file(FOO_TEST_FILE_FOO foo.h)
+find_file(FOO_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot)
find_path(FOO_TEST_PATH_FOO foo.h)
+find_path(FOO_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot)
find_program(FOO_TEST_PROG_FOO foo.exe)
-if ("Bar" IN_LIST Foo_FIND_COMPONENTS)
+if ("BarModule" IN_LIST Foo_FIND_COMPONENTS)
find_package(Bar)
+elseif ("BarConfig" IN_LIST Foo_FIND_COMPONENTS)
+ find_package(Bar CONFIG)
endif ()
diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/bar/cmake_root/include/zot/zot.h
diff --git a/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/bar/env_root/include/zot/zot.h
diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
new file mode 100644
index 0000000..9eaf386
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
@@ -0,0 +1,9 @@
+set(BAR_CMAKE_FILE ${CMAKE_CURRENT_LIST_FILE} CACHE FILEPATH "")
+find_file(BAR_TEST_FILE_FOO foo.h)
+find_file(BAR_TEST_FILE_BAR bar.h)
+find_file(BAR_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot)
+find_path(BAR_TEST_PATH_FOO foo.h)
+find_path(BAR_TEST_PATH_BAR bar.h)
+find_path(BAR_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot)
+find_program(BAR_TEST_PROG_FOO foo.exe)
+find_program(BAR_TEST_PROG_BAR bar.exe)
diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/foo/cmake_root/include/zot/zot.h
diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/cmake/BarConfig.cmake b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/cmake/BarConfig.cmake
new file mode 100644
index 0000000..9eaf386
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/cmake/BarConfig.cmake
@@ -0,0 +1,9 @@
+set(BAR_CMAKE_FILE ${CMAKE_CURRENT_LIST_FILE} CACHE FILEPATH "")
+find_file(BAR_TEST_FILE_FOO foo.h)
+find_file(BAR_TEST_FILE_BAR bar.h)
+find_file(BAR_TEST_FILE_ZOT zot.h PATH_SUFFIXES zot)
+find_path(BAR_TEST_PATH_FOO foo.h)
+find_path(BAR_TEST_PATH_BAR bar.h)
+find_path(BAR_TEST_PATH_ZOT zot.h PATH_SUFFIXES zot)
+find_program(BAR_TEST_PROG_FOO foo.exe)
+find_program(BAR_TEST_PROG_BAR bar.exe)
diff --git a/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/foo/env_root/include/zot/zot.h
diff --git a/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt b/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt
new file mode 100644
index 0000000..79266c3
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt
@@ -0,0 +1,298 @@
+----------
+Foo_ROOT :
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
+FOO_TEST_FILE_ZOT :FOO_TEST_FILE_ZOT-NOTFOUND
+FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
+FOO_TEST_PATH_ZOT :FOO_TEST_PATH_ZOT-NOTFOUND
+FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
+BAR_CMAKE_FILE :
+BAR_TEST_FILE_FOO :
+BAR_TEST_FILE_BAR :
+BAR_TEST_FILE_ZOT :
+BAR_TEST_PATH_FOO :
+BAR_TEST_PATH_BAR :
+BAR_TEST_PATH_ZOT :
+BAR_TEST_PROG_FOO :
+BAR_TEST_PROG_BAR :
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarConfig\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
diff --git a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
new file mode 100644
index 0000000..571739d
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake
@@ -0,0 +1,135 @@
+cmake_policy(SET CMP0057 NEW)
+list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
+set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
+
+macro(CleanUpPackageRootTest)
+ unset(Foo_ROOT)
+ unset(ENV{Foo_ROOT})
+ unset(Bar_DIR)
+ unset(BAR_CMAKE_FILE)
+ unset(Bar_ROOT)
+ unset(ENV{Bar_ROOT})
+ unset(FOO_TEST_FILE_FOO)
+ unset(FOO_TEST_FILE_ZOT)
+ unset(FOO_TEST_PATH_FOO)
+ unset(FOO_TEST_PATH_ZOT)
+ unset(FOO_TEST_PROG_FOO)
+ unset(BAR_TEST_FILE_FOO)
+ unset(BAR_TEST_FILE_BAR)
+ unset(BAR_TEST_FILE_ZOT)
+ unset(BAR_TEST_PATH_FOO)
+ unset(BAR_TEST_PATH_BAR)
+ unset(BAR_TEST_PATH_ZOT)
+ unset(BAR_TEST_PROG_FOO)
+ unset(BAR_TEST_PROG_BAR)
+ unset(Bar_DIR CACHE)
+ unset(BAR_CMAKE_FILE CACHE)
+ unset(FOO_TEST_FILE_FOO CACHE)
+ unset(FOO_TEST_FILE_ZOT CACHE)
+ unset(FOO_TEST_PATH_FOO CACHE)
+ unset(FOO_TEST_PATH_ZOT CACHE)
+ unset(FOO_TEST_PROG_FOO CACHE)
+ unset(BAR_TEST_FILE_FOO CACHE)
+ unset(BAR_TEST_FILE_BAR CACHE)
+ unset(BAR_TEST_FILE_ZOT CACHE)
+ unset(BAR_TEST_PATH_FOO CACHE)
+ unset(BAR_TEST_PATH_BAR CACHE)
+ unset(BAR_TEST_PATH_ZOT CACHE)
+ unset(BAR_TEST_PROG_FOO CACHE)
+ unset(BAR_TEST_PROG_BAR CACHE)
+endmacro()
+
+macro(RunPackageRootTest)
+ message("----------")
+ message("Foo_ROOT :${Foo_ROOT}")
+ message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}")
+ message("Bar_DIR :${Bar_DIR}")
+ message("Bar_ROOT :${Bar_ROOT}")
+ message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}")
+ message("")
+
+ find_package(Foo COMPONENTS BarConfig)
+ message("find_package(Foo COMPONENTS BarConfig)")
+ message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}")
+ message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}")
+ message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}")
+ message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}")
+ message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}")
+ message("BAR_CMAKE_FILE :${BAR_CMAKE_FILE}")
+ message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}")
+ message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}")
+ message("BAR_TEST_FILE_ZOT :${BAR_TEST_FILE_ZOT}")
+ message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}")
+ message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}")
+ message("BAR_TEST_PATH_ZOT :${BAR_TEST_PATH_ZOT}")
+ message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}")
+ message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}")
+ CleanUpPackageRootTest()
+ message("")
+endmacro()
+
+#
+
+RunPackageRootTest()
+
+#
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+#
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+#
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
diff --git a/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt b/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt
new file mode 100644
index 0000000..57cab60
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt
@@ -0,0 +1,298 @@
+----------
+Foo_ROOT :
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :FOO_TEST_FILE_FOO-NOTFOUND
+FOO_TEST_FILE_ZOT :FOO_TEST_FILE_ZOT-NOTFOUND
+FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND
+FOO_TEST_PATH_ZOT :FOO_TEST_PATH_ZOT-NOTFOUND
+FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND
+BAR_TEST_FILE_BAR :BAR_TEST_FILE_BAR-NOTFOUND
+BAR_TEST_FILE_ZOT :BAR_TEST_FILE_ZOT-NOTFOUND
+BAR_TEST_PATH_FOO :BAR_TEST_PATH_FOO-NOTFOUND
+BAR_TEST_PATH_BAR :BAR_TEST_PATH_BAR-NOTFOUND
+BAR_TEST_PATH_ZOT :BAR_TEST_PATH_ZOT-NOTFOUND
+BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND
+BAR_TEST_PROG_BAR :BAR_TEST_PROG_BAR-NOTFOUND
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe
+
+----------
+Foo_ROOT :.*/PackageRoot/foo/cmake_root
+ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root
+Bar_DIR :
+Bar_ROOT :.*/PackageRoot/bar/cmake_root
+ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root
+
+find_package\(Foo COMPONENTS BarModule\)
+FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h
+FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot
+FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake
+BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h
+BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h
+BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h
+BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include
+BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include
+BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot
+BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe
+BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe
diff --git a/Tests/RunCMake/find_package/PackageRootNestedModule.cmake b/Tests/RunCMake/find_package/PackageRootNestedModule.cmake
new file mode 100644
index 0000000..f99db59
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRootNestedModule.cmake
@@ -0,0 +1,135 @@
+cmake_policy(SET CMP0057 NEW)
+list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
+set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot)
+
+macro(CleanUpPackageRootTest)
+ unset(Foo_ROOT)
+ unset(ENV{Foo_ROOT})
+ unset(Bar_DIR)
+ unset(BAR_CMAKE_FILE)
+ unset(Bar_ROOT)
+ unset(ENV{Bar_ROOT})
+ unset(FOO_TEST_FILE_FOO)
+ unset(FOO_TEST_FILE_ZOT)
+ unset(FOO_TEST_PATH_FOO)
+ unset(FOO_TEST_PATH_ZOT)
+ unset(FOO_TEST_PROG_FOO)
+ unset(BAR_TEST_FILE_FOO)
+ unset(BAR_TEST_FILE_BAR)
+ unset(BAR_TEST_FILE_ZOT)
+ unset(BAR_TEST_PATH_FOO)
+ unset(BAR_TEST_PATH_BAR)
+ unset(BAR_TEST_PATH_ZOT)
+ unset(BAR_TEST_PROG_FOO)
+ unset(BAR_TEST_PROG_BAR)
+ unset(Bar_DIR CACHE)
+ unset(BAR_CMAKE_FILE CACHE)
+ unset(FOO_TEST_FILE_FOO CACHE)
+ unset(FOO_TEST_FILE_ZOT CACHE)
+ unset(FOO_TEST_PATH_FOO CACHE)
+ unset(FOO_TEST_PATH_ZOT CACHE)
+ unset(FOO_TEST_PROG_FOO CACHE)
+ unset(BAR_TEST_FILE_FOO CACHE)
+ unset(BAR_TEST_FILE_BAR CACHE)
+ unset(BAR_TEST_FILE_ZOT CACHE)
+ unset(BAR_TEST_PATH_FOO CACHE)
+ unset(BAR_TEST_PATH_BAR CACHE)
+ unset(BAR_TEST_PATH_ZOT CACHE)
+ unset(BAR_TEST_PROG_FOO CACHE)
+ unset(BAR_TEST_PROG_BAR CACHE)
+endmacro()
+
+macro(RunPackageRootTest)
+ message("----------")
+ message("Foo_ROOT :${Foo_ROOT}")
+ message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}")
+ message("Bar_DIR :${Bar_DIR}")
+ message("Bar_ROOT :${Bar_ROOT}")
+ message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}")
+ message("")
+
+ find_package(Foo COMPONENTS BarModule)
+ message("find_package(Foo COMPONENTS BarModule)")
+ message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}")
+ message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}")
+ message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}")
+ message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}")
+ message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}")
+ message("BAR_CMAKE_FILE :${BAR_CMAKE_FILE}")
+ message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}")
+ message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}")
+ message("BAR_TEST_FILE_ZOT :${BAR_TEST_FILE_ZOT}")
+ message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}")
+ message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}")
+ message("BAR_TEST_PATH_ZOT :${BAR_TEST_PATH_ZOT}")
+ message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}")
+ message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}")
+ CleanUpPackageRootTest()
+ message("")
+endmacro()
+
+#
+
+RunPackageRootTest()
+
+#
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+#
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+#
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
+
+set(Foo_ROOT ${PackageRoot_BASE}/foo/cmake_root)
+set(ENV{Foo_ROOT} ${PackageRoot_BASE}/foo/cmake_root)
+set(Bar_ROOT ${PackageRoot_BASE}/bar/cmake_root)
+set(ENV{Bar_ROOT} ${PackageRoot_BASE}/bar/env_root)
+RunPackageRootTest()
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 72f9c4d..d548da0 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -14,6 +14,10 @@ run_cmake(MissingConfigRequired)
run_cmake(MissingConfigVersion)
run_cmake(MixedModeOptions)
run_cmake(PackageRoot)
+run_cmake(PackageRootNestedConfig)
+run_cmake(PackageRootNestedModule)
run_cmake(PolicyPush)
run_cmake(PolicyPop)
run_cmake(SetFoundFALSE)
+run_cmake(WrongVersion)
+run_cmake(WrongVersionConfig)
diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt
new file mode 100644
index 0000000..695f645
--- /dev/null
+++ b/Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt
@@ -0,0 +1,9 @@
+CMake Warning at SetFoundFALSE.cmake:2 \(find_package\):
+ Found package configuration file:
+
+ .*/Tests/RunCMake/find_package/SetFoundFALSEConfig.cmake
+
+ but it set SetFoundFALSE_FOUND to FALSE so package "SetFoundFALSE" is
+ considered to be NOT FOUND.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt b/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt
deleted file mode 100644
index 37e6e7e..0000000
--- a/Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
--- Could NOT find SetFoundFALSE \(missing: SetFoundFALSE_DIR\)
diff --git a/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake
diff --git a/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake
new file mode 100644
index 0000000..2dbcfb2
--- /dev/null
+++ b/Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake
@@ -0,0 +1,4 @@
+set(PACKAGE_VERSION 1)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+endif()
diff --git a/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake
diff --git a/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake
new file mode 100644
index 0000000..7eb8332
--- /dev/null
+++ b/Tests/RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake
@@ -0,0 +1,4 @@
+set(PACKAGE_VERSION 2)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+endif()
diff --git a/Tests/RunCMake/find_package/WrongVersion-stderr.txt b/Tests/RunCMake/find_package/WrongVersion-stderr.txt
new file mode 100644
index 0000000..ae9fc4a
--- /dev/null
+++ b/Tests/RunCMake/find_package/WrongVersion-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Warning at WrongVersion.cmake:[0-9]+ \(find_package\):
+ Could not find a configuration file for package "VersionedA" that is
+ compatible with requested version "3".
+
+ The following configuration files were considered but not accepted:
+
+ .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12]
+ .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12]
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_package/WrongVersion.cmake b/Tests/RunCMake/find_package/WrongVersion.cmake
new file mode 100644
index 0000000..5bc711f
--- /dev/null
+++ b/Tests/RunCMake/find_package/WrongVersion.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+find_package(VersionedA 3)
diff --git a/Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt b/Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt
new file mode 100644
index 0000000..1b84233
--- /dev/null
+++ b/Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Warning at WrongVersionConfig.cmake:[0-9]+ \(find_package\):
+ Could not find a configuration file for package "VersionedA" that is
+ compatible with requested version "3".
+
+ The following configuration files were considered but not accepted:
+
+ .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12]
+ .*/Tests/RunCMake/find_package/VersionedA-[12]/VersionedAConfig.cmake, version: [12]
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_package/WrongVersionConfig.cmake b/Tests/RunCMake/find_package/WrongVersionConfig.cmake
new file mode 100644
index 0000000..5bc711f
--- /dev/null
+++ b/Tests/RunCMake/find_package/WrongVersionConfig.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+find_package(VersionedA 3)
diff --git a/Tests/RunCMake/target_compile_features/CMakeLists.txt b/Tests/RunCMake/target_compile_features/CMakeLists.txt
index 3482e6b..2897109 100644
--- a/Tests/RunCMake/target_compile_features/CMakeLists.txt
+++ b/Tests/RunCMake/target_compile_features/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 3.0)
-project(${RunCMake_TEST} CXX)
+project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
index 33faf2b..1f67f11 100644
--- a/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ run_cmake(not_a_cxx_feature)
run_cmake(no_matching_cxx_feature)
run_cmake(not_a_c_feature)
run_cmake(no_matching_c_feature)
+run_cmake(cxx_not_enabled)
diff --git a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
index 417bf62..5ebe170 100644
--- a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at alias_target.cmake:4 \(target_compile_features\):
+CMake Error at alias_target.cmake:[0-9]+ \(target_compile_features\):
target_compile_features can not be used on an ALIAS target.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/alias_target.cmake b/Tests/RunCMake/target_compile_features/alias_target.cmake
index d35ddba..6fcdada 100644
--- a/Tests/RunCMake/target_compile_features/alias_target.cmake
+++ b/Tests/RunCMake/target_compile_features/alias_target.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_executable(main empty.cpp)
add_executable(Alias::Main ALIAS main)
diff --git a/Tests/RunCMake/target_compile_features/cxx_not_enabled-result.txt b/Tests/RunCMake/target_compile_features/cxx_not_enabled-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/cxx_not_enabled-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt b/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt
new file mode 100644
index 0000000..4f707c7
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at cxx_not_enabled.cmake:[0-9]+ \(target_compile_features\):
+ target_compile_features cannot use features from non-enabled language CXX
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/target_compile_features/cxx_not_enabled.cmake b/Tests/RunCMake/target_compile_features/cxx_not_enabled.cmake
new file mode 100644
index 0000000..b7e9119
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/cxx_not_enabled.cmake
@@ -0,0 +1,2 @@
+add_executable(main empty.c)
+target_compile_features(main PRIVATE cxx_decltype)
diff --git a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
index c6ff5ec..7a07427 100644
--- a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at imported_target.cmake:3 \(target_compile_features\):
+CMake Error at imported_target.cmake:[0-9]+ \(target_compile_features\):
Cannot specify compile features for imported target "main".
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/imported_target.cmake b/Tests/RunCMake/target_compile_features/imported_target.cmake
index e248c2f..e886ce9 100644
--- a/Tests/RunCMake/target_compile_features/imported_target.cmake
+++ b/Tests/RunCMake/target_compile_features/imported_target.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_library(main INTERFACE IMPORTED)
target_compile_features(main INTERFACE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
index bd5b7b9..9917be7 100644
--- a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at invalid_args.cmake:3 \(target_compile_features\):
+CMake Error at invalid_args.cmake:[0-9]+ \(target_compile_features\):
target_compile_features called with invalid arguments
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args.cmake b/Tests/RunCMake/target_compile_features/invalid_args.cmake
index 1a7fb37..cc051a4 100644
--- a/Tests/RunCMake/target_compile_features/invalid_args.cmake
+++ b/Tests/RunCMake/target_compile_features/invalid_args.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_executable(main empty.cpp)
target_compile_features(main INVALID cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
index c30209a..3708998 100644
--- a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at invalid_args_on_interface.cmake:3 \(target_compile_features\):
+CMake Error at invalid_args_on_interface.cmake:[0-9]+ \(target_compile_features\):
target_compile_features may only be set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake b/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake
index 324d0f3..49d2d82 100644
--- a/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake
+++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_library(main INTERFACE)
target_compile_features(main PRIVATE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt
index 96b959c..1875d12 100644
--- a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at no_matching_c_feature.cmake:[0-9][0-9]? \((target_compile_features|message)\):
+CMake Error at no_matching_c_feature.cmake:[0-9]+ \((target_compile_features|message)\):
The compiler feature "gnu_c_dummy" is not known to C compiler
"GNU"
diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake b/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake
index a44caf2..0e93b41 100644
--- a/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake
+++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
if (NOT ";${CMAKE_C_COMPILE_FEATURES};" MATCHES ";gnu_c_typeof;")
# Simulate passing the test.
diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
index f976dfe..90d41c9 100644
--- a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at no_matching_cxx_feature.cmake:[0-9][0-9]? \((target_compile_features|message)\):
+CMake Error at no_matching_cxx_feature.cmake:[0-9]+ \((target_compile_features|message)\):
The compiler feature "[^"]+" is not known to CXX compiler
"[^"]*"
diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake
index ab1fd76..4ee3445 100644
--- a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake
+++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
if (NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";gnu_cxx_typeof;"
AND NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";msvc_cxx_sealed;" )
diff --git a/Tests/RunCMake/target_compile_features/no_target-stderr.txt b/Tests/RunCMake/target_compile_features/no_target-stderr.txt
index 323ba7a..65974b4 100644
--- a/Tests/RunCMake/target_compile_features/no_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/no_target-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at no_target.cmake:2 \(target_compile_features\):
+CMake Error at no_target.cmake:[0-9]+ \(target_compile_features\):
Cannot specify compile features for target "main" which is not built by
this project.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/target_compile_features/no_target.cmake b/Tests/RunCMake/target_compile_features/no_target.cmake
index 3f0afe2..a514de8 100644
--- a/Tests/RunCMake/target_compile_features/no_target.cmake
+++ b/Tests/RunCMake/target_compile_features/no_target.cmake
@@ -1,2 +1,3 @@
+enable_language(CXX)
target_compile_features(main INTERFACE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt
index 6dd00f3..493c582 100644
--- a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at not_a_c_feature.cmake:3 \(target_compile_features\):
+CMake Error at not_a_c_feature.cmake:[0-9]+ \(target_compile_features\):
target_compile_features specified unknown feature "c_not_a_feature" for
target "main".
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake b/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake
index 0420698..f5d70d0 100644
--- a/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake
+++ b/Tests/RunCMake/target_compile_features/not_a_c_feature.cmake
@@ -1,3 +1,4 @@
+enable_language(C)
add_executable(main empty.c)
target_compile_features(main
diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
index efa2bad..3dbf0e6 100644
--- a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at not_a_cxx_feature.cmake:3 \(target_compile_features\):
+CMake Error at not_a_cxx_feature.cmake:[0-9]+ \(target_compile_features\):
target_compile_features specified unknown feature "cxx_not_a_feature" for
target "main".
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake b/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake
index 0207b72..bc3a8c4 100644
--- a/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake
+++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_executable(main empty.cpp)
target_compile_features(main
diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
index 2f8d812..c0c2efa 100644
--- a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at not_enough_args.cmake:3 \(target_compile_features\):
+CMake Error at not_enough_args.cmake:[0-9]+ \(target_compile_features\):
target_compile_features called with incorrect number of arguments
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/not_enough_args.cmake b/Tests/RunCMake/target_compile_features/not_enough_args.cmake
index 9561230..f5b7198 100644
--- a/Tests/RunCMake/target_compile_features/not_enough_args.cmake
+++ b/Tests/RunCMake/target_compile_features/not_enough_args.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_executable(main empty.cpp)
target_compile_features(main)
diff --git a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
index d239059..ff03310 100644
--- a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at utility_target.cmake:4 \(target_compile_features\):
+CMake Error at utility_target.cmake:[0-9]+ \(target_compile_features\):
target_compile_features called with non-compilable target type
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index ee660ed..718e624 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -50,5 +50,9 @@ add_library(ResourceLib STATIC lib.cpp lib.rc)
add_executable(VSResource main.cpp test.rc)
target_link_libraries(VSResource ResourceLib)
+if(MSVC AND NOT MSVC_VERSION VERSION_LESS 1600)
+ set_property(SOURCE test.rc PROPERTY COMPILE_FLAGS /nologo)
+endif()
+
set_property(TARGET VSResource
PROPERTY VS_GLOBAL_CMakeTestVsGlobalVariable "test val")
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 6f273f9..cfda2d4 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -46,7 +46,20 @@ from sphinx.directives import ObjectDescription
from sphinx.domains import Domain, ObjType
from sphinx.roles import XRefRole
from sphinx.util.nodes import make_refnode
-from sphinx import addnodes, version_info
+from sphinx import addnodes
+
+# Needed for checking if Sphinx version is >= 1.4.
+# See https://github.com/sphinx-doc/sphinx/issues/2673
+old_sphinx = False
+
+try:
+ from sphinx import version_info
+ if version_info < (1, 4):
+ old_sphinx = True
+except ImportError:
+ # The `sphinx.version_info` tuple was added in Sphinx v1.2:
+ old_sphinx = True
+
class CMakeModule(Directive):
required_arguments = 1
@@ -124,7 +137,7 @@ class _cmake_index_entry:
def __call__(self, title, targetid, main = 'main'):
# See https://github.com/sphinx-doc/sphinx/issues/2673
- if version_info < (1, 4):
+ if old_sphinx:
return ('pair', u'%s ; %s' % (self.desc, title), targetid, main)
else:
return ('pair', u'%s ; %s' % (self.desc, title), targetid, main, None)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 45ae3de..d85f366 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -929,6 +929,8 @@ if(HAVE_LIBWS2_32)
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
elseif(HAVE_LIBSOCKET)
set(CMAKE_REQUIRED_LIBRARIES socket)
+elseif(HAVE_LIBNETWORK)
+ set(CMAKE_REQUIRED_LIBRARIES network)
endif()
check_symbol_exists(basename "${CURL_INCLUDES}" HAVE_BASENAME)