<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Okay, the problem I am having is as follows. I am converting a C++ QT3 program over from using qmake to cmake and have hit a snag.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">The following is my basic layout for the cmakelists.txt file, what happens is, when the UIC command gets called from the QT_WRAP_UI it doesn't generate out .cpp files, just the .h files.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">In qmake for qt3, every .ui file when it
goes through UIC gets it's own .h and .cpp file, and the .ui.h is your own implementation of some of the functions. So Although everything builds, when it hits time to link, it has tons of undefined references to itself, because the actual implementations never got generated.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Any help or suggestions would be greatly appreciated.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span class="Apple-style-span" style="font-size: 16px; ">CMakeLists.txt</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span class="Apple-style-span" style="font-size: 16px;
">#**************************************************</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span class="Apple-style-span" style="font-size: 16px; "># Find QT</span><br></div><div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">FIND_PACKAGE(Qt3 REQUIRED)</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">ADD_DEFINITIONS(${QT_DEFINITIONS})</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}</font></div><div><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; "><span class="Apple-tab-span" style="white-space:pre">        </span>${CMAKE_CURRENT_BINARY_DIR}</span><br></div><div><font
class="Apple-style-span" face="'times new roman', 'new york', times, serif"> ${CMAKE_CURRENT_SRC_DIR})</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">SET(SAMPLE_SOURCES main.cpp </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>Sample.cpp</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>UIImpl.cpp )</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">SET(</font><span class="Apple-style-span"
style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE_</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">HEADERS UIImpl.h </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"> Sample.h )</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">SET(</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_HEADERS_UI_H SampleControl.ui.h </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"> SampleControl2.ui.h</font><span
class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">)</span></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">SET(</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_FORMS SampleControl.ui </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"> SampleControl2.ui )</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times
new roman', 'new york', times, serif">QT_WRAP_UI(SAMPLEAPP </font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_FORMS_H </font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_FORMS_CPP ${</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE_</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">FORMS})</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">QT_WRAP_CPP(</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLEAPP</span><font class="Apple-style-span"
face="'times new roman', 'new york', times, serif"> </font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_HEADERS_MOC ${</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_HEADERS} ${</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_FORMS_H})</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new
roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">link_directories(${PROJECT_BINARY_DIR}/src</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>${PROJECT_SOURCE_DIR}/../lib</font></div><div><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; "><span class="Apple-tab-span" style="white-space:pre">        </span>${CMAKE_CURRENT_BINARY_DIR})</span><br></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">add_executable(SAMPLEAPP ${</font><span class="Apple-style-span"
style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">_SOURCES} </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"> ${</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE_</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">HEADERS_MOC} </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"> ${</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE_</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">FORMS_HEADERS} </font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">
${</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLE_</span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">HEADERS_UI_H}</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>)</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">target_link_libraries(</font><span class="Apple-style-span" style="font-family: 'times new roman', 'new york', times, serif; ">SAMPLEAPP </span><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">${QT_LIBRARIES})</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">#******************************************************************</font></div><div><font class="Apple-style-span" face="'times new roman',
'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">Snippet out of my actual build.make file that is generated from cmake</font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><div>src/SampleControl.h: ../src/SAMPLEAPP/ui/SampleControl.ui</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(CMAKE_COMMAND) -E cmake_progress_report SAMPLEAPP/build/CMakeFiles $(CMAKE_PROGRESS_22)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold "Generating SampleControl.h"</div><div><span class="Apple-tab-span" style="white-space:pre">
        </span>SAMPLEAPP/build/src && /usr/bin/uic-qt3 -o SAMPLEAPP/build/src/SampleControl.h SAMPLEAPP/src/SAMPLEAPP/ui/SampleControl.ui</div></font></div></div></div></body></html>