[CMake] Problem with QT3 not generating .cpp files using Cmake
Darrell Langford
darrell.langford at yahoo.com
Tue Oct 11 12:21:24 EDT 2011
Thanks, that was it.. doh!!!
________________________________
From: Clinton Stimpson <clinton at elemtech.com>
To: cmake at cmake.org
Sent: Tuesday, October 11, 2011 10:50 AM
Subject: Re: [CMake] Problem with QT3 not generating .cpp files using Cmake
Not sure if this is the whole reason, but it looks like you are missing the
${SAMPLE_FORMS_CPP} in add_executable().
Clint
On Tuesday, October 11, 2011 09:46:40 am Darrell Langford wrote:
> 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.
>
> 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.
>
> 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.
>
> Any help or suggestions would be greatly appreciated.
>
> CMakeLists.txt
> #**************************************************
> # Find QT
>
> FIND_PACKAGE(Qt3 REQUIRED)
>
> ADD_DEFINITIONS(${QT_DEFINITIONS})
> INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}
> ${CMAKE_CURRENT_BINARY_DIR}
>
> ${CMAKE_CURRENT_SRC_DIR})
>
> SET(SAMPLE_SOURCES main.cpp
> Sample.cpp
> UIImpl.cpp )
>
> SET(SAMPLE_HEADERS UIImpl.h
> Sample.h )
>
> SET(SAMPLE_HEADERS_UI_H SampleControl.ui.h
> SampleControl2.ui.h)
>
>
> SET(SAMPLE_FORMS SampleControl.ui
> SampleControl2.ui )
>
> QT_WRAP_UI(SAMPLEAPP SAMPLE_FORMS_H SAMPLE_FORMS_CPP ${SAMPLE_FORMS})
> QT_WRAP_CPP(SAMPLEAPP SAMPLE_HEADERS_MOC ${SAMPLE_HEADERS}
> ${SAMPLE_FORMS_H})
>
>
>
>
> link_directories(${PROJECT_BINARY_DIR}/src
> ${PROJECT_SOURCE_DIR}/../lib
> ${CMAKE_CURRENT_BINARY_DIR})
>
>
> add_executable(SAMPLEAPP ${SAMPLE_SOURCES}
> ${SAMPLE_HEADERS_MOC}
> ${SAMPLE_FORMS_HEADERS}
> ${SAMPLE_HEADERS_UI_H}
> )
> target_link_libraries(SAMPLEAPP ${QT_LIBRARIES})
> #******************************************************************
>
>
> Snippet out of my actual build.make file that is generated from cmake
>
> src/SampleControl.h: ../src/SAMPLEAPP/ui/SampleControl.ui
> $(CMAKE_COMMAND) -E cmake_progress_report SAMPLEAPP/build/CMakeFiles
> $(CMAKE_PROGRESS_22) @$(CMAKE_COMMAND) -E cmake_echo_color
> --switch=$(COLOR) --blue --bold "Generating SampleControl.h"
> SAMPLEAPP/build/src && /usr/bin/uic-qt3 -o
> SAMPLEAPP/build/src/SampleControl.h
> SAMPLEAPP/src/SAMPLEAPP/ui/SampleControl.ui
--
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com
--
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111011/71e9cfed/attachment-0001.htm>
More information about the CMake
mailing list