[Cmake-commits] CMake branch, master, updated. v3.11.3-880-gb671e47

Kitware Robot kwrobot at kitware.com
Fri Jun 1 09:55:07 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  b671e4799f0e418448681a21120e8e87a97de5dc (commit)
       via  4144b78013448f01360cabedd92426bb177a94b7 (commit)
       via  5ba76299f8bc3d13a1a3a5542c46cf7c438be675 (commit)
       via  b1662b1f96b0e74d2c21b1532be63e773eaae881 (commit)
       via  86121ffd1c38531e7137bfb25d7c47b2ca9b56c9 (commit)
       via  bbbcbb1a48b22a581f8793ac2b6ca549b388ed2f (commit)
       via  1c5b1ad4088fc98287448a68771ec2601174a392 (commit)
       via  6a64292fa722c15b8af63e3b0b4dcef5dbfacc8e (commit)
       via  1c87844856f7995bccc30c32567540be948f80da (commit)
       via  5852acffa4b67a614df3343bcb29e6b9511d0704 (commit)
       via  41685c8ba0902cff1241886d966e796cecb82ae3 (commit)
       via  2930a198f610e729d73df6771d70119adac6df2e (commit)
      from  629287304565de8711b9fa6982bdf83c3f443e55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b671e4799f0e418448681a21120e8e87a97de5dc
commit b671e4799f0e418448681a21120e8e87a97de5dc
Merge: 4144b78 86121ff
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 1 13:48:21 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jun 1 09:50:18 2018 -0400

    Merge topic 'update-prebuilt-openssl'
    
    86121ffd1c Utilities/Release: Update to openssl-1.1.0h
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2119


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4144b78013448f01360cabedd92426bb177a94b7
commit 4144b78013448f01360cabedd92426bb177a94b7
Merge: 5ba7629 5852acf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 1 13:48:56 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jun 1 09:49:37 2018 -0400

    Merge topic 'autogen_autorcc_multi_config'
    
    5852acffa4 Autogen: Add AUTORCC configuration change test
    41685c8ba0 Autogen: Let AUTORCC generate output for all configurations
    2930a198f6 Autogen: Add lock file to AUTORCC commands
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2117


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ba76299f8bc3d13a1a3a5542c46cf7c438be675
commit 5ba76299f8bc3d13a1a3a5542c46cf7c438be675
Merge: b1662b1 bbbcbb1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 1 13:48:09 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jun 1 09:48:51 2018 -0400

    Merge topic 'nolint_typedef_testdriver'
    
    bbbcbb1a48 TestDriver: Disable clang-tidy 'modernize-use-using'
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2118


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1662b1f96b0e74d2c21b1532be63e773eaae881
commit b1662b1f96b0e74d2c21b1532be63e773eaae881
Merge: 6292873 1c5b1ad
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 1 13:47:53 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jun 1 09:48:04 2018 -0400

    Merge topic 'alsa-target'
    
    1c5b1ad408 FindALSA: add testcase
    6a64292fa7 FindALSA: reformat docs
    1c87844856 FindALSA: provide an imported target
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2112


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86121ffd1c38531e7137bfb25d7c47b2ca9b56c9
commit 86121ffd1c38531e7137bfb25d7c47b2ca9b56c9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 31 11:24:41 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 31 11:24:41 2018 -0400

    Utilities/Release: Update to openssl-1.1.0h
    
    Update the prebuilt binary build configurations for machines where
    we build our own OpenSSL library to use a newer version.

diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake
index 2fd4f12..04a74ac 100644
--- a/Utilities/Release/linux64_release.cmake
+++ b/Utilities/Release/linux64_release.cmake
@@ -29,9 +29,9 @@ CURSES_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libncurses.a
 CURSES_INCLUDE_PATH:PATH=/home/kitware/ncurses-5.9/include
 FORM_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libform.a
 CMAKE_USE_OPENSSL:BOOL=ON
-OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0g/lib/libcrypto.a;-pthread
-OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0g/include
-OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0g/lib/libssl.a
+OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0h/lib/libcrypto.a;-pthread
+OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0h/include
+OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0h/lib/libssl.a
 PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
 CPACK_SYSTEM_NAME:STRING=Linux-x86_64
 BUILD_QtDialog:BOOL=TRUE

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbbcbb1a48b22a581f8793ac2b6ca549b388ed2f
commit bbbcbb1a48b22a581f8793ac2b6ca549b388ed2f
Author:     Sylvain Joubert <joubert.sy at gmail.com>
AuthorDate: Thu May 31 13:51:40 2018 +0200
Commit:     Sylvain Joubert <joubert.sy at gmail.com>
CommitDate: Thu May 31 13:51:40 2018 +0200

    TestDriver: Disable clang-tidy 'modernize-use-using'

diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index ff3c869..d71f290 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -20,8 +20,8 @@
 
 /* Create map.  */
 
-typedef int (*MainFuncPointer)(int, char* []);
-typedef struct
+typedef int (*MainFuncPointer)(int, char* []); /* NOLINT */
+typedef struct /* NOLINT */
 {
   const char* name;
   MainFuncPointer func;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c5b1ad4088fc98287448a68771ec2601174a392
commit 1c5b1ad4088fc98287448a68771ec2601174a392
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu May 31 09:35:00 2018 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu May 31 09:35:53 2018 +0200

    FindALSA: add testcase

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 0e94388..886e392 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1368,6 +1368,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     endif()
   endif()
 
+  if(CMake_TEST_FindALSA)
+    add_subdirectory(FindALSA)
+  endif()
+
   if(CMake_TEST_CUDA)
     add_subdirectory(Cuda)
     add_subdirectory(CudaOnly)
diff --git a/Tests/FindALSA/CMakeLists.txt b/Tests/FindALSA/CMakeLists.txt
new file mode 100644
index 0000000..891f7a4
--- /dev/null
+++ b/Tests/FindALSA/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindALSA.Test COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindALSA/Test"
+  "${CMake_BINARY_DIR}/Tests/FindALSA/Test"
+  ${build_generator_args}
+  --build-project TestFindALSA
+  --build-options ${build_options}
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
diff --git a/Tests/FindALSA/Test/CMakeLists.txt b/Tests/FindALSA/Test/CMakeLists.txt
new file mode 100644
index 0000000..2829740
--- /dev/null
+++ b/Tests/FindALSA/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindALSA C)
+include(CTest)
+
+find_package(ALSA REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_ALSA_VERSION="${ALSA_VERSION_STRING}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt ALSA::ALSA)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${ALSA_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${ALSA_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindALSA/Test/main.c b/Tests/FindALSA/Test/main.c
new file mode 100644
index 0000000..d3303d0
--- /dev/null
+++ b/Tests/FindALSA/Test/main.c
@@ -0,0 +1,10 @@
+#include <alsa/global.h>
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+  printf("Found ALSA version %s, expected version %s\n",
+         snd_asoundlib_version(), CMAKE_EXPECTED_ALSA_VERSION);
+  return strcmp(snd_asoundlib_version(), CMAKE_EXPECTED_ALSA_VERSION);
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a64292fa722c15b8af63e3b0b4dcef5dbfacc8e
commit 6a64292fa722c15b8af63e3b0b4dcef5dbfacc8e
Author:     Rolf Eike Beer <eb at emlix.com>
AuthorDate: Mon May 28 15:52:08 2018 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu May 31 09:35:53 2018 +0200

    FindALSA: reformat docs

diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 84b6ec5..c9cfd60 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -18,20 +18,27 @@
 # Result Variables
 # ^^^^^^^^^^^^^^^^
 #
-# ::
+# This module defines the following variables:
 #
-#   This module defines the following variables:
-#      ALSA_FOUND       - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
-#      ALSA_LIBRARIES   - Set when ALSA_LIBRARY is found
-#      ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
+# ``ALSA_FOUND``
+#   True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
 #
+# ``ALSA_LIBRARIES``
+#   List of libraries when using ALSA.
 #
+# ``ALSA_INCLUDE_DIRS``
+#   Where to find the ALSA headers.
 #
-# ::
+# Cache variables
+# ^^^^^^^^^^^^^^^
 #
-#      ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
-#      ALSA_LIBRARY     - the asound library
-#      ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8)
+# The following cache variables may also be set:
+#
+# ``ALSA_INCLUDE_DIR``
+#   the ALSA include directory
+#
+# ``ALSA_LIBRARY``
+#   the absolute path of the asound library
 
 find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
           DOC "The ALSA (asound) include directory"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c87844856f7995bccc30c32567540be948f80da
commit 1c87844856f7995bccc30c32567540be948f80da
Author:     Rolf Eike Beer <eb at emlix.com>
AuthorDate: Mon May 28 15:47:23 2018 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu May 31 09:35:53 2018 +0200

    FindALSA: provide an imported target

diff --git a/Help/release/dev/alsa-target.rst b/Help/release/dev/alsa-target.rst
new file mode 100644
index 0000000..e970580
--- /dev/null
+++ b/Help/release/dev/alsa-target.rst
@@ -0,0 +1,4 @@
+alsa-target
+-----------
+
+* The :module:`FindALSA` module now provides imported targets.
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index fa9a434..84b6ec5 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -9,6 +9,15 @@
 #
 # Find the alsa libraries (asound)
 #
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
+# ALSA has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
 # ::
 #
 #   This module defines the following variables:
@@ -47,6 +56,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
 if(ALSA_FOUND)
   set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
   set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
+  if(NOT TARGET ALSA::ALSA)
+    add_library(ALSA::ALSA UNKNOWN IMPORTED)
+    set_target_properties(ALSA::ALSA PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ALSA_INCLUDE_DIRS}")
+    set_property(TARGET ALSA::ALSA APPEND PROPERTY IMPORTED_LOCATION "${ALSA_LIBRARY}")
+  endif()
 endif()
 
 mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5852acffa4b67a614df3343bcb29e6b9511d0704
commit 5852acffa4b67a614df3343bcb29e6b9511d0704
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri May 25 11:40:23 2018 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed May 30 17:45:01 2018 +0200

    Autogen: Add AUTORCC configuration change test

diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake
index 982a296..cd05aeb 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/CommonTests.cmake
@@ -43,3 +43,4 @@ if(NOT QT_TEST_VERSION STREQUAL 4)
   ADD_AUTOGEN_TEST(RerunMocPlugin)
 endif()
 ADD_AUTOGEN_TEST(RerunRccDepends)
+ADD_AUTOGEN_TEST(RerunRccConfigChange)
diff --git a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
new file mode 100644
index 0000000..f09865d
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
@@ -0,0 +1,41 @@
+cmake_minimum_required(VERSION 3.11.2)
+project(RerunRccConfigChange)
+include("../AutogenTest.cmake")
+
+# Tests rcc rebuilding after a configuration change
+
+# Dummy executable to generate a clean target
+add_executable(dummy dummy.cpp)
+
+# When a .qrc or a file listed in a .qrc file changes,
+# the target must be rebuilt
+set(timeformat "%Y%j%H%M%S")
+set(rccDepSD "${CMAKE_CURRENT_SOURCE_DIR}/RccConfigChange")
+set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/RccConfigChange")
+
+# Initial build
+try_compile(RCC_DEPENDS
+  "${rccDepBD}"
+  "${rccDepSD}"
+  RccConfigChange
+  CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+              "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+  OUTPUT_VARIABLE output
+)
+if (NOT RCC_DEPENDS)
+  message(SEND_ERROR "Initial build of rccConfigChange failed. Output: ${output}")
+endif()
+
+# - Rebuild Release
+message("Rebuilding rccConfigChange in Release configuration")
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . --config Release WORKING_DIRECTORY "${rccDepBD}" RESULT_VARIABLE result)
+if (result)
+  message(SEND_ERROR "Release build of rccConfigChange failed.")
+endif()
+
+# - Rebuild Debug
+message("Rebuilding rccConfigChange in Debug configuration")
+execute_process(COMMAND "${CMAKE_COMMAND}" --build . --config Debug WORKING_DIRECTORY "${rccDepBD}" RESULT_VARIABLE result)
+if (result)
+  message(SEND_ERROR "Debug build of rccConfigChange failed.")
+endif()
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
new file mode 100644
index 0000000..3cddf5c
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 3.11.2)
+project(RccConfigChange)
+include("../../AutogenTest.cmake")
+
+# Enable AUTORCC for all targets
+set(CMAKE_AUTORCC ON)
+
+# Initial resource files setup
+configure_file(resGen/input1.txt.in resGen/input1.txt COPYONLY)
+configure_file(resGen/input2.txt.in resGen/input2.txt COPYONLY)
+configure_file(resGen.qrc.in resGen.qrc COPYONLY)
+
+# Generated qrc file with dependency
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc
+  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resGen.qrc.in
+  COMMAND ${CMAKE_COMMAND} -E sleep 2
+  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc
+)
+
+# Target that uses a plain .qrc file
+add_executable(rccConfigChangePlain main.cpp resPlain.qrc)
+target_link_libraries(rccConfigChangePlain ${QT_QTCORE_TARGET})
+
+# Target that uses a GENERATED .qrc file
+add_executable(rccConfigChangeGen main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc )
+target_link_libraries(rccConfigChangeGen ${QT_QTCORE_TARGET})
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/main.cpp b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/main.cpp
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/main.cpp
@@ -0,0 +1,5 @@
+
+int main()
+{
+  return 0;
+}
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in
new file mode 100644
index 0000000..9674772
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/TextsGenerated">
+        <file>resGen/input1.txt</file>
+        <file>resGen/input2.txt</file>
+    </qresource>
+</RCC>
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in
new file mode 100644
index 0000000..4f24589
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in
@@ -0,0 +1 @@
+Generated resource input.
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in
new file mode 100644
index 0000000..4f24589
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in
@@ -0,0 +1 @@
+Generated resource input.
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc
new file mode 100644
index 0000000..e448726
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/TextsPlain">
+        <file>resPlain/input1.txt</file>
+        <file>resPlain/input2.txt</file>
+    </qresource>
+</RCC>
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt
new file mode 100644
index 0000000..03969c6
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt
@@ -0,0 +1 @@
+Plain resource input.
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt
new file mode 100644
index 0000000..03969c6
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt
@@ -0,0 +1 @@
+Plain resource input.
diff --git a/Tests/QtAutogen/RerunRccConfigChange/dummy.cpp b/Tests/QtAutogen/RerunRccConfigChange/dummy.cpp
new file mode 100644
index 0000000..4837a76
--- /dev/null
+++ b/Tests/QtAutogen/RerunRccConfigChange/dummy.cpp
@@ -0,0 +1,5 @@
+
+int main(int argv, char** args)
+{
+  return 0;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41685c8ba0902cff1241886d966e796cecb82ae3
commit 41685c8ba0902cff1241886d966e796cecb82ae3
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed May 30 17:23:23 2018 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed May 30 17:45:01 2018 +0200

    Autogen: Let AUTORCC generate output for all configurations
    
    For multi configuration generators let AUTORCC generate
    the rcc output for all configurations.  This is a workaround
    for the incomplete `$<CONFIG>` support in the DEPENDS and OUTPUT
    clauses of a custom_command/custom_target.  Since we can't depend
    on the per-config rcc output file we somehow must ensure the successful
    rcc build for one configuration doesn't shadow the need to rcc rebuild
    for a second configuration.
    
    Closes #18006

diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 59f4eb8..d59f3a7 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -628,14 +628,26 @@ void cmQtAutoGenInitializer::InitCustomTargets()
 
       std::vector<std::string> ccOutput;
       ccOutput.push_back(qrc.RccFile);
+
       cmCustomCommandLines commandLines;
-      {
+      if (this->MultiConfig) {
+        // Build for all configurations
+        for (std::string const& config : this->ConfigsList) {
+          cmCustomCommandLine currentLine;
+          currentLine.push_back(cmSystemTools::GetCMakeCommand());
+          currentLine.push_back("-E");
+          currentLine.push_back("cmake_autorcc");
+          currentLine.push_back(qrc.InfoFile);
+          currentLine.push_back(config);
+          commandLines.push_back(std::move(currentLine));
+        }
+      } else {
         cmCustomCommandLine currentLine;
         currentLine.push_back(cmSystemTools::GetCMakeCommand());
         currentLine.push_back("-E");
         currentLine.push_back("cmake_autorcc");
         currentLine.push_back(qrc.InfoFile);
-        currentLine.push_back("$<CONFIGURATION>");
+        currentLine.push_back("$<CONFIG>");
         commandLines.push_back(std::move(currentLine));
       }
       std::string ccComment = "Automatic RCC for ";

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2930a198f610e729d73df6771d70119adac6df2e
commit 2930a198f610e729d73df6771d70119adac6df2e
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed May 30 16:34:09 2018 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed May 30 17:45:01 2018 +0200

    Autogen: Add lock file to AUTORCC commands
    
    By using a per .qrc lock file in AUTORCC, the same
    `cmake -E cmake_autorcc ...` command can be called concurrently.

diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 566a2a9..59f4eb8 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -588,8 +588,13 @@ void cmQtAutoGenInitializer::InitCustomTargets()
           if (!qrc.Unique) {
             base += qrc.PathChecksum;
           }
+
+          qrc.LockFile = base;
+          qrc.LockFile += ".lock";
+
           qrc.InfoFile = base;
           qrc.InfoFile += "Info.cmake";
+
           qrc.SettingsFile = base;
           qrc.SettingsFile += "Settings.txt";
         }
@@ -1043,6 +1048,7 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
         CWrite("ARCC_RCC_LIST_OPTIONS", cmJoin(this->RccListOptions, ";"));
 
         ofs << "# Rcc job\n";
+        CWrite("ARCC_LOCK_FILE", qrc.LockFile);
         CWrite("ARCC_SOURCE", qrc.QrcFile);
         CWrite("ARCC_OUTPUT_CHECKSUM", qrc.PathChecksum);
         CWrite("ARCC_OUTPUT_NAME",
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index 2a47e46..5fbf0cb 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -32,6 +32,7 @@ public:
     }
 
   public:
+    std::string LockFile;
     std::string QrcFile;
     std::string QrcName;
     std::string PathChecksum;
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index bf184d8..750e1ed 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -367,10 +367,11 @@ bool cmQtAutoGenerator::FileSystem::FileRemove(std::string const& filename)
   return cmSystemTools::RemoveFile(filename);
 }
 
