Imported Upstream version 3.16.9 upstream/3.16.9
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:19:55 +0000 (09:19 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:19:55 +0000 (09:19 +0900)
Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
Help/release/3.16.rst
Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
Modules/CMakeGenericSystem.cmake
Source/CMakeVersion.cmake
Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake

index e2ebb3f..f789724 100644 (file)
@@ -13,7 +13,7 @@ the ``-p`` path prefix option.  ``moc`` usually generates a
 relative include path in that case.
 
 :prop_tgt:`AUTOMOC_PATH_PREFIX` is initialized from the variable
-:variable:`CMAKE_AUTOMOC_PATH_PREFIX`, which is ``ON`` by default.
+:variable:`CMAKE_AUTOMOC_PATH_PREFIX`, which is ``OFF`` by default.
 
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
@@ -24,8 +24,7 @@ Reproducible builds
 For reproducible builds is is recommended to keep headers that are ``moc``
 compiled in one of the target
 :command:`include directories <target_include_directories>` and set
-:prop_tgt:`AUTOMOC_PATH_PREFIX` to ``ON`` (which is the default).  This ensures
-that
+:prop_tgt:`AUTOMOC_PATH_PREFIX` to ``ON``.  This ensures that:
 
 - ``moc`` output files are identical on different build setups,
 - ``moc`` output files will compile correctly when the source and/or
index f3fdb08..84d96cd 100644 (file)
@@ -178,17 +178,15 @@ Modules
 Autogen
 -------
 
-* When using :prop_tgt:`AUTOMOC`, CMake now generates the ``-p`` path prefix
+* When using :prop_tgt:`AUTOMOC`, the new :variable:`CMAKE_AUTOMOC_PATH_PREFIX`
+  variable or :prop_tgt:`AUTOMOC_PATH_PREFIX` target property may be enabled
+  to generate the ``-p`` path prefix
   option for ``moc``.  This ensures that ``moc`` output files are identical
   on different build setups (given, that the headers compiled by ``moc`` are
   in an :command:`include directory <target_include_directories>`).
   Also it ensures that ``moc`` output files will compile correctly when the
   source and/or build directory is a symbolic link.
 
-  The ``moc`` path prefix generation behavior can be configured by setting
-  the new :variable:`CMAKE_AUTOMOC_PATH_PREFIX` variable and/or
-  :prop_tgt:`AUTOMOC_PATH_PREFIX` target property.
-
 CTest
 -----
 
@@ -316,3 +314,11 @@ Changes made since CMake 3.16.0 include the following.
   :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target properties.
   Previously they would be places in ``*_CFLAGS_OTHER`` variables and
   :prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties.
+
+3.16.9
+------
+
+* The default value of :variable:`CMAKE_AUTOMOC_PATH_PREFIX` was changed to
+  ``OFF`` because this feature can break existing projects that have
+  identically named header files in different include directories.
+  This restores compatibility with behavior of CMake 3.15 and below.
index dca0b06..1e9790f 100644 (file)
@@ -8,4 +8,4 @@ This variable is used to initialize the :prop_tgt:`AUTOMOC_PATH_PREFIX`
 property on all the targets.  See that target property for additional
 information.
 
-The default value is ``ON``.
+The default value is ``OFF``.
index 77d8cfd..4b9e80d 100644 (file)
@@ -26,7 +26,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
 
 set(CMAKE_AUTOGEN_ORIGIN_DEPENDS ON)
 set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON)
-set(CMAKE_AUTOMOC_PATH_PREFIX ON)
+if(NOT DEFINED CMAKE_AUTOMOC_PATH_PREFIX)
+  set(CMAKE_AUTOMOC_PATH_PREFIX OFF)
+endif()
 set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE")
 
 # basically all general purpose OSs support shared libs
index 2ee7e80..87dcf63 100644 (file)
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 16)
-set(CMake_VERSION_PATCH 8)
+set(CMake_VERSION_PATCH 9)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
@@ -21,7 +21,7 @@ endif()
 
 if(NOT CMake_VERSION_NO_GIT)
   # If this source was exported by 'git archive', use its commit info.
-  set(git_info [==[39c6ac5112 CMake 3.16.8]==])
+  set(git_info [==[43ddc64032 CMake 3.16.9]==])
 
   # Otherwise, try to identify the current development source version.
   if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
index 1627b39..8b11b46 100644 (file)
@@ -61,6 +61,7 @@ macro(buildMocInclude sourceDir binaryDir)
     "${sourceDir}"
     MocInclude
     CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+                "-DCMAKE_AUTOMOC_PATH_PREFIX=ON"
                 "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
                 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
     OUTPUT_VARIABLE output
index b77bb54..7b479f1 100644 (file)
@@ -1,5 +1,10 @@
 include(RunCMake)
 
+# Isolate test cases from caller's environment.
+set(ENV{CMAKE_PREFIX_PATH} "")
+set(ENV{CMAKE_APPBUNDLE_PATH} "")
+set(ENV{CMAKE_FRAMEWORK_PATH} "")
+
 run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH)
 run_cmake(FindPkgConfig_PKGCONFIG_PATH)
 run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH)