<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 <clinton@elemtech.com><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>> Okay, the problem I am having is as follows. I am converting a C++ QT3<br>> program over from using qmake to cmake and have hit a snag.<br>> <br>> The following is my basic layout for the cmakelists.txt file, what happens<br>> is, when the UIC command gets called from the QT_WRAP_UI it doesn't<br>> generate out .cpp files, just the .h files.<br>> <br>> In qmake for qt3, every .ui file when it goes through UIC gets it's own .h<br>> and .cpp file, and the .ui.h is your own implementation of some of the<br>> functions. So Although everything builds, when it hits time to link, it<br>> has tons of undefined references to itself, because the actual<br>> implementations never got generated.<br>>
<br>> Any help or suggestions would be greatly appreciated.<br>> <br>> CMakeLists.txt<br>> #**************************************************<br>> # Find QT<br>> <br>> FIND_PACKAGE(Qt3 REQUIRED)<br>> <br>> ADD_DEFINITIONS(${QT_DEFINITIONS})<br>> INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}<br>> ${CMAKE_CURRENT_BINARY_DIR}<br>> <br>> ${CMAKE_CURRENT_SRC_DIR})<br>> <br>> SET(SAMPLE_SOURCES main.cpp <br>> Sample.cpp<br>> UIImpl.cpp )<br>> <br>> SET(SAMPLE_HEADERS UIImpl.h <br>> Sample.h )<br>> <br>> SET(SAMPLE_HEADERS_UI_H SampleControl.ui.h <br>> SampleControl2.ui.h)<br>> <br>> <br>> SET(SAMPLE_FORMS SampleControl.ui <br>> SampleControl2.ui )<br>> <br>> QT_WRAP_UI(SAMPLEAPP SAMPLE_FORMS_H SAMPLE_FORMS_CPP
${SAMPLE_FORMS})<br>> QT_WRAP_CPP(SAMPLEAPP SAMPLE_HEADERS_MOC ${SAMPLE_HEADERS}<br>> ${SAMPLE_FORMS_H})<br>> <br>> <br>> <br>> <br>> link_directories(${PROJECT_BINARY_DIR}/src<br>> ${PROJECT_SOURCE_DIR}/../lib<br>> ${CMAKE_CURRENT_BINARY_DIR})<br>> <br>> <br>> add_executable(SAMPLEAPP ${SAMPLE_SOURCES} <br>> ${SAMPLE_HEADERS_MOC} <br>> ${SAMPLE_FORMS_HEADERS} <br>> ${SAMPLE_HEADERS_UI_H}<br>> )<br>> target_link_libraries(SAMPLEAPP ${QT_LIBRARIES})<br>> #******************************************************************<br>> <br>> <br>> Snippet out of my actual build.make file that is generated from cmake<br>> <br>> src/SampleControl.h: ../src/SAMPLEAPP/ui/SampleControl.ui<br>> $(CMAKE_COMMAND) -E cmake_progress_report SAMPLEAPP/build/CMakeFiles<br>> $(CMAKE_PROGRESS_22) @$(CMAKE_COMMAND) -E cmake_echo_color<br>> --switch=$(COLOR)
--blue --bold "Generating SampleControl.h"<br>> SAMPLEAPP/build/src && /usr/bin/uic-qt3 -o<br>> SAMPLEAPP/build/src/SampleControl.h<br>> 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>