-bool cmQtAutoGenerator::FileSystem::Touch(std::string const& filename)
+bool cmQtAutoGenerator::FileSystem::Touch(std::string const& filename,
+                                          bool create)
 {
   std::lock_guard<std::mutex> lock(Mutex_);
-  return cmSystemTools::Touch(filename, false);
+  return cmSystemTools::Touch(filename, create);
 }
 
 bool cmQtAutoGenerator::FileSystem::MakeDirectory(std::string const& dirname)
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 299e4c2..4e38413 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -124,7 +124,7 @@ public:
     bool FileDiffers(std::string const& filename, std::string const& content);
 
     bool FileRemove(std::string const& filename);
-    bool Touch(std::string const& filename);
+    bool Touch(std::string const& filename, bool create = false);
 
     // -- Directory access
     bool MakeDirectory(std::string const& dirname);
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 84ec5e2..fdb556a 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -5,6 +5,7 @@
 
 #include "cmAlgorithms.h"
 #include "cmCryptoHash.h"
+#include "cmFileLockResult.h"
 #include "cmMakefile.h"
 #include "cmSystemTools.h"
 #include "cmUVHandlePtr.h"
@@ -89,6 +90,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
   RccListOptions_ = InfoGetList("ARCC_RCC_LIST_OPTIONS");
 
   // - Job
