[cmake-developers] Remaining issues around umbrella Config files?

Alexander Neundorf neundorf at kde.org
Mon Jan 21 16:29:41 EST 2013


On Monday 21 January 2013, Stephen Kelly wrote:
> Hi,
> 
> I have this pending patch:
> 
>  https://codereview.qt-project.org/#change,44532
> 
> Given
> 
>  find_package(Qt5 COMPONENTS          Widgets
>                               # I don't have QtQuick installed.
>                   OPTIONAL_COMPONENTS Svg Quick
>  )
> 
>  message("Qt5_FOUND: ${Qt5_FOUND}")
>  message("Qt5Gui_FOUND: ${Qt5Gui_FOUND}")
>  message("Qt5Widgets_FOUND: ${Qt5Widgets_FOUND}")
>  message("Qt5Svg_FOUND: ${Qt5Svg_FOUND}")
>  message("Qt5Quick_FOUND: ${Qt5Quick_FOUND}")
> 
> the output is
> 
>  $ cmake ..
>  CMake Warning at
> /home/stephen/dev/prefix/qtbase/lib/cmake/Qt5/Qt5Config.cmake:24
> (find_package):
>    Could not find a package configuration file provided by "Qt5Quick" with
> any
>    of the following names:
> 
>      Qt5QuickConfig.cmake
>      qt5quick-config.cmake
> 
>    Add the installation prefix of "Qt5Quick" to CMAKE_PREFIX_PATH or set
>    "Qt5Quick_DIR" to a directory containing one of the above files.  If
>    "Qt5Quick" provides a separate development package or SDK, be sure it
> has been installed.
>  Call Stack (most recent call first):
>    CMakeLists.txt:62 (find_package)
> 
> 
>  Qt5_FOUND: 1
>  Qt5Gui_FOUND: 1
>  Qt5Widgets_FOUND: 1
>  Qt5Svg_FOUND: 1
>  Qt5Quick_FOUND: 0
>  -- Configuring done
>  -- Generating done
>  -- Build files have been written to:
> /home/stephen/dev/src/playground/cmake/build
> 
> 
> Given:
> 
>  find_package(Qt5 COMPONENTS Widgets Quick)
> 
>  message("Qt5_FOUND: ${Qt5_FOUND}")
>  message("Qt5Gui_FOUND: ${Qt5Gui_FOUND}")
>  message("Qt5Widgets_FOUND: ${Qt5Widgets_FOUND}")
>  message("Qt5Quick_FOUND: ${Qt5Quick_FOUND}")
> 
> The output is:
> 
>  CMake Warning at
> /home/stephen/dev/prefix/qtbase/lib/cmake/Qt5/Qt5Config.cmake:24
> (find_package):
>    Could not find a package configuration file provided by "Qt5Quick" with
> any
>    of the following names:
> 
>      Qt5QuickConfig.cmake
>      qt5quick-config.cmake
> 
>    Add the installation prefix of "Qt5Quick" to CMAKE_PREFIX_PATH or set
>    "Qt5Quick_DIR" to a directory containing one of the above files.  If
>    "Qt5Quick" provides a separate development package or SDK, be sure it
> has been installed.
>  Call Stack (most recent call first):
>    CMakeLists.txt:62 (find_package)
> 
> 
>  CMake Warning at CMakeLists.txt:62 (find_package):
>    Found package configuration file:
> 
>      /home/stephen/dev/prefix/qtbase/lib/cmake/Qt5/Qt5Config.cmake
> 
>    but it set Qt5_FOUND to FALSE so package "Qt5" is considered to be NOT
>    FOUND.  Reason given by package:
> 
>    Failed to find module "Qt5Quick" in prefix
>    "/home/stephen/dev/prefix/qtbase"
> 
> 
> 
>  Qt5_FOUND: 0
>  Qt5Gui_FOUND: 1
>  Qt5Widgets_FOUND: 1
>  Qt5Svg_FOUND:
>  Qt5Quick_FOUND: 0
>  -- Configuring done
>  -- Generating done
>  -- Build files have been written to:
> /home/stephen/dev/src/playground/cmake/build
> 
> 
> I didn't closely follow the threads around this. Is there any other
> behavior that I should account for here?

Seems ok.

Minor nitpick:
I would probably prefer an error message which mentions component and the 
exact name of the expected config-file instead of the generic find_package() 
error message. Also, since in the patch you only have find_package() check in 
${_qt5_install_prefix}, I think the error message should mention where it 
expects this file exactly.

Alex



More information about the cmake-developers mailing list