summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst5
-rw-r--r--Help/release/3.16.rst16
-rw-r--r--Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst2
-rw-r--r--Modules/CMakeGenericSystem.cmake4
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake5
7 files changed, 25 insertions, 12 deletions
diff --git a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
index e2ebb3ffc..f789724ad 100644
--- a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
+++ b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
@@ -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
diff --git a/Help/release/3.16.rst b/Help/release/3.16.rst
index f3fdb08d2..84d96cdc8 100644
--- a/Help/release/3.16.rst
+++ b/Help/release/3.16.rst
@@ -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.
diff --git a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
index dca0b0657..1e9790fde 100644
--- a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
+++ b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
@@ -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``.
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 77d8cfd4f..4b9e80dd4 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -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
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 2ee7e8013..87dcf639e 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -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]* "
diff --git a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
index 1627b394f..8b11b465d 100644
--- a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
+++ b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
@@ -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
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index b77bb5432..7b479f1db 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -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)