MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0015608 | CMake | CMake | public | 2015-06-11 02:14 | 2016-02-01 09:10 | |||||
Reporter | Hendrik Sattler | |||||||||
Assigned To | Brad King | |||||||||
Priority | normal | Severity | major | Reproducibility | always | |||||
Status | closed | Resolution | fixed | |||||||
Platform | OS | OS Version | ||||||||
Product Version | CMake 3.2.2 | |||||||||
Target Version | CMake 3.4 | Fixed in Version | CMake 3.4 | |||||||
Summary | 0015608: automoc fails when enabling autorcc | |||||||||
Description | Automoc does not work after initial cmake run when autorcc is enabled. I created a small example that shows the problem. I created it from scratch and it instantly fails for me. I get: error C3861: 'onTst2': identifier not found (moc_main.cpp) This file is auto-generated and thus was not updated. -> Should not happen. I also tried to manually run cmake, it won't help. However, commenting mainx.qrc helps! Or using qt4_add_resources() and disabling CMAKE_AUTORCC! Suddenly, the bugtest_automoc target is gone in VS and it compiles again, even after adding/removing Qt slot functions. BTW, why is this target called bugtest_automoc and not bugtest_autogen? The whole thing looks strange as bugtest target still has a qrc_mainx.cpp.rule but bugtest_automoc also has such a rule. The bugtest.automoc.rule file properties show no real command: ----------------- setlocal cd D:\bugtest\cmake-autogen\build if %errorlevel% neq 0 goto :cmEnd D: if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd ----------------- Is that supposed to actually do something? I am using Visual Studio 2010. CMake is 3.2.2 but also I tried 3.3-rc1. | |||||||||
Steps To Reproduce | You need to create a foo.png to get the qrc to actually create the source file (actually 2nd bug that CMake doesn't warn about a missing file). First run, comment out the onTst2 slot function (both h and cpp file), it should build. Then comment it before 2nd run. | |||||||||
Additional Information | CMakeLists.txt: ---------------------------------------------- cmake_minimum_required ( VERSION 3.0.2 ) cmake_policy ( VERSION 3.0.2 ) project ( bugtest CXX ) find_package ( Qt4 ) set ( CMAKE_INCLUDE_CURRENT_DIR ON ) set ( CMAKE_AUTOMOC ON ) set ( CMAKE_AUTORCC ON ) add_executable ( bugtest main.cpp mainx.qrc ) target_link_libraries ( bugtest Qt4::QtCore ) ---------------------------------------------- main.h: ---------------------------------------------- #include <QObject> class tst1 : public QObject { Q_OBJECT public slots: void onTst1(); //void onTst2(); }; ---------------------------------------------- main.cpp: ---------------------------------------------- #include "main.h" void tst1::onTst1() { } // void tst1::onTst2() // { // } int main( int argc, char **argv) { return 0; } ---------------------------------------------- mainx.qrc: ---------------------------------------------- <!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>foo.png</file> </qresource> </RCC> ---------------------------------------------- | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2015-06-11 02:14 | Hendrik Sattler | New Issue | ||||||||
2015-06-16 12:54 | Brad King | Note Added: 0038935 | ||||||||
2015-06-16 15:41 | Hendrik Sattler | Note Added: 0038936 | ||||||||
2015-06-16 16:20 | Brad King | Note Added: 0038937 | ||||||||
2015-06-16 16:21 | Brad King | Note Edited: 0038937 | bug_revision_view_page.php?bugnote_id=38937#r1808 | |||||||
2015-06-16 16:32 | Brad King | Note Added: 0038938 | ||||||||
2015-06-16 16:36 | Brad King | Note Added: 0038939 | ||||||||
2015-06-16 16:37 | Brad King | Status | new => resolved | |||||||
2015-06-16 16:37 | Brad King | Resolution | open => no change required | |||||||
2015-06-16 16:50 | Hendrik Sattler | Note Added: 0038940 | ||||||||
2015-06-17 08:21 | Hendrik Sattler | Note Added: 0038942 | ||||||||
2015-06-17 08:21 | Hendrik Sattler | Status | resolved => feedback | |||||||
2015-06-17 08:21 | Hendrik Sattler | Resolution | no change required => reopened | |||||||
2015-06-18 08:33 | Brad King | Status | feedback => backlog | |||||||
2015-06-18 08:33 | Brad King | Resolution | reopened => open | |||||||
2015-06-18 08:35 | Brad King | Note Added: 0038943 | ||||||||
2015-06-19 09:50 | Brad King | Relationship added | related to 0015074 | |||||||
2015-06-19 09:51 | Brad King | Note Added: 0038955 | ||||||||
2015-06-19 10:36 | Brad King | Note Added: 0038956 | ||||||||
2015-06-19 10:36 | Brad King | Assigned To | => Brad King | |||||||
2015-06-19 10:36 | Brad King | Status | backlog => resolved | |||||||
2015-06-19 10:36 | Brad King | Resolution | open => fixed | |||||||
2015-06-19 10:36 | Brad King | Fixed in Version | => CMake 3.4 | |||||||
2015-06-19 10:36 | Brad King | Target Version | => CMake 3.4 | |||||||
2016-02-01 09:10 | Robert Maynard | Note Added: 0040403 | ||||||||
2016-02-01 09:10 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|