View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012644CMakeModulespublic2011-12-31 09:172012-09-03 16:01
ReporterBernd Lörwald 
Assigned ToClinton Stimpson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAppleOSMac OSXOS Version10.7.2
Product VersionCMake 2.8.6 
Target VersionCMake 2.8.8Fixed in VersionCMake 2.8.8 
Summary0012644: Modules/Qt4Macros.cmake: qt4_create_translation: missing include paths
DescriptionThe macro does not give lupdate the include paths given in the makefile, therefore lupdate produces warnings like "Qualifying with unknown namespace/class ::Foo" and possibly bad files. lupdate needs the class definition to not throw these warnings.
Steps To ReproduceAs found in the attachment:

./CMakeLists.txt
./src/foo.cpp
./src/foo.h

CMakeLists:
...
include_directories (${CMAKE_CURRENT_SOURCE_DIR}) # ./

qt4_create_translation (QM_FILES ${SOURCE} ${TRANSLATIONS})
qt4_add_translation (QM ${TRANSLATIONS})
...

src/foo.cpp:
#include <src/foo.h>
...
void Foo::greet() const
{
 qDebug() << tr ("greeting");
}
...

[ 20%] Generating ../translation.ts
src/foo.cpp:8: Qualifying with unknown namespace/class ::Foo
Additional InformationThe macro uses an temporary .pro file "CMakeFiles/translation_lupdate.pro". This includes only "SOURCES=../src/foo.cpp", while it should also include "INCLUDEPATH=..".

To fix this, do:
- FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}")
+ # TODO: get paths into ${include_paths}
+ SET(_pro_includes)
+ FOREACH(_pro_include ${include_paths})
+ GET_FILENAME_COMPONENT(_abs_include "${CMAKE_BINARY_DIR}/${_pro_include}" ABSOLUTE)
+ SET(_pro_includes "${_pro_includes} \"${_abs_include}\"")
+ ENDFOREACH(_pro_include ${CMAKE_CXX_INCLUDE_PATH})
+ FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")

I do not know how to get the include paths though. That's for you to fix.
Tagsqt
Attached Fileszip file icon lupdate_example.zip [^] (2,477 bytes) 2011-12-31 09:17

 Relationships

  Notes
(0028080)
Bernd Lörwald (reporter)
2011-12-31 09:26

Still present in 2.8.7.
(0028536)
Clinton Stimpson (developer)
2012-02-08 21:02

7a6d279 FindQt4: Add include directories for lupdate.
(0030871)
David Cole (manager)
2012-09-03 16:01

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

 Issue History
Date Modified Username Field Change
2011-12-31 09:17 Bernd Lörwald New Issue
2011-12-31 09:17 Bernd Lörwald File Added: lupdate_example.zip
2011-12-31 09:20 Bernd Lörwald Tag Attached: qt
2011-12-31 09:26 Bernd Lörwald Note Added: 0028080
2012-01-02 13:24 Brad King Assigned To => Clinton Stimpson
2012-01-02 13:24 Brad King Status new => assigned
2012-02-08 21:02 Clinton Stimpson Note Added: 0028536
2012-02-08 21:02 Clinton Stimpson Status assigned => resolved
2012-02-08 21:02 Clinton Stimpson Resolution open => fixed
2012-04-19 15:43 David Cole Fixed in Version => CMake 2.8.8
2012-04-19 15:43 David Cole Target Version => CMake 2.8.8
2012-09-03 16:01 David Cole Note Added: 0030871
2012-09-03 16:01 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team