[CMake] CMake + UIC files -- Is this a bug with CMake or with me?

kent williams nkwmailinglists at gmail.com
Tue Jul 20 17:18:26 EDT 2010

OK, so set_source_file_properties needs a property value that's a
single string.  This wasn't clear from the documentation at all or not
clear to me at least. Thanks for your help!

On Tue, Jul 20, 2010 at 4:07 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 20.07.10 15:43:16, kent williams wrote:
>> I see what you're doing and I have two points:
>> 1. You only have one file in ${${PROJECT_HAME}_UIS} -- what happens if
>> you create a second file with Designer and add it to this project?
>> Believe me, I read through Qt4Macros.cmake, and what's there should
>> work, but in my case it most definitely does not.
> I've adjusted your CMakeLists.txt to use
> set_source_files_properties(${QTCMake_SRC} PROPERTIES OBJECT_DEPENDS
> "${UIHeaders}")
> The generated Makefiles do generate the headers from the ui files before
> building the object file for the executable. So this does work as long
> as you're using quotes around the variable. It also works that after
> touching a .ui file the header gets re-generated. (I'm using CMake 2.8.1
> currently here).
>> 2. I don't get adding '*.h' files to the source list in add_executable
>> does anything.  It doesn't apparently generate a recipe to make an
>> object file from a header.
> It does make sure that _something_ depends on the generated header
> files. This then triggers generating them from the .ui file. I think
> thats the problem with your original example, there's nothing (in
> particular no target) that depends explicitly on the generated header
> files and hence the "all" target doesn't generate them.
> This is pretty similar to your approach with
> set_source_files_properties, except its a bit more hidden whats going on
> and the dependency is probably between the target and the header.
> Andreas
> --
> Expect a letter from a friend who will ask a favor of you.
> _______________________________________________
> 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

More information about the CMake mailing list