diff options
-rw-r--r-- | Help/manual/cmake-qt.7.rst | 19 | ||||
-rw-r--r-- | Help/release/3.9.rst | 10 | ||||
-rw-r--r-- | Modules/CMakeCUDAInformation.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/Clang-FindBinUtils.cmake | 8 | ||||
-rw-r--r-- | Modules/FindCygwin.cmake | 13 | ||||
-rw-r--r-- | Modules/MacOSXBundleInfo.plist.in | 4 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 69 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 3 | ||||
-rw-r--r-- | Tests/QtAutogen/uicInclude/PageC2.ui | 24 | ||||
-rw-r--r-- | Tests/QtAutogen/uicInclude/dirB/PageB.ui (renamed from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/uicInclude/dirB/PageB2.ui | 24 | ||||
-rw-r--r-- | Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui | 24 | ||||
-rw-r--r-- | Tests/QtAutogen/uicInclude/main.cpp | 10 | ||||
-rw-r--r-- | Tests/QtAutogen/uicInclude/subC/PageCsub.ui | 24 |
14 files changed, 194 insertions, 42 deletions
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index 00d6e6e..b7f16b9 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -70,8 +70,8 @@ be included by the user in the C++ implementation file with a preprocessor Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the ``<AUTOGEN_BUILD_DIR>/include`` directory which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. -(This differs from CMake 3.7 and below; see their documentation for details.) +* This differs from CMake 3.7 and below; see their documentation for details. * See :prop_tgt:`AUTOGEN_BUILD_DIR`. Not included ``moc_<basename>.cpp`` files will be generated in custom @@ -107,16 +107,23 @@ inspects the C++ files in the target to determine if they require ``uic`` to be run, and to create rules to execute ``uic`` at the appropriate time. If a preprocessor ``#include`` directive is found which matches -``ui_<basename>.h``, and a ``<basename>.ui`` file exists, then ``uic`` will -be executed to generate the appropriate file. The ``<basename>.ui`` file is -searched for first in the vicinity of including file and afterwards in the -optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target. +``<path>ui_<basename>.h``, and a ``<basename>.ui`` file exists, +then ``uic`` will be executed to generate the appropriate file. +The ``<basename>.ui`` file is searched for in the following places + +1. ``<source_dir>/<basename>.ui`` +2. ``<source_dir>/<path><basename>.ui`` +3. ``<AUTOUIC_SEARCH_PATHS>/<basename>.ui`` +4. ``<AUTOUIC_SEARCH_PATHS>/<path><basename>.ui`` + +where ``<source_dir>`` is the directory of the C++ file and +:prop_tgt:`AUTOUIC_SEARCH_PATHS` is a list of additional search paths. The generated generated ``ui_*.h`` files are placed in the ``<AUTOGEN_BUILD_DIR>/include`` directory which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. -(This differs from CMake 3.7 and below; see their documentation for details.) +* This differs from CMake 3.7 and below; see their documentation for details. * See :prop_tgt:`AUTOGEN_BUILD_DIR`. The :prop_tgt:`AUTOUIC` target property may be pre-set for all following diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst index ae55105..5087b43 100644 --- a/Help/release/3.9.rst +++ b/Help/release/3.9.rst @@ -310,9 +310,6 @@ Other Changes in dependent targets may now compile without waiting for their targets' dependencies to link. -* On macOS, the default application bundle ``Info.plist`` file now enables - Hi-DPI support. - * On macOS, ``RPATH`` settings such as :prop_tgt:`BUILD_WITH_INSTALL_RPATH` no longer affect the ``install_name`` field. See policy :policy:`CMP0068`. @@ -333,3 +330,10 @@ Changes made since CMake 3.9.0 include the following. CMake 3.9.0 has been removed for the 3.9 series due to regressions caused by new use of ``<PackageName>_ROOT`` variables. The behavior may be re-introduced in the future in a more-compatible way. + +3.9.2 +----- + +* On macOS, the default application bundle ``Info.plist`` file no longer + enables Hi-DPI support as it did in 3.9.0 and 3.9.1. The change had + to be reverted because it broke iOS applications. diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake index 9bba847..f4609cd 100644 --- a/Modules/CMakeCUDAInformation.cmake +++ b/Modules/CMakeCUDAInformation.cmake @@ -198,11 +198,11 @@ endif() #These are used when linking relocatable (dc) cuda code if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY) set(CMAKE_CUDA_DEVICE_LINK_LIBRARY - "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") + "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") endif() if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE) set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE - "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") + "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") endif() unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS) diff --git a/Modules/Compiler/Clang-FindBinUtils.cmake b/Modules/Compiler/Clang-FindBinUtils.cmake index e2822a1..b852660 100644 --- a/Modules/Compiler/Clang-FindBinUtils.cmake +++ b/Modules/Compiler/Clang-FindBinUtils.cmake @@ -2,6 +2,12 @@ if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set") endif() +# Debian: +# * /usr/bin/llvm-ar-4.0 +# * /usr/bin/llvm-ranlib-4.0 +string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y + "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}") + # Try to find tools in the same directory as Clang itself get_filename_component(__clang_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH) get_filename_component(__clang_hint_1 "${__clang_hint_1}" DIRECTORY) @@ -12,6 +18,7 @@ set(__clang_hints ${__clang_hint_1} ${__clang_hint_2}) # http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ar.1.html find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES + "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar" HINTS ${__clang_hints} DOC "LLVM archiver" @@ -20,6 +27,7 @@ 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 + "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib" HINTS ${__clang_hints} DOC "Generate index for LLVM archive" diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake index b2ed703..c6913da 100644 --- a/Modules/FindCygwin.cmake +++ b/Modules/FindCygwin.cmake @@ -8,14 +8,17 @@ # this module looks for Cygwin if (WIN32) - find_program(CYGWIN_INSTALL_PATH + if(CYGWIN_INSTALL_PATH) + set(CYGWIN_BAT "${CYGWIN_INSTALL_PATH}/cygwin.bat") + endif() + + find_program(CYGWIN_BAT cygwin.bat "C:/Cygwin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]" ) - get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_INSTALL_PATH}" DIRECTORY) - mark_as_advanced( - CYGWIN_INSTALL_PATH - ) + get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_BAT}" DIRECTORY) + mark_as_advanced(CYGWIN_BAT) + endif () diff --git a/Modules/MacOSXBundleInfo.plist.in b/Modules/MacOSXBundleInfo.plist.in index e06b17e..a4009bc 100644 --- a/Modules/MacOSXBundleInfo.plist.in +++ b/Modules/MacOSXBundleInfo.plist.in @@ -30,9 +30,5 @@ <true/> <key>NSHumanReadableCopyright</key> <string>${MACOSX_BUNDLE_COPYRIGHT}</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> - <key>NSHighResolutionCapable</key> - <string>True</string> </dict> </plist> diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index c79f66d..d12d96d 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1446,31 +1446,62 @@ bool cmQtAutoGenerators::MocGenerateFile( bool cmQtAutoGenerators::UicFindIncludedFile(std::string& absFile, const std::string& sourceFile, - const std::string& includeString) + const std::string& searchPath, + const std::string& searchFile) { bool success = false; - // Search in vicinity of the source + std::vector<std::string> testFiles; + // Collect search paths list { - std::string testPath = SubDirPrefix(sourceFile); - testPath += includeString; - if (cmsys::SystemTools::FileExists(testPath.c_str())) { - absFile = cmsys::SystemTools::GetRealPath(testPath); + const std::string searchFileFull = searchPath + searchFile; + // Vicinity of the source + { + const std::string sourcePath = SubDirPrefix(sourceFile); + testFiles.push_back(sourcePath + searchFile); + if (!searchPath.empty()) { + testFiles.push_back(sourcePath + searchFileFull); + } + } + // AUTOUIC search paths + if (!this->UicSearchPaths.empty()) { + for (std::vector<std::string>::const_iterator iit = + this->UicSearchPaths.begin(); + iit != this->UicSearchPaths.end(); ++iit) { + testFiles.push_back(*iit + "/" + searchFile); + } + if (!searchPath.empty()) { + for (std::vector<std::string>::const_iterator iit = + this->UicSearchPaths.begin(); + iit != this->UicSearchPaths.end(); ++iit) { + testFiles.push_back(*iit + "/" + searchFileFull); + } + } + } + } + + // Search for the .ui file! + for (std::vector<std::string>::const_iterator iit = testFiles.begin(); + iit != testFiles.end(); ++iit) { + const std::string& testFile = *iit; + if (cmsys::SystemTools::FileExists(testFile.c_str())) { + absFile = cmsys::SystemTools::GetRealPath(testFile); success = true; + break; } } - // Search in include directories + + // Log error if (!success) { - for (std::vector<std::string>::const_iterator iit = - this->UicSearchPaths.begin(); - iit != this->UicSearchPaths.end(); ++iit) { - const std::string fullPath = ((*iit) + '/' + includeString); - if (cmsys::SystemTools::FileExists(fullPath.c_str())) { - absFile = cmsys::SystemTools::GetRealPath(fullPath); - success = true; - break; - } + std::ostringstream ost; + ost << "AutoUic: Error: " << Quoted(sourceFile) << "\n"; + ost << "Could not find " << Quoted(searchFile) << " in\n"; + for (std::vector<std::string>::const_iterator iit = testFiles.begin(); + iit != testFiles.end(); ++iit) { + ost << " " << Quoted(*iit) << "\n"; } + this->LogError(ost.str()); } + return success; } @@ -1500,16 +1531,14 @@ bool cmQtAutoGenerators::UicGenerateAll( const std::string uiBasePath = SubDirPrefix(*uit); const std::string uiBaseName = cmsys::SystemTools::GetFilenameWithoutLastExtension(*uit).substr(3); - const std::string searchFileName = uiBasePath + uiBaseName + ".ui"; + const std::string uiFileName = uiBaseName + ".ui"; std::string uiInputFile; - if (UicFindIncludedFile(uiInputFile, source, searchFileName)) { + if (UicFindIncludedFile(uiInputFile, source, uiBasePath, uiFileName)) { std::string uiOutputFile = uiBasePath + "ui_" + uiBaseName + ".h"; cmSystemTools::ReplaceString(uiOutputFile, "..", "__"); uiGenMap[uiInputFile] = uiOutputFile; testMap[uiInputFile] = uiOutputFile; } else { - this->LogError("AutoUic: Error: " + Quoted(sit->first) + - "\nCould not find " + Quoted(searchFileName)); return false; } } diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index b525364..337aa17 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -112,7 +112,8 @@ private: // -- Uic file generation bool UicFindIncludedFile(std::string& absFile, const std::string& sourceFile, - const std::string& includeString); + const std::string& searchPath, + const std::string& searchFile); bool UicGenerateAll( const std::map<std::string, std::vector<std::string> >& includedUis); bool UicGenerateFile(const std::string& realName, diff --git a/Tests/QtAutogen/uicInclude/PageC2.ui b/Tests/QtAutogen/uicInclude/PageC2.ui new file mode 100644 index 0000000..daab868 --- /dev/null +++ b/Tests/QtAutogen/uicInclude/PageC2.ui @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PageC2</class> + <widget class="QWidget" name="PageC2"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QTreeView" name="treeView"/> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/dirB/PageB.ui index fa6dfa6..fa6dfa6 100644 --- a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui +++ b/Tests/QtAutogen/uicInclude/dirB/PageB.ui diff --git a/Tests/QtAutogen/uicInclude/dirB/PageB2.ui b/Tests/QtAutogen/uicInclude/dirB/PageB2.ui new file mode 100644 index 0000000..2225150 --- /dev/null +++ b/Tests/QtAutogen/uicInclude/dirB/PageB2.ui @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PageB2</class> + <widget class="QWidget" name="PageB2"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QTreeView" name="treeView"/> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui b/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui new file mode 100644 index 0000000..873016e --- /dev/null +++ b/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PageBsub</class> + <widget class="QWidget" name="PageBsub"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QTreeView" name="treeView"/> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/uicInclude/main.cpp b/Tests/QtAutogen/uicInclude/main.cpp index 4ca66a7..c8e7609 100644 --- a/Tests/QtAutogen/uicInclude/main.cpp +++ b/Tests/QtAutogen/uicInclude/main.cpp @@ -6,5 +6,13 @@ int main(int argv, char** args) return 0; } -#include "sub/ui_PageB.h" +// .ui files in CMAKE_AUTOUIC_SEARCH_PATHS +#include "ui_PageA.h" +// .ui files in AUTOUIC_SEARCH_PATHS +#include "sub/gen/deep/ui_PageB2.h" +#include "subB/ui_PageBsub.h" +#include "ui_PageB.h" +// .ui files in source's vicinity +#include "sub/gen/deep/ui_PageC2.h" +#include "subC/ui_PageCsub.h" #include "ui_PageC.h" diff --git a/Tests/QtAutogen/uicInclude/subC/PageCsub.ui b/Tests/QtAutogen/uicInclude/subC/PageCsub.ui new file mode 100644 index 0000000..0268326 --- /dev/null +++ b/Tests/QtAutogen/uicInclude/subC/PageCsub.ui @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PageCsub</class> + <widget class="QWidget" name="PageCsub"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QTreeView" name="treeView"/> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> |