[CMake] Re: [Insight-users] Qmake to CMake migration - IMAGES

Clinton Stimpson clinton at elemtech.com
Fri Jan 21 01:23:52 EST 2005


It would be nice to have CMake help with image collections instead of doing
a custom build rule.

So your build rule generates a file called image_collection.cpp?  And are
you adding that file to the list of sources to build the executable with. 
Building without that will never give you a linker error and you won't see
any images from that collection showing up in the application.

I've whipped up a simple little test app to demonstrate how this works.  I
can zip it up and send it to anyone who wants it.

I don't think you can direct moc generated files to go somewhere other than
the build directory.  I use out-of-source builds, so that is never a
concern for me.

Once you have things setup, I don't see how qmake or cmake have much of an
advantage over each other in adding files during development.

Clint

Quoting Pavan Podila <pavan.podila at gmail.com>:

> Hi Clinton,
>     I tried this step but I still don't see any images in the
> application. In VS.NET I see that the CMake rule for images is executed
> and it is also generating the image_collection.cpp. However when I run
> the application, there are no icons/images.
>
> Also I had the following questions:
> 1. Can I direct the MOC generated files into a specific directory.
> 2. Have you tried the QMsNet2003 addin for VS.NET 2003. It really
> simplifies the management of Qt files, both moc generated and images.
> Reason I am asking is, I am still in the development phase and I keep
> adding more images and files that need to be moc'ed. Will CMake take
> care of this dynamically through it's rules.
>
> Cheers!
> Pavan
>
> Clinton Stimpson wrote:
>
> > To make an image collection, we do something like the following.
> > SET(IMG_SRCS ${PRJ_SOURCE_DIR}/images/pic1.png
> > ${PRJ_SOURCE_DIR}/images/pic2.png ${PRJ_SOURCE_DIR}/images/pic3.png )
> > ADD_CUSTOM_COMMAND(OUTPUT ${PRJ_BINARY_DIR}/image_collection.h COMMAND
> > ${QT_UIC_EXECUTABLE} ARGS -o ${PRJ_BINARY_DIR}/image_collection.h
> > -embed prj ${IMG_SRCS} DEPENDS ${IMG_SRCS}) Then image_collection.h is
> > included in our source code. There may be some extra things on the
> > code side, but this is what we have in our CMake file. Clint At 09:24
> > AM 1/20/2005, Pavan Podila wrote:
> >
> >>> Hi,
> >>>   I am in the process of migrating our build file from Qmake to
> >>> CMake. I dont know how to incorporate the "IMAGES = " declaration in
> >>> Qmake into CMake. Please provide some suggestions.
> >>>
> >>> Thanks,
> >>> Pavan
> >>> _______________________________________________
> >>> Insight-users mailing list
> >>> Insight-users at itk.org
> >>> http://www.itk.org/mailman/listinfo/insight-users
> >>
> >>
> >>
> >
> > _______________________________________________
> > CMake mailing list
> > CMake at www.cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>




More information about the CMake mailing list