Qt5config

broken image


  • Could not find a package configuration file provided by 'Qt5' (requested version 5.9.5) with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of 'Qt5' to CMAKEPREFIXPATH or set 'Qt5DIR' to a directory containing one of the above files.
  • SDL2 is the newest version of the Simple Directmedia Layer API. It can be used together with CMake to build a cross platform multimedia application. In this blog post I will describe the necessary steps to use SDL2 with CMake on both Linux (Ubuntu 17.04) and Windows.
  • With Qt, you can reach all your target platforms – desktop & embedded – with one technology and one codebase, minimizing your time-to-market and maintenance burden.
  • Etc, and Qt5Config would be an aggregate which include s the other configs based on the FINDCOMPONENTS. Findpackage (Qt5 COMPONENTS QtCore).

SDL2 is the newest version of the Simple Directmedia Layer API. It can be usedtogether with CMake to build a cross platform multimedia application. In thisblog post I will describe the necessary steps to use SDL2 with CMake on bothLinux (Ubuntu 17.04) and Windows.

Qt5config

Here's a technique that takes advantage of cmake's ability to read the registry to coerce a registry value into locating the matching msvc's Qt5Config.cmake. It attempts to use the highest available Qt5 version by doing a reverse sort on the various '5.x' folder names inside (e.g. This could be placed inside a module as well, e.g.

You need to create a CMakeLists.txt file for your project that includes SDL2and compiles a simple program.

Qt5config.cmake

Here's a technique that takes advantage of cmake's ability to read the registry to coerce a registry value into locating the matching msvc's Qt5Config.cmake. It attempts to use the highest available Qt5 version by doing a reverse sort on the various '5.x' folder names inside (e.g. This could be placed inside a module as well, e.g.

You need to create a CMakeLists.txt file for your project that includes SDL2and compiles a simple program.

You can use the following code:

Linux

Setting up SDL2 with CMake under Ubuntu Linux is pretty easy. All you need to dois install the required dependencies first.

Now you can use cmake to generate your Makefiles and build your project. Toinclude SDL2 headers you just use #include 'SDL.h'. The correct include pathshave been set up by cmake. For Linux nothing else is required.

Windows

For Windows you have to download the development packageSDL2-devel-2.0.5-VC.zip and extract it to some location on your hard disk.

You can create Visual Studio project files with the CMake GUI under windows butwhen you hit configure it will fail because it will not find the SDL2 Library.

In the configuration window you will see a SDL2_DIR variable. You will have topoint that to the location where you extracted the SDL2 development package.

Before you can reconfigure you also have to create a file sdl2-config.cmakewhere you extracted the development libraries and put the following content:

After that you now should be able to reconfigure successfully and generate theVisual Studio project files.

Alternative

An alternative to the config file is a FindSDL2.cmake module.CMake comes with one that works for SDL1.2, it can be adapted to work with SDL2.Here is the full content for the one that I am using:

In order to use it you have to place it somewhere in your project for instance into a cmake subdirectory.Then you have to modify the CMake module path so that it can be found.

Test App

You can create a test application to verify that everything works. You could forinstance use the following code for that which renders a black window.

If you also want to use SDL2_image check out my other post Using SDL2_image with CMake.

There is also a complete project in my github repository here.

gvdhoorn
745372001064905 http://cor.tudelft.nl/

when i creating a new workspace(in windouws) using

this error happend.

i dont know why,and dont konw how to fix it.Does someone konw how to fix it? Iwould be appreciated!

editretagflag offensiveclosemergedelete

Comments

Qt5config.cmake Not Found

I have the same issue. Did you install from binaries? Which ROS2 version and patch release are you using?

By the way, I think this is a duplicate to this question.

yes,i install from binaries,foxy.And,the patch release maybe patch release 4? I forget it.

@Ataraxy I just fixed the issue. Check this question for my solution.

Qt5config.cmake

Thx man !! i fixed it.its useful,thx a lot!!





broken image