+  LockFile_ = InfoGet("ARCC_LOCK_FILE");
   QrcFile_ = InfoGet("ARCC_SOURCE");
   QrcFileName_ = cmSystemTools::GetFilenameName(QrcFile_);
   QrcFileDir_ = cmSystemTools::GetFilenamePath(QrcFile_);
@@ -101,6 +103,10 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
   SettingsFile_ = InfoGetConfig("ARCC_SETTINGS_FILE");
 
   // - Validity checks
+  if (LockFile_.empty()) {
+    Log().ErrorFile(GeneratorT::RCC, InfoFile(), "Lock file name missing");
+    return false;
+  }
   if (SettingsFile_.empty()) {
     Log().ErrorFile(GeneratorT::RCC, InfoFile(), "Settings file name missing");
     return false;
@@ -170,8 +176,11 @@ void cmQtAutoGeneratorRcc::PollStage()
   switch (Stage_) {
     // -- Initialize
     case StageT::SETTINGS_READ:
-      SettingsFileRead();
-      SetStage(StageT::TEST_QRC_RCC_FILES);
+      if (SettingsFileRead()) {
+        SetStage(StageT::TEST_QRC_RCC_FILES);
+      } else {
+        SetStage(StageT::FINISH);
+      }
       break;
 
     // -- Change detection
@@ -252,7 +261,7 @@ std::string cmQtAutoGeneratorRcc::MultiConfigOutput() const
   return res;
 }
 
-void cmQtAutoGeneratorRcc::SettingsFileRead()
+bool cmQtAutoGeneratorRcc::SettingsFileRead()
 {
   // Compose current settings strings
   {
@@ -278,21 +287,51 @@ void cmQtAutoGeneratorRcc::SettingsFileRead()
     }
   }
 
+  // Make sure the settings file exists
+  if (!FileSys().FileExists(SettingsFile_, true)) {
+    // Touch the settings file to make sure it exists
+    FileSys().Touch(SettingsFile_, true);
+  }
+
+  // Lock the lock file
+  {
+    // Make sure the lock file exists
+    if (!FileSys().FileExists(LockFile_, true)) {
+      if (!FileSys().Touch(LockFile_, true)) {
+        Log().ErrorFile(GeneratorT::RCC, LockFile_,
+                        "Lock file creation failed");
+        Error_ = true;
+        return false;
+      }
+    }
+    // Lock the lock file
+    cmFileLockResult lockResult =
+      LockFileLock_.Lock(LockFile_, static_cast<unsigned long>(-1));
+    if (!lockResult.IsOk()) {
+      Log().ErrorFile(GeneratorT::RCC, LockFile_,
+                      "File lock failed: " + lockResult.GetOutputMessage());
+      Error_ = true;
+      return false;
+    }
+  }
+
   // Read old settings
   {
     std::string content;
     if (FileSys().FileRead(content, SettingsFile_)) {
       SettingsChanged_ = (SettingsString_ != SettingsFind(content, "rcc"));
-      // In case any setting changed remove the old settings file.
+      // In case any setting changed clear the old settings file.
       // This triggers a full rebuild on the next run if the current
       // build is aborted before writing the current settings in the end.
       if (SettingsChanged_) {
-        FileSys().FileRemove(SettingsFile_);
+        FileSys().FileWrite(GeneratorT::RCC, SettingsFile_, "");
       }
     } else {
       SettingsChanged_ = true;
     }
   }
+
+  return true;
 }
 
 void cmQtAutoGeneratorRcc::SettingsFileWrite()
