Questions tagged [automoc]

13 questions
12
votes
2 answers

How do you get cmake to add compiler definitions only for automoc files

Our project is using very strict set of warnings, but Qt5 generated moc files produce code that violates these warnings. We could obviously turn off the warnings globally, but I'd like to just suppress the warnings for the automoc files. For…
Steve Broberg
  • 4,255
  • 3
  • 28
  • 40
5
votes
0 answers

CMake AUTOMOC is slow

I have a QT project with that is built with CMake. One of the targets have 142 files that need to have moc. When I use qt5_wrap_cpp on source files and build it the process gets finished in around 15 seconds: set(CMAKE_AUTOMOC…
Teivaz
  • 5,462
  • 4
  • 37
  • 75
2
votes
3 answers

CMake AutoMOC generates .cpp with errors

I have a project that is being generated via CMake that also uses the AutoMOC flag. However, when I open the solution and try to build the project (using the Visual Studio 15 2017 x64 generator), this particular project fails. I'll post the error…
andyopayne
  • 1,348
  • 3
  • 24
  • 49
1
vote
1 answer

How to get AUTOMOC to find header file in QT5

I'm using Qt 5 and I put all my headers in separate include folders, and AUTOMOC is unable to find my headers. src |- sim |- include |- sim |- client.h (contains Q_OBJECT) |- client.cpp My CMake…
Peter Mitrano
  • 2,132
  • 28
  • 31
1
vote
2 answers

qt private slot moc undefined reference error

I have a simple C++ Qt program and I get undefined reference when I use private slots. Can anyone help me? I am learning GUI design using Qt5 from the book C++ GUI Programming with Qt4. I am using cmake with MinGW compiler in Windows. However, if I…
sutradhar
  • 93
  • 1
  • 8
0
votes
0 answers

Why is my CMake project not finding corresponding headers for AutoMoc in subfolders?

I am using Qt 5.12.12 and CMake 3.16. I have a project structured like so: src/ ├─ include/ │ ├─ subfolder/ │ │ ├─ a.h ├─ CMakeLists.txt ├─ a.cpp My CMakeLists.txt file contains: cmake_minimum_required(VERSION 3.16) project(test LANGUAGES…
dylan
  • 68
  • 7
0
votes
0 answers

AutoUIC ignore "ui file not found" before proprocess

I have a file who look like this : ... #ifdef IS_COMPILE_FOR_SPECIAL_TARGET #include "ui_myPage_special.h" #else #include "ui_myPage.h" #endif The project use AutoUIC to include ui_ files. But since AutoUIC is…
iElden
  • 1,272
  • 1
  • 13
  • 26
0
votes
1 answer

QT moc.exe failes due to file(COPY externLibrary DESTINATION build/)

I have a C++ CMake MinGW_64 msys2 project for setting up a camera with lumisuite and QT6 for a gui, which resulted in the following error [cmake] CMake Error: AUTOMOC for target mainwindow: Test run of "moc" executable…
0
votes
1 answer

CMake AUTOMOC vs. qt5_wrap_cpp

I would wish to use qt5_wrap_cpp (much faster) than CMake's AUTOMOC feature, but I have a problem. In one of the libraries (other compile fine) some of generated moc files with qt5_wrap_cpp are missing declarations. For instance one of include…
0
votes
0 answers

CMake not generating Qt moc rules

This is a debugging question. I am trying to integrate Qt moc'ing into a CMake managed project using the AUTOMOC feature. I have not managed to generate a project which includes moc rules, though I believe I followed the guidelines. I've checked…
François Andrieux
  • 28,148
  • 6
  • 56
  • 87
0
votes
1 answer

How to switch off CMake automoc for subdirectories?

I have directory aaa and aaa/bb. I want CMake to create the moc_compilation.o file only for aaa/*.cxx files, but it scans recursively aaa/bb/*.cxx files also. How can I disable the recursive scan for automoc?
Gayane
  • 627
  • 1
  • 11
  • 23
0
votes
1 answer

CMake with AUTOMOC is removing my implementations

I want to use CMake to build this QHttp project, I wrote a minimum set of CMakeLists.txt for build the basic-server example but is not linking. I created an OBJECT library for the 3rdparty library http-parser linked with the qhttp project and then…
-1
votes
1 answer

How to make CMake use AUTOMOC without find_package?

Currently, I have Qt dlls and include headers as a dependency in my repo. I wanted to make use of CMake's CMAKE_AUTOMOC functionality providing a moc.exe binary along with dlls and include files. CMake allows to set a custom path to binary but it…
IC_
  • 1,624
  • 1
  • 23
  • 57