<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Thanks, that was it.. doh!!!</span></div><div><br></div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Clinton Stimpson &lt;clinton@elemtech.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> cmake@cmake.org<br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, October 11, 2011 10:50 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [CMake] Problem with QT3 not generating .cpp files using Cmake<br></font><br>
<br>Not sure if this is the whole reason, but it looks like you are missing the<br>${SAMPLE_FORMS_CPP} in add_executable().<br><br>Clint<br><br>On Tuesday, October 11, 2011 09:46:40 am Darrell Langford wrote:<br>&gt; Okay, the problem I am having is as follows.&nbsp; I am converting a C++ QT3<br>&gt; program over from using qmake to cmake and have hit a snag.<br>&gt; <br>&gt; The following is my basic layout for the cmakelists.txt file, what happens<br>&gt; is, when the UIC command gets called from the QT_WRAP_UI it doesn't<br>&gt; generate out .cpp files, just the .h files.<br>&gt; <br>&gt; In qmake for qt3, every .ui file when it goes through UIC gets it's own .h<br>&gt; and .cpp file, and the .ui.h is your own implementation of some of the<br>&gt; functions.&nbsp; So Although everything builds, when it hits time to link, it<br>&gt; has tons of undefined references to itself, because the actual<br>&gt; implementations never got generated.<br>&gt;
 <br>&gt; Any help or suggestions would be greatly appreciated.<br>&gt; <br>&gt; CMakeLists.txt<br>&gt; #**************************************************<br>&gt; # Find QT<br>&gt; <br>&gt; FIND_PACKAGE(Qt3 REQUIRED)<br>&gt; <br>&gt; ADD_DEFINITIONS(${QT_DEFINITIONS})<br>&gt; INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}<br>&gt; ${CMAKE_CURRENT_BINARY_DIR}<br>&gt; <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ${CMAKE_CURRENT_SRC_DIR})<br>&gt; <br>&gt; SET(SAMPLE_SOURCES main.cpp <br>&gt; Sample.cpp<br>&gt; UIImpl.cpp )<br>&gt; <br>&gt; SET(SAMPLE_HEADERS UIImpl.h <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sample.h )<br>&gt; <br>&gt; SET(SAMPLE_HEADERS_UI_H SampleControl.ui.h <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SampleControl2.ui.h)<br>&gt; <br>&gt; <br>&gt; SET(SAMPLE_FORMS SampleControl.ui <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  SampleControl2.ui )<br>&gt; <br>&gt; QT_WRAP_UI(SAMPLEAPP SAMPLE_FORMS_H SAMPLE_FORMS_CPP
 ${SAMPLE_FORMS})<br>&gt; QT_WRAP_CPP(SAMPLEAPP SAMPLE_HEADERS_MOC ${SAMPLE_HEADERS}<br>&gt; ${SAMPLE_FORMS_H})<br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; link_directories(${PROJECT_BINARY_DIR}/src<br>&gt; ${PROJECT_SOURCE_DIR}/../lib<br>&gt; ${CMAKE_CURRENT_BINARY_DIR})<br>&gt; <br>&gt; <br>&gt; add_executable(SAMPLEAPP ${SAMPLE_SOURCES} <br>&gt;&nbsp; &nbsp;  ${SAMPLE_HEADERS_MOC} <br>&gt;&nbsp; &nbsp;  ${SAMPLE_FORMS_HEADERS} <br>&gt;&nbsp; &nbsp;  ${SAMPLE_HEADERS_UI_H}<br>&gt; )<br>&gt; target_link_libraries(SAMPLEAPP ${QT_LIBRARIES})<br>&gt; #******************************************************************<br>&gt; <br>&gt; <br>&gt; Snippet out of my actual build.make file that is generated from cmake<br>&gt; <br>&gt; src/SampleControl.h: ../src/SAMPLEAPP/ui/SampleControl.ui<br>&gt; $(CMAKE_COMMAND) -E cmake_progress_report SAMPLEAPP/build/CMakeFiles<br>&gt; $(CMAKE_PROGRESS_22) @$(CMAKE_COMMAND) -E cmake_echo_color<br>&gt; --switch=$(COLOR)
 --blue --bold "Generating SampleControl.h"<br>&gt; SAMPLEAPP/build/src &amp;&amp; /usr/bin/uic-qt3 -o<br>&gt; SAMPLEAPP/build/src/SampleControl.h<br>&gt; SAMPLEAPP/src/SAMPLEAPP/ui/SampleControl.ui<br><br>-- <br>Clinton Stimpson<br>Elemental Technologies, Inc<br>Computational Simulation Software, LLC<br><a target="_blank" href="http://www.csimsoft.com">www.csimsoft.com</a><br>--<br>Powered by <a target="_blank" href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><br>Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.cmake.org/mailman/listinfo/cmake<br><br><br></div></div></div></body></html>