Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34115

Minor issue with CMake 2.8.12 when trying to find the Qt5Widgets package

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.1.1
    • Build System
    • None
    • OS X 10.8.5
    • 054f357b695cfb2ef4a3c20e2bb617f23a00172a

    Description

      I have just upgraded to CMake 2.8.12, while still using Qt 5.1.1 on OS X 10.8.5, and one of my CMake commands is:

      FIND_PACKAGE(Qt5Widgets REQUIRED)

      Using CMake 2.8.11, everything used to work fine. However, with CMake 2.8.12, I am now getting the following warning:

      ~~~~~~~~~
      CMake Warning (dev) at /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:123 (include):
      Syntax Warning in cmake code at

      /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:8:56

      Argument not separated from preceding token by whitespace.
      Call Stack (most recent call first):
      /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:78 (find_package)
      cmake/common.cmake:17 (FIND_PACKAGE)
      CMakeLists.txt:27 (INITIALISE_PROJECT)
      This warning is for project developers. Use -Wno-dev to suppress it.
      ~~~~~~~~~

      I am still able to build my project, so it's not a blocking issue. Still, it would be nice to fix it.

      As it happens, I had a look at Qt5GuiConfigExtras.cmake and line 8 refers to the following command:

      message(FATAL_ERROR "Failed to find \"gl.h\" in \""/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers"\".")

      For some reasons, CMake 2.8.12 wants a space between the two double quotes, i.e.

      message(FATAL_ERROR "Failed to find \"gl.h\" in \" "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers"\".")

      So, that would fix the warning reported above. However, a better solution might be:

      message(FATAL_ERROR "Failed to find \"gl.h\" in \"/System/Library/Frameworks/OpenGL.framework/Headers\" \"/System/Library/Frameworks/AGL.framework/Headers\".")

      Indeed, the result of the original CMake command is as follows (notice the final full point in double quotes):

      ~~~~~~~~~
      CMake Error at /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:8 (message):
      Failed to find "gl.h" in
      "/System/Library/Frameworks/OpenGL.framework/Headers"
      "/System/Library/Frameworks/AGL.framework/Headers""."
      ~~~~~~~~~

      while 'my' solution results in the following message:

      ~~~~~~~~~
      CMake Error at /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:8 (message):
      Failed to find "gl.h" in
      "/System/Library/Frameworks/OpenGL.framework/Headers"
      "/System/Library/Frameworks/AGL.framework/Headers".
      ~~~~~~~~~

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            agarny Alan Garny
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes