[Cmake] cmake 1.8.1 does not create .cpp files

Andy Cedilnik andy . cedilnik at kitware . com
24 Sep 2003 17:56:01 -0400


Hi Ingmar,

You are using QT_WRAP_UI and QT_WRAP_CPP wrong. You do not have to send
files _h_files through QT_WRAP_CPP as they are already moc-ed. You do
have to send _cpp_files to ADD_LIBRARY.

You should also really use ${_ui_files} in QT_WRAP_UI and ${_cpp_files}
in ADD_LIBRARY.

Please check Tests/Wrapping in CMake. I just modified it a bit, but the
one there works. 

I did fix the bug 186, but you expose it by mistake. I will add test for
that case though.

			Andy

On Wed, 2003-09-24 at 11:44, Bitter, Ingmar (NIH/CC/DRD) wrote:
> Hi,
> 
> I also reported this as bug # 192, but maybe someone knows a quick fix for
> this:
> 
> I use QT_WRAPP_UI in the following way:
> (CMake 1.8.1, MS VC++ 6.0, WinXP pro)
> 
> SET(_ui_files
> C:/cvs/nav/src/ui/bigViewer.ui
> C:/cvs/nav/src/ui/mainWindow.ui
> )
> SET(my_ui_h_files
> bigViewer.h
> mainWindow.h
> )
> QT_WRAP_UI ( _ui _h_files _cpp_files _ui_files )
> QT_WRAP_CPP( _ui _moc_files my_h_files )
> ADD_LIBRARY( _ui STATIC _moc_files )
> LINK_LIBRARIES( _ui )
> 
> my_h_files is necessary to circumvent bug 186.
> 
> CMakeSetup runs fine with this. Compiling the project now creates from the
> .ui the corresponding .h using uic and .cxx using moc.
> Unfortunately, it does not generate the corresponding .cpp that should be
> created using uic from the .ui and the .h. In addition, the .cpp is not part
> of the project file list.
> 
> Consequently, I get undefined symbols for all the functions that would be in
> those generated .cpp files :-(
> 
> -Ingmar
> 
> Ingmar Bitter, Ph.D.     Diagnostic Radiology Department 
> Staff Scientist          Clinical Center
> Tel:(301) 435-2155       National Institutes of Health
> Fax:(301) 496-9933       9000 Rockville Pike, Bethesda, MD 20892
> 
> _______________________________________________
> Cmake mailing list
> Cmake at www . cmake . org
> http://www . cmake . org/mailman/listinfo/cmake