From ff36e0a087250c46500f700b9f51be4c00bae18e Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sat, 19 May 2018 10:45:57 +0200 Subject: [PATCH] New upstream version 3.11.2 --- Help/prop_sf/COMPILE_FLAGS.rst | 10 ++- Help/prop_sf/COMPILE_OPTIONS.rst | 4 ++ Help/release/3.11.rst | 15 ++++ Modules/FindBLAS.cmake | 6 +- Modules/FindBoost.cmake | 68 +++++++++--------- Modules/FindCUDA.cmake | 4 +- Modules/FindJNI.cmake | 72 +++++++++++++++---- Modules/FindJava.cmake | 56 +++++++++++++-- Modules/FindPkgConfig.cmake | 1 - Modules/InstallRequiredSystemLibraries.cmake | 26 ++++--- Modules/Qt4Macros.cmake | 25 ++++--- Modules/UseJava.cmake | 10 +-- Source/CMakeVersion.cmake | 2 +- Source/Checks/cm_cxx_features.cmake | 3 + Source/cmAddLibraryCommand.cxx | 8 +++ Source/cmCustomCommandGenerator.cxx | 8 +++ .../cmGeneratorExpressionEvaluationFile.cxx | 6 ++ Source/cmMakefile.cxx | 3 +- Source/cmNinjaTargetGenerator.cxx | 4 +- Source/cmQtAutoGenInitializer.cxx | 3 + .../CommandExpandsEmpty.cmake | 1 + .../add_custom_target/RunCMakeTest.cmake | 1 + .../alias_targets/imported-target-stderr.txt | 10 ++- Utilities/cmlibuv/src/unix/internal.h | 2 +- 24 files changed, 262 insertions(+), 86 deletions(-) create mode 100644 Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake diff --git a/Help/prop_sf/COMPILE_FLAGS.rst b/Help/prop_sf/COMPILE_FLAGS.rst index be81cf60a..c211b89ac 100644 --- a/Help/prop_sf/COMPILE_FLAGS.rst +++ b/Help/prop_sf/COMPILE_FLAGS.rst @@ -3,9 +3,9 @@ COMPILE_FLAGS Additional flags to be added when compiling this source file. -The ``COMPILE_FLAGS`` property sets additional compiler flags used to build -source files. Use :prop_sf:`COMPILE_DEFINITIONS` to pass additional -preprocessor definitions. +The ``COMPILE_FLAGS`` property, managed as a string, sets additional compiler +flags used to build source files. Use :prop_sf:`COMPILE_DEFINITIONS` to pass +additional preprocessor definitions. Contents of ``COMPILE_FLAGS`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` @@ -13,3 +13,7 @@ manual for available expressions. However, :generator:`Xcode` does not support per-config per-source settings, so expressions that depend on the build configuration are not allowed with that generator. + +.. note:: + + This property has been superseded by the :prop_sf:`COMPILE_OPTIONS` property. diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst index 157c0b0e8..3b2bc8da2 100644 --- a/Help/prop_sf/COMPILE_OPTIONS.rst +++ b/Help/prop_sf/COMPILE_OPTIONS.rst @@ -15,3 +15,7 @@ for available expressions. However, :generator:`Xcode` does not support per-config per-source settings, so expressions that depend on the build configuration are not allowed with that generator. + +.. note:: + + This property should be preferred over the :prop_sf:`COMPILE_FLAGS` property. diff --git a/Help/release/3.11.rst b/Help/release/3.11.rst index dbaa8af4d..971b3e2ba 100644 --- a/Help/release/3.11.rst +++ b/Help/release/3.11.rst @@ -283,3 +283,18 @@ Changes made since CMake 3.11.0 include the following. CMake 3.11.0. This has been reverted due to changing behavior of checks for existing projects. It may be restored in the future with a policy for compatibility. + +3.11.2 +------ + +* Calling :command:`add_library` to create an alias of an imported + target that is not globally visible now causes an error again as + it did prior to 3.11.0. This diagnostic was accidentally dropped + from CMake 3.11.0 and 3.11.1 by the change to allow globally visible + imported targets to be aliased. + +* The :module:`FindQt4` module ``qt4_wrap_cpp``, ``qt4_wrap_ui`` and + ``qt4_add_resources`` macros now set :prop_sf:`SKIP_AUTOMOC` and + :prop_sf:`SKIP_AUTOUIC` on their generated files. These files never + need to be processed by moc or uic, and we must say so explicitly to + account for policy :policy:`CMP0071`. diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 8e8c6f4f2..5223b1d0b 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -90,7 +90,11 @@ if(BLA_PREFER_PKGCONFIG) find_package(PkgConfig) pkg_check_modules(PKGC_BLAS IMPORTED_TARGET blas) if(PKGC_BLAS_FOUND) - set(BLAS_LIBRARIES PkgConfig::PKGC_BLAS) + # FIXME: We should not interpret the INTERFACE_LINK_LIBRARIES property + # because it could have generator expressions and such. This is a + # workaround for pkg_check_modules not providing a first-class way to + # get the list of libraries. + get_property(BLAS_LIBRARIES TARGET PkgConfig::PKGC_BLAS PROPERTY INTERFACE_LINK_LIBRARIES) find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS_LIBRARIES VERSION_VAR PKGC_BLAS_VERSION) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 8d44aee0b..1771d1bc0 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -595,7 +595,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_FILESYSTEM_DEPENDENCIES system) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_WAVE_DEPENDENCIES filesystem system thread) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800) @@ -603,7 +603,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_WAVE_DEPENDENCIES filesystem system thread) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300) @@ -611,7 +611,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES date_time) set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) @@ -620,7 +620,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES date_time) set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) @@ -629,7 +629,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES date_time) set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) @@ -638,7 +638,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES date_time) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) @@ -648,7 +648,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES date_time) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) @@ -658,7 +658,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES date_time) set(_Boost_TIMER_DEPENDENCIES chrono system) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time) @@ -669,7 +669,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES chrono system date_time) set(_Boost_TIMER_DEPENDENCIES chrono system) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time) @@ -681,7 +681,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_IOSTREAMS_DEPENDENCIES regex) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_TIMER_DEPENDENCIES chrono system) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time) @@ -694,7 +694,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_TIMER_DEPENDENCIES chrono system) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) @@ -707,7 +707,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_TIMER_DEPENDENCIES chrono system) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) @@ -720,7 +720,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_RANDOM_DEPENDENCIES system) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_TIMER_DEPENDENCIES chrono system) @@ -734,7 +734,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_RANDOM_DEPENDENCIES system) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_TIMER_DEPENDENCIES chrono system) @@ -748,7 +748,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_RANDOM_DEPENDENCIES system) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_TIMER_DEPENDENCIES chrono system) @@ -763,7 +763,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_RANDOM_DEPENDENCIES system) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) @@ -778,7 +778,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_RANDOM_DEPENDENCIES system) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) @@ -794,28 +794,28 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) set(_Boost_RANDOM_DEPENDENCIES system) set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) elseif(NOT Boost_VERSION VERSION_LESS 106500 AND Boost_VERSION VERSION_LESS 106700) - set(_Boost_CHRONO_DEPENDENCIES system) - set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time) - set(_Boost_COROUTINE_DEPENDENCIES context system) - set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time) - set(_Boost_FILESYSTEM_DEPENDENCIES system) - set(_Boost_IOSTREAMS_DEPENDENCIES regex) - set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) - set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) - set(_Boost_MPI_DEPENDENCIES serialization) - set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization) - set(_Boost_NUMPY_DEPENDENCIES python) - set(_Boost_RANDOM_DEPENDENCIES system) - set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) - set(_Boost_TIMER_DEPENDENCIES chrono system) - set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) - set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + set(_Boost_CHRONO_DEPENDENCIES system) + set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time) + set(_Boost_COROUTINE_DEPENDENCIES context system) + set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time) + set(_Boost_FILESYSTEM_DEPENDENCIES system) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) + set(_Boost_NUMPY_DEPENDENCIES python${component_python_version}) + set(_Boost_RANDOM_DEPENDENCIES system) + set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic) + set(_Boost_TIMER_DEPENDENCIES chrono system) + set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) else() if(NOT Boost_VERSION VERSION_LESS 106700) set(_Boost_CHRONO_DEPENDENCIES system) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 0a31ac2b9..e3cb4fe61 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1760,7 +1760,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options add_custom_command( OUTPUT ${output_file} DEPENDS ${object_files} - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} ${CUDA_cublas_device_LIBRARY} -o ${output_file} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} ${flags} COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" COMMAND_EXPAND_LISTS @@ -1773,7 +1773,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options PRE_LINK COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} ${CUDA_cublas_device_LIBRARY} -o "${output_file}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" COMMAND_EXPAND_LISTS ${_verbatim} ) diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index e31c19e10..4913e05e7 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -120,14 +120,51 @@ if(_JAVA_HOME) ${_JAVA_HOME} ) endif() -get_filename_component(java_install_version - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME) -list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib" - ) +if (WIN32) + set (_JNI_HINTS) + execute_process(COMMAND REG QUERY HKLM\\SOFTWARE\\JavaSoft\\JDK /f "." /k + RESULT_VARIABLE _JNI_RESULT + OUTPUT_VARIABLE _JNI_VERSIONS + ERROR_QUIET) + if (NOT _JNI_RESULT) + string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\JDK\\\\[0-9.]+" _JNI_VERSIONS "${_JNI_VERSIONS}") + if (_JNI_VERSIONS) + # sort versions. Most recent first + ## handle version 9 apart from other versions to get correct ordering + set (_JNI_V9 ${_JNI_VERSIONS}) + list (FILTER _JNI_VERSIONS EXCLUDE REGEX "JDK\\\\9") + list (SORT _JNI_VERSIONS) + list (REVERSE _JNI_VERSIONS) + list (FILTER _JNI_V9 INCLUDE REGEX "JDK\\\\9") + list (SORT _JNI_V9) + list (REVERSE _JNI_V9) + list (APPEND _JNI_VERSIONS ${_JNI_V9}) + foreach (_JNI_HINT IN LISTS _JNI_VERSIONS) + list(APPEND _JNI_HINTS "[${_JNI_HINT};JavaHome]") + endforeach() + endif() + endif() + + foreach (_JNI_HINT IN LISTS _JNI_HINTS) + list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES "${_JNI_HINT}/lib") + endforeach() + + get_filename_component(java_install_version + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME) + + list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib" + ) +endif() + JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES /usr/lib/jvm/java/lib /usr/lib/java/jre/lib/{libarch} @@ -179,11 +216,21 @@ set(JAVA_AWT_INCLUDE_DIRECTORIES) if(_JAVA_HOME) list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES ${_JAVA_HOME}/include) endif() -list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include" -) +if (WIN32) + foreach (_JNI_HINT IN LISTS _JNI_HINTS) + list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES "${_JNI_HINT}/include") + endforeach() + list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include" + ) +endif() JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES /usr/lib/java/include @@ -330,4 +377,3 @@ set(JNI_INCLUDE_DIRS ${JAVA_INCLUDE_PATH2} ${JAVA_AWT_INCLUDE_PATH} ) - diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index e3f5af6c6..306f35d34 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -77,8 +77,37 @@ set(_JAVA_HINTS) if(_JAVA_HOME) list(APPEND _JAVA_HINTS ${_JAVA_HOME}/bin) endif() -list(APPEND _JAVA_HINTS - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin" +if (WIN32) + macro (_JAVA_GET_INSTALLED_VERSIONS _KIND) + execute_process(COMMAND REG QUERY HKLM\\SOFTWARE\\JavaSoft\\${_KIND} /f "." /k + RESULT_VARIABLE _JAVA_RESULT + OUTPUT_VARIABLE _JAVA_VERSIONS + ERROR_QUIET) + if (NOT _JAVA_RESULT) + string (REGEX MATCHALL "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\JavaSoft\\\\${_KIND}\\\\[0-9.]+" _JAVA_VERSIONS "${_JAVA_VERSIONS}") + if (_JAVA_VERSIONS) + # sort versions. Most recent first + ## handle version 9 apart from other versions to get correct ordering + set (_JAVA_V9 ${_JAVA_VERSIONS}) + list (FILTER _JAVA_VERSIONS EXCLUDE REGEX "${_KIND}\\\\9") + list (SORT _JAVA_VERSIONS) + list (REVERSE _JAVA_VERSIONS) + list (FILTER _JAVA_V9 INCLUDE REGEX "${_KIND}\\\\9") + list (SORT _JAVA_V9) + list (REVERSE _JAVA_V9) + list (APPEND _JAVA_VERSIONS ${_JAVA_V9}) + foreach (_JAVA_HINT IN LISTS _JAVA_VERSIONS) + list(APPEND _JAVA_HINTS "[${_JAVA_HINT};JavaHome]/bin") + endforeach() + endif() + endif() + endmacro() + + # search for installed versions for version 9 and upper + _JAVA_GET_INSTALLED_VERSIONS("JDK") + _JAVA_GET_INSTALLED_VERSIONS("JRE") + + list(APPEND _JAVA_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin" @@ -86,7 +115,6 @@ list(APPEND _JAVA_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\2.0;JavaHome]/bin" "[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" @@ -95,6 +123,8 @@ list(APPEND _JAVA_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.4;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment\\1.3;JavaHome]/bin" ) +endif() + # Hard-coded guesses should still go in PATHS. This ensures that the user # environment can always override hard guesses. set(_JAVA_PATHS @@ -139,15 +169,31 @@ if(Java_JAVA_EXECUTABLE) # Sun, GCJ, older OpenJDK set(Java_VERSION_STRING "${CMAKE_MATCH_1}") set(Java_VERSION_MAJOR "${CMAKE_MATCH_2}") + if (CMAKE_MATCH_4) set(Java_VERSION_MINOR "${CMAKE_MATCH_4}") + else() + set(Java_VERSION_MINOR 0) + endif() + if (CMAKE_MATCH_6) set(Java_VERSION_PATCH "${CMAKE_MATCH_6}") + else() + set(Java_VERSION_PATCH 0) + endif() set(Java_VERSION_TWEAK "${CMAKE_MATCH_8}") elseif(var MATCHES "openjdk version \"${_java_version_regex}\"") # OpenJDK set(Java_VERSION_STRING "${CMAKE_MATCH_1}") set(Java_VERSION_MAJOR "${CMAKE_MATCH_2}") + if (CMAKE_MATCH_4) set(Java_VERSION_MINOR "${CMAKE_MATCH_4}") + else() + set(Java_VERSION_MINOR 0) + endif() + if (CMAKE_MATCH_6) set(Java_VERSION_PATCH "${CMAKE_MATCH_6}") + else() + set(Java_VERSION_PATCH 0) + endif() set(Java_VERSION_TWEAK "${CMAKE_MATCH_8}") elseif(var MATCHES "openjdk version \"([0-9]+)-[A-Za-z]+\"") # OpenJDK 9 early access builds or locally built @@ -238,7 +284,7 @@ if(Java_FIND_COMPONENTS) elseif(component STREQUAL "Development") list(APPEND _JAVA_REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVADOC_EXECUTABLE) - if(Java_VERSION VERSION_LESS "1.10") + if(Java_VERSION VERSION_LESS "10") list(APPEND _JAVA_REQUIRED_VARS Java_JAVAH_EXECUTABLE) if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAVAH_EXECUTABLE AND Java_JAVADOC_EXECUTABLE) @@ -276,7 +322,7 @@ if(Java_FIND_COMPONENTS) endif() else() # Check for Development - if(Java_VERSION VERSION_LESS "1.10") + if(Java_VERSION VERSION_LESS "10") find_package_handle_standard_args(Java REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 952ca9265..415e91429 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -222,7 +222,6 @@ function(_pkg_create_imp_target _prefix _no_cmake_path _no_cmake_environment_pat AND ( ${_prefix}_INCLUDE_DIRS OR _libs OR ${_prefix}_CFLAGS_OTHER )) add_library(PkgConfig::${_prefix} INTERFACE IMPORTED) - unset(_props) if(${_prefix}_INCLUDE_DIRS) set_property(TARGET PkgConfig::${_prefix} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_prefix}_INCLUDE_DIRS}") diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 797f9e4b7..88e0f38b6 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -481,6 +481,10 @@ if(MSVC) if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll") set(__install__libs ${__install__libs} "${MSVC_MFC_DIR}/mfc${v}d.dll" + ) + endif() + if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll") + set(__install__libs ${__install__libs} "${MSVC_MFC_DIR}/mfcm${v}d.dll" ) endif() @@ -495,6 +499,10 @@ if(MSVC) if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll") set(__install__libs ${__install__libs} "${MSVC_MFC_DIR}/mfc${v}.dll" + ) + endif() + if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll") + set(__install__libs ${__install__libs} "${MSVC_MFC_DIR}/mfcm${v}.dll" ) endif() @@ -621,8 +629,10 @@ if(_IRSL_HAVE_Intel) foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() - if(_Intel_compiler_ver VERSION_LESS 17) - list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib") + if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + if(_Intel_compiler_ver VERSION_LESS 17) + list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib") + endif() endif() if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib) @@ -631,8 +641,7 @@ if(_IRSL_HAVE_Intel) endforeach() endif() else() - set(__install_dirs "${_Intel_redistdir}/irml") - foreach(__Intel_lib IN ITEMS cilk_db.so libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so) + foreach(__Intel_lib IN ITEMS libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() @@ -642,10 +651,11 @@ if(_IRSL_HAVE_Intel) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() endif() - if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15) - list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so") - if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) - list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.so") + if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + set(__install_dirs "${_Intel_redistdir}/irml") + list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so") + if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15) + list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so") endif() endif() if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index aee40288f..a2c8d853c 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -151,7 +151,8 @@ macro (QT4_GENERATE_MOC infile outfile ) set(moc_target ${ARGV3}) endif() QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}") - set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file endmacro () @@ -166,6 +167,8 @@ macro (QT4_WRAP_CPP outfiles ) get_filename_component(it ${it} ABSOLUTE) QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile) QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}") + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file set(${outfiles} ${${outfiles}} ${outfile}) endforeach() @@ -185,6 +188,8 @@ macro (QT4_WRAP_UI outfiles ) COMMAND Qt4::uic ARGS ${ui_options} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} VERBATIM) + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file set(${outfiles} ${${outfiles}} ${outfile}) endforeach () @@ -233,6 +238,8 @@ macro (QT4_ADD_RESOURCES outfiles ) ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM) + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file set(${outfiles} ${${outfiles}} ${outfile}) endforeach () @@ -245,19 +252,19 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp") set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc") - get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE) + get_property(_nonamespace SOURCE ${_interface} PROPERTY NO_NAMESPACE) if(_nonamespace) set(_params -N -m) else() set(_params -m) endif() - get_source_file_property(_classname ${_interface} CLASSNAME) + get_property(_classname SOURCE ${_interface} PROPERTY CLASSNAME) if(_classname) set(_params ${_params} -c ${_classname}) endif() - get_source_file_property(_include ${_interface} INCLUDE) + get_property(_include SOURCE ${_interface} PROPERTY INCLUDE) if(_include) set(_params ${_params} -i ${_include}) endif() @@ -266,7 +273,8 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) COMMAND Qt4::qdbusxml2cpp ${_params} -p ${_basename} ${_infile} DEPENDS ${_infile} VERBATIM) - set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) + set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file QT4_GENERATE_MOC("${_header}" "${_moc}") @@ -350,7 +358,8 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional endif() QT4_GENERATE_MOC("${_header}" "${_moc}") - set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) + set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file + set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") @@ -374,7 +383,7 @@ macro(QT4_AUTOMOC) # cmake is run for the very first time on them -> however the .cpp files might # exist at a later run. at that time we need to skip them, so that we don't add two # different rules for the same moc file - get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC) + get_property(_skip SOURCE ${_abs_FILE} PROPERTY SKIP_AUTOMOC) if ( NOT _skip AND EXISTS ${_abs_FILE} ) @@ -454,7 +463,7 @@ macro(QT4_ADD_TRANSLATION _qm_files) foreach (_current_FILE ${ARGN}) get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) get_filename_component(qm ${_abs_FILE} NAME_WE) - get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION) + get_property(output_location SOURCE ${_abs_FILE} PROPERTY OUTPUT_LOCATION) if(output_location) file(MAKE_DIRECTORY "${output_location}") set(qm "${output_location}/${qm}.qm") diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 939bd7be7..d7b720ec4 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -384,7 +384,7 @@ # Create C header files from java classes. These files provide the connective glue # that allow your Java and C code to interact. # -# This command will no longer be supported starting with version 1.10 of the JDK due +# This command will no longer be supported starting with version 10 of the JDK due # to the `suppression of javah tool `_. # Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead. # @@ -527,7 +527,7 @@ function(add_jar _TARGET_NAME) if (_add_jar_GENERATE_NATIVE_HEADERS) # Raise an error if JDK version is less than 1.8 because javac -h is not supported # by earlier versions. - if ("${Java_VERSION}" VERSION_LESS 1.8) + if (Java_VERSION VERSION_LESS 1.8) message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.") endif() cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS}) @@ -1312,10 +1312,10 @@ function(create_javadoc _target) endfunction() function (create_javah) - if ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.10) + if (Java_VERSION VERSION_GREATER_EQUAL 10) message (FATAL_ERROR "create_javah: not supported with this Java version. Use add_jar(GENERATE_NATIVE_HEADERS) instead.") - elseif ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.8) - message (DEPRECATION "create_javah: this command will no longer be supported starting with version 1.10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.") + elseif (Java_VERSION VERSION_GREATER_EQUAL 1.8) + message (DEPRECATION "create_javah: this command will no longer be supported starting with version 10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.") endif() cmake_parse_arguments(_create_javah diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b69c12586..260070680 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 11) -set(CMake_VERSION_PATCH 1) +set(CMake_VERSION_PATCH 2) #set(CMake_VERSION_RC 0) diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 2704c4032..2a1abbab6 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -19,6 +19,9 @@ function(cm_check_cxx_feature name) string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}") # Filter out warnings caused by user flags. string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") + # Filter out warnings caused by local configuration. + string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}") + string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}") # If using the feature causes warnings, treat it as broken/unavailable. if(check_output MATCHES "[Ww]arning") set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE) diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 1278232ac..779223501 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -228,6 +228,14 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, this->SetError(e.str()); return false; } + if (aliasedTarget->IsImported() && + !aliasedTarget->IsImportedGloballyVisible()) { + std::ostringstream e; + e << "cannot create ALIAS target \"" << libName << "\" because target \"" + << aliasedName << "\" is imported but not globally visible."; + this->SetError(e.str()); + return false; + } this->Makefile->AddAlias(libName, aliasedName); return true; } diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 136cf39be..6c9f9d6f4 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -40,6 +40,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, argv.push_back(std::move(parsed_arg)); } } + + // Later code assumes at least one entry exists, but expanding + // lists on an empty command may have left this empty. + // FIXME: Should we define behavior for removing empty commands? + if (argv.empty()) { + argv.push_back(std::string()); + } + this->CommandLines.push_back(std::move(argv)); } diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index c54414193..99b926126 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -105,8 +105,14 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile( lg, config, false, nullptr, nullptr, nullptr, le); cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource( name, false, cmSourceFileLocationKind::Known); + // Tell TraceDependencies that the file is not expected to exist + // on disk yet. We generate it after that runs. sf->SetProperty("GENERATED", "1"); + // Tell the build system generators that there is no build rule + // to generate the file. + sf->SetProperty("__CMAKE_GENERATED_BY_CMAKE", "1"); + gg->SetFilenameTargetDepends( sf, this->OutputFileExpr->GetSourceSensitiveTargets()); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 71359a271..604ca2ca5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2304,7 +2304,8 @@ bool cmMakefile::CanIWriteThisFile(std::string const& fileName) const } return !cmSystemTools::IsSubDirectory(fileName, this->GetHomeDirectory()) || - cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory()); + cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory()) || + cmSystemTools::SameFile(fileName, this->GetHomeOutputDirectory()); } const char* cmMakefile::GetRequiredDefinition(const std::string& name) const diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index f4faf47a2..a6a3efbfb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -896,7 +896,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( // (either attached to this source file or another one), assume that one of // the target dependencies, OBJECT_DEPENDS or header file custom commands // will rebuild the file. - if (source->GetPropertyAsBool("GENERATED") && !source->GetCustomCommand() && + if (source->GetPropertyAsBool("GENERATED") && + !source->GetPropertyAsBool("__CMAKE_GENERATED_BY_CMAKE") && + !source->GetCustomCommand() && !this->GetGlobalGenerator()->HasCustomCommandOutput(sourceFileName)) { this->GetGlobalGenerator()->AddAssumedSourceDependencies(sourceFileName, orderOnlyDeps); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 93c78b5bd..566a2a98e 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -994,6 +994,9 @@ void cmQtAutoGenInitializer::SetupCustomTargets() // Generate auto RCC info files if (this->RccEnabled) { for (Qrc const& qrc : this->Qrcs) { + // Register rcc info file as generated + makefile->AddCMakeOutputFile(qrc.InfoFile); + cmGeneratedFileStream ofs; ofs.SetCopyIfDifferent(true); ofs.Open(qrc.InfoFile.c_str(), false, true); diff --git a/Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake b/Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake new file mode 100644 index 000000000..bc899a4d2 --- /dev/null +++ b/Tests/RunCMake/add_custom_target/CommandExpandsEmpty.cmake @@ -0,0 +1 @@ +add_custom_target(EmptyCustom COMMAND "" COMMAND_EXPAND_LISTS) diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake index 6c4e91bca..2caed0328 100644 --- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(CommandExpandsEmpty) run_cmake(NoArguments) run_cmake(BadTargetName) run_cmake(ByproductsNoCommand) diff --git a/Tests/RunCMake/alias_targets/imported-target-stderr.txt b/Tests/RunCMake/alias_targets/imported-target-stderr.txt index 12ffbc2f5..465de0362 100644 --- a/Tests/RunCMake/alias_targets/imported-target-stderr.txt +++ b/Tests/RunCMake/alias_targets/imported-target-stderr.txt @@ -3,7 +3,13 @@ \"test-exe\" is imported but not globally visible. Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) - - ++ 'alias-test-exe' does not exist![?] +* +CMake Error at imported-target.cmake:[0-9]+ \(add_library\): + add_library cannot create ALIAS target "alias-test-lib" because target + "test-lib" is imported but not globally visible. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ 'alias-test-lib' does not exist![?]$ diff --git a/Utilities/cmlibuv/src/unix/internal.h b/Utilities/cmlibuv/src/unix/internal.h index 9cc87f0ca..668e57663 100644 --- a/Utilities/cmlibuv/src/unix/internal.h +++ b/Utilities/cmlibuv/src/unix/internal.h @@ -184,7 +184,7 @@ struct uv__stream_queued_fds_s { defined(__DragonFly__) || \ defined(__FreeBSD__) || \ defined(__FreeBSD_kernel__) || \ - defined(__linux__) || \ + (defined(__linux__) && !defined(__sparc__)) || \ defined(__OpenBSD__) || \ defined(__NetBSD__) #define uv__cloexec uv__cloexec_ioctl