@@ -315,6 +354,9 @@ void cmQtAutoGeneratorRcc::SettingsFileWrite()
       Error_ = true;
     }
   }
+
+  // Unlock the lock file
+  LockFileLock_.Release();
 }
 
 bool cmQtAutoGeneratorRcc::TestQrcRccFiles()
diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h
index 55e0998..74cec36 100644
--- a/Source/cmQtAutoGeneratorRcc.h
+++ b/Source/cmQtAutoGeneratorRcc.h
@@ -5,6 +5,7 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
+#include "cmFileLock.h"
 #include "cmQtAutoGenerator.h"
 #include "cm_uv.h"
 
@@ -48,7 +49,7 @@ private:
   void PollStage();
   void SetStage(StageT stage);
   // -- Settings file
-  void SettingsFileRead();
+  bool SettingsFileRead();
   void SettingsFileWrite();
   // -- Tests
   bool TestQrcRccFiles();
@@ -77,6 +78,8 @@ private:
   std::string RccExecutable_;
   std::vector<std::string> RccListOptions_;
   // -- Job
+  std::string LockFile_;
+  cmFileLock LockFileLock_;
   std::string QrcFile_;
   std::string QrcFileName_;
   std::string QrcFileDir_;

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/alsa-target.rst                   |    4 ++
 Modules/FindALSA.cmake                             |   39 +++++++++++----
 Source/cmQtAutoGenInitializer.cxx                  |   22 ++++++++-
 Source/cmQtAutoGenInitializer.h                    |    1 +
 Source/cmQtAutoGenerator.cxx                       |    5 +-
 Source/cmQtAutoGenerator.h                         |    2 +-
 Source/cmQtAutoGeneratorRcc.cxx                    |   52 ++++++++++++++++++--
 Source/cmQtAutoGeneratorRcc.h                      |    5 +-
 Templates/TestDriver.cxx.in                        |    4 +-
 Tests/CMakeLists.txt                               |    4 ++
 Tests/{FindICU => FindALSA}/CMakeLists.txt         |    8 +--
 Tests/FindALSA/Test/CMakeLists.txt                 |   16 ++++++
 Tests/FindALSA/Test/main.c                         |   10 ++++
 Tests/QtAutogen/CommonTests.cmake                  |    1 +
 .../QtAutogen/RerunRccConfigChange/CMakeLists.txt  |   41 +++++++++++++++
 .../RccConfigChange/CMakeLists.txt                 |   26 ++++++++++
 .../RccConfigChange}/main.cpp                      |    0
 .../RccConfigChange/resGen.qrc.in                  |    6 +++
 .../RccConfigChange/resGen/input1.txt.in}          |    0
 .../RccConfigChange/resGen/input2.txt.in}          |    0
 .../RccConfigChange/resPlain.qrc                   |    6 +++
 .../RccConfigChange/resPlain/input1.txt            |    1 +
 .../RccConfigChange/resPlain/input2.txt            |    1 +
 .../dummy.cpp                                      |    0
 Utilities/Release/linux64_release.cmake            |    6 +--
 25 files changed, 231 insertions(+), 29 deletions(-)
 create mode 100644 Help/release/dev/alsa-target.rst
 copy Tests/{FindICU => FindALSA}/CMakeLists.txt (55%)
 create mode 100644 Tests/FindALSA/Test/CMakeLists.txt
 create mode 100644 Tests/FindALSA/Test/main.c
 create mode 100644 Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
 copy Tests/QtAutogen/{RerunRccDepends/RccDepends => RerunRccConfigChange/RccConfigChange}/main.cpp (100%)
 create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resGen.qrc.in
 copy Tests/QtAutogen/{RerunRccDepends/RccDepends/resGen/input.txt.in => RerunRccConfigChange/RccConfigChange/resGen/input1.txt.in} (100%)
 copy Tests/QtAutogen/{RerunRccDepends/RccDepends/resGen/input.txt.in => RerunRccConfigChange/RccConfigChange/resGen/input2.txt.in} (100%)
 create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain.qrc
 create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input1.txt
 create mode 100644 Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/resPlain/input2.txt
 copy Tests/QtAutogen/{RerunMocBasic => RerunRccConfigChange}/dummy.cpp (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list