View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015459CMakeCMakepublic2015-03-19 00:542015-11-02 09:13
ReporterNorbert Pfeiler 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.2.1 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015459: autogen broken for ninja generator
DescriptionUsing automoc and autorcc,
cmake_autogen is only triggered when the resources change, leaving new or changed header files unprocessed.
Ironically (at least on linux) the target is now ›cmake_automoc‹ and not ›cmake_autogen‹ anymore.

Additionally on Windows all resources get assigned to »ident*« variables whose lines end with CRCRCRLF.
Ninja complains: »carriage returns are not allowed, use newlines«
The first 4 ident variables also only specify the source directory and no file
Steps To Reproduceuse automoc and autorcc with the ninja generator
on windows: can’t build in the first place due to ninja complaining
on linux or after fixing the newlines on windows:
build → remove a generated moc file → build again → fail
TagsNo tags attached.
Attached Files7z file icon cmake_autogen_test.7z [^] (629 bytes) 2015-03-21 09:26
7z file icon cmake_generated_resource_test.7z [^] (664 bytes) 2015-04-18 14:51

 Relationships
related to 0015074closedStephen Kelly Qt 5: resources aren't being updated when CMAKE_AUTORCC is used 
related to 0015523closedBrad King ninja AUTORCC with AUTOGEN_TARGET_DEPENDS generated resources 

  Notes
(0038269)
Stephen Kelly (developer)
2015-03-21 06:21

It works for me:

  stephen@hal:~/dev/src/playground/cmake/build{master}$ cmake .. -G Ninja
  -- The C compiler identification is GNU 4.9.1
  -- The CXX compiler identification is GNU 4.9.1
  -- Check for working C compiler using: Ninja
  -- Check for working C compiler using: Ninja -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler using: Ninja
  -- Check for working CXX compiler using: Ninja -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/stephen/dev/src/playground/cmake/build
  stephen@hal:~/dev/src/playground/cmake/build{master}$ ninja -v
  [1/5] cd /home/stephen/dev/src/playground/cmake/build && /home/stephen/dev/prefix/qtbase/kde/bin/cmake -E cmake_autogen /home/stephen/dev/src/playground/cmake/build/CMakeFiles/mn_automoc.dir/ ""
  Generating main.moc
  [2/5] /usr/lib/ccache/c++ -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -fPIE -I. -I../ -isystem /home/stephen/dev/prefix/qtbase/include -isystem /home/stephen/dev/prefix/qtbase/include/QtQml -isystem /home/stephen/dev/prefix/qtbase/include/QtNetwork -isystem /home/stephen/dev/prefix/qtbase/include/QtCore -isystem /home/stephen/dev/prefix/qtbase/mkspecs/linux-g++ -MMD -MT CMakeFiles/mn.dir/main.cpp.o -MF CMakeFiles/mn.dir/main.cpp.o.d -o CMakeFiles/mn.dir/main.cpp.o -c ../main.cpp
  [3/5]
  [4/5] /usr/lib/ccache/c++ -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -fPIE -I. -I../ -isystem /home/stephen/dev/prefix/qtbase/include -isystem /home/stephen/dev/prefix/qtbase/include/QtQml -isystem /home/stephen/dev/prefix/qtbase/include/QtNetwork -isystem /home/stephen/dev/prefix/qtbase/include/QtCore -isystem /home/stephen/dev/prefix/qtbase/mkspecs/linux-g++ -MMD -MT CMakeFiles/mn.dir/mn_automoc.cpp.o -MF CMakeFiles/mn.dir/mn_automoc.cpp.o.d -o CMakeFiles/mn.dir/mn_automoc.cpp.o -c mn_automoc.cpp
  [5/5] : && /usr/lib/ccache/c++ CMakeFiles/mn.dir/main.cpp.o CMakeFiles/mn.dir/mn_automoc.cpp.o -o mn -rdynamic /home/stephen/dev/prefix/qtbase/lib/libQt5Qml.so.5.5.0 /home/stephen/dev/prefix/qtbase/lib/libQt5Network.so.5.5.0 /home/stephen/dev/prefix/qtbase/lib/libQt5Core.so.5.5.0 -Wl,-rpath,/home/stephen/dev/prefix/qtbase/lib && :
  stephen@hal:~/dev/src/playground/cmake/build{master}$ rm main.moc
  stephen@hal:~/dev/src/playground/cmake/build{master}$ ninja -v
  [1/3] cd /home/stephen/dev/src/playground/cmake/build && /home/stephen/dev/prefix/qtbase/kde/bin/cmake -E cmake_autogen /home/stephen/dev/src/playground/cmake/build/CMakeFiles/mn_automoc.dir/ ""
  Generating main.moc
  [2/3] /usr/lib/ccache/c++ -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -fPIE -I. -I../ -isystem /home/stephen/dev/prefix/qtbase/include -isystem /home/stephen/dev/prefix/qtbase/include/QtQml -isystem /home/stephen/dev/prefix/qtbase/include/QtNetwork -isystem /home/stephen/dev/prefix/qtbase/include/QtCore -isystem /home/stephen/dev/prefix/qtbase/mkspecs/linux-g++ -MMD -MT CMakeFiles/mn.dir/main.cpp.o -MF CMakeFiles/mn.dir/main.cpp.o.d -o CMakeFiles/mn.dir/main.cpp.o -c ../main.cpp
  [3/3] : && /usr/lib/ccache/c++ CMakeFiles/mn.dir/main.cpp.o CMakeFiles/mn.dir/mn_automoc.cpp.o -o mn -rdynamic /home/stephen/dev/prefix/qtbase/lib/libQt5Qml.so.5.5.0 /home/stephen/dev/prefix/qtbase/lib/libQt5Network.so.5.5.0 /home/stephen/dev/prefix/qtbase/lib/libQt5Core.so.5.5.0 -Wl,-rpath,/home/stephen/dev/prefix/qtbase/lib && :
  stephen@hal:~/dev/src/playground/cmake/build{master}$ cat ../CMakeLists.txt

  cmake_minimum_required(VERSION 3.0)
  project(cmaketest)

  set(CMAKE_AUTOMOC ON)
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  add_executable(mn main.cpp)

  find_package(Qt5Qml REQUIRED)
  target_link_libraries(mn Qt5::Qml)
(0038270)
Stephen Kelly (developer)
2015-03-21 06:23

I tested with master and with `cmake version 2.8.12.2`
(0038271)
Norbert Pfeiler (reporter)
2015-03-21 09:26

That’s because you didn’t include resources.
I took the time and uploaded a minimal test case.
(0038273)
Stephen Kelly (developer)
2015-03-22 07:53

Thanks, confirmed.

It works with Makefiles, but not with Ninja. I don't know enough about Ninja to know why.
(0038353)
Brad King (manager)
2015-03-27 15:38

This should fix it:

 QtAutogen: Fix rcc rebuild with Ninja generator
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4d08e6b6 [^]

Back when 0015074 was addressed this was not possible to implement correctly with the Ninja generator. Fortunately it is now. See commit message for details.
(0038354)
Brad King (manager)
2015-03-27 15:38

Re 0015459:0038353: Steve, please look at updating the test suite to cover this case.
(0038528)
Norbert Pfeiler (reporter)
2015-04-15 20:57

The test case still doesn’t work on Windows. (the second part of the issue)

> ninja --version && cmake --version && mkdir build && cd build && cmake -G Ninja .. && ninja
1.5.3
cmake version 3.2.20150415-g8469b

CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/cmake_autogen_test/build
ninja: error: build.ninja:108: lexing error
ident0 = ../
            ^ near here
(0038537)
Brad King (manager)
2015-04-17 10:52

The CRCRLF problem has been fixed and a test case added:

 QtAutogen: Workaround rcc CRCRLF newlines on Windows
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8fdd5f1 [^]
(0038540)
Norbert Pfeiler (reporter)
2015-04-18 14:57

I attached a new test case.
It has a resource which is generated and marked as »AUTOGEN_TARGET_DEPENDS«.
Works with make, doesn’t with ninja.
(0038543)
Brad King (manager)
2015-04-20 08:37

Re 0015459:0038540: Please open a separate issue for that.
(0038545)
Norbert Pfeiler (reporter)
2015-04-20 08:52

OK, i just thought it may have to do with the fixes for this bug…
(0039781)
Robert Maynard (manager)
2015-11-02 09:13

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-03-19 00:54 Norbert Pfeiler New Issue
2015-03-21 06:21 Stephen Kelly Note Added: 0038269
2015-03-21 06:23 Stephen Kelly Note Added: 0038270
2015-03-21 09:26 Norbert Pfeiler Note Added: 0038271
2015-03-21 09:26 Norbert Pfeiler File Added: cmake_autogen_test.7z
2015-03-22 07:53 Stephen Kelly Note Added: 0038273
2015-03-27 15:38 Brad King Note Added: 0038353
2015-03-27 15:38 Brad King Assigned To => Brad King
2015-03-27 15:38 Brad King Status new => resolved
2015-03-27 15:38 Brad King Resolution open => fixed
2015-03-27 15:38 Brad King Fixed in Version => CMake 3.3
2015-03-27 15:38 Brad King Target Version => CMake 3.3
2015-03-27 15:38 Brad King Note Added: 0038354
2015-03-27 15:39 Brad King Relationship added related to 0015074
2015-04-15 20:57 Norbert Pfeiler Note Added: 0038528
2015-04-15 20:57 Norbert Pfeiler Status resolved => feedback
2015-04-15 20:57 Norbert Pfeiler Resolution fixed => reopened
2015-04-16 08:25 Brad King Assigned To Brad King =>
2015-04-16 08:25 Brad King Status feedback => acknowledged
2015-04-16 08:25 Brad King Resolution reopened => open
2015-04-16 08:25 Brad King Fixed in Version CMake 3.3 =>
2015-04-16 08:25 Brad King Target Version CMake 3.3 =>
2015-04-17 10:52 Brad King Note Added: 0038537
2015-04-17 10:52 Brad King Assigned To => Brad King
2015-04-17 10:52 Brad King Status acknowledged => resolved
2015-04-17 10:52 Brad King Resolution open => fixed
2015-04-17 10:52 Brad King Fixed in Version => CMake 3.3
2015-04-17 10:52 Brad King Target Version => CMake 3.3
2015-04-18 14:51 Norbert Pfeiler File Added: cmake_generated_resource_test.7z
2015-04-18 14:57 Norbert Pfeiler Note Added: 0038540
2015-04-18 14:57 Norbert Pfeiler Status resolved => feedback
2015-04-18 14:57 Norbert Pfeiler Resolution fixed => reopened
2015-04-20 08:37 Brad King Note Added: 0038543
2015-04-20 08:37 Brad King Status feedback => resolved
2015-04-20 08:37 Brad King Resolution reopened => fixed
2015-04-20 08:52 Norbert Pfeiler Note Added: 0038545
2015-04-20 10:00 Brad King Relationship added related to 0015523
2015-11-02 09:13 Robert Maynard Note Added: 0039781
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team