When I checked my Qt version, this is what I got : $ qmake -version
#SETTING UP CMAKE LINUX INSTALL#
So, I went on to install Qt using these following codes : sudo apt-get install qtcreator And later on the next few chapters, they still use Qt. CMake forum is my last hope, I’d really appreciate some input/advice.įrom the book tutorial I followed, the result in the book is different than mine, apparently they’re using QT. (Can’t link them since I have limitation of how many links I can put here). You might find my question elsewhere, because I’ve asked this question in OpenCV forum before, even in Stackoverflow, and CodeProject, all with no luck so far. I have been getting trouble for days building OpenCV and integrating it with Qt using CMake. Here’s my Ubuntu OpenCV version : Ubuntu 18.04.4 LTS I’m working with OpenCV & C++ on terminal Ubuntu and compile my program with CMake. Prior to it, I have OpenCV already installed on my machine. I’ve been following an OpenCV tutorial from a book. \Debug\helloworld.Greetings ! It’s my first post in this forum. Helloworld.vcxproj -> H:\Coding\QT_Tic_Tac_toe\build\Debug\helloworld.exe All rights reserved.Īutomatic MOC and UIC for target helloworldīuilding Custom Rule H:/Coding/QT_Tic_Tac_toe/CMakeLists.txt NET FrameworkĬopyright (C) Microsoft Corporation. Microsoft (R) Build Engine version 17.2.1+52cd2da31 for. PS H:\Coding\QT_Tic_Tac_toe\build> cmake -build. Build files have been written to: H:/Coding/QT_Tic_Tac_toe/build Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) Performing Test HAVE_STDATOMIC - Success Looking for pthread_create in pthread - not found Looking for pthread_create in pthreads - not found Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed Performing Test CMAKE_HAVE_LIBC_PTHREAD Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/6/bin/Host圆4/圆4/cl.exe - skipped The CXX compiler identification is MSVC 2.0
#SETTING UP CMAKE LINUX WINDOWS#
Selecting Windows SDK version 1.0 to target Windows 3. PS H:\Coding\QT_Tic_Tac_toe\build> cmake. Or am I wrong about that part? PS H:\Coding\QT_Tic_Tac_toe> mkdir build I therefore assumed, that the missing/failed parts in the first cmake command are no problem.
#SETTING UP CMAKE LINUX CODE#
One more thing, if I replace the code in main.cpp with a simple "Hello World" programm, it works fine. The output of the three comands is as follows: Set_target_properties(helloworld PROPERTIESĪs suggested by Aamir I created an extra build folder. Target_link_libraries(helloworld PRIVATE Qt6::Widgets) Set(CMAKE_PREFIX_PATH "C:/Qt/6.3.1/msvc2019_64")įind_package(Qt6 REQUIRED COMPONENTS Widgets) # Without this line, cmake does not find the package Project(helloworld VERSION 1.0.0 LANGUAGES CXX)
Option 2, to test If maybe the QWidget above was the problemĬMakeList.txt cmake_minimum_required(VERSION 3.16) Option 1, like in the mentioned stackoverflow answer If I put the code from main.cpp into an existing QT Creator project it works and shows an empty window. īut nothing happens (when running the program, the first two commands appear to work as intended). I then run the following three commands: cmake. My current code is based (more like coppied) from this tutorial from the official (?) docs and this answer by another user to a similar question. I am currently trying to build a minimum working example, that just shows an empty window. I am trying to set up a QT project with CMake (and not using QT Creator).