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

2010-07-22 Thread Michael Wild

On 22. Jul, 2010, at 17:07 , kent williams wrote:

> It's perfectly clear to me now, but I bet I'm not the first (or last!)
> person to run into issues like this and get roadblocked.
> 
> Every software task seems to have its stumbling block.
> 
> In Medical Image Processing we spend a lot of our time debugging
> issues related to how image volumes are oriented/organized with
> respect to anatomy.  In C++ programming, you spend a lot of your time
> debugging template programming, which produces awful error messages
> when it goes wrong.  In any shell/scripting language (which CMake is,
> at least in part) you devote a lot of time to where to put things in
> quotes, how to deal with spaces inside tokens, etc.
> 
> On Tue, Jul 20, 2010 at 4:30 PM, Andreas Pakulat  wrote:
>> On 20.07.10 16:18:26, kent williams wrote:
>>> 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!
>> 
>> It doesn't need to be explicit if you've understood cmake variables (yes
>> thats not exactly and easy and straight-forward topic). The problem is
>> that when you have multiple values in a varialy "xyz" and you pass it as
>> ${xyz} to the function, it'll get expanded and as
>> set_source_files_properties allows multiple properties to be set it
>> takes the second (third, fourth etc.) element of the list you've passed
>> in as next property name instead of value to the first property. Using
>> the quotes you make sure that cmake understands that all individual
>> elements from the list belong to the same "value" position in the call
>> to the set-function.
>> 
>> Andreas

Thats why I am very liberal with quoting (even if it isn't strictly necessary) 
and only leave it away if I specifically WANT special behavior. Much easier to 
remember and less surprises...


Michael
___
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


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

2010-07-22 Thread kent williams
It's perfectly clear to me now, but I bet I'm not the first (or last!)
person to run into issues like this and get roadblocked.

Every software task seems to have its stumbling block.

In Medical Image Processing we spend a lot of our time debugging
issues related to how image volumes are oriented/organized with
respect to anatomy.  In C++ programming, you spend a lot of your time
debugging template programming, which produces awful error messages
when it goes wrong.  In any shell/scripting language (which CMake is,
at least in part) you devote a lot of time to where to put things in
quotes, how to deal with spaces inside tokens, etc.

On Tue, Jul 20, 2010 at 4:30 PM, Andreas Pakulat  wrote:
> On 20.07.10 16:18:26, kent williams wrote:
>> 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!
>
> It doesn't need to be explicit if you've understood cmake variables (yes
> thats not exactly and easy and straight-forward topic). The problem is
> that when you have multiple values in a varialy "xyz" and you pass it as
> ${xyz} to the function, it'll get expanded and as
> set_source_files_properties allows multiple properties to be set it
> takes the second (third, fourth etc.) element of the list you've passed
> in as next property name instead of value to the first property. Using
> the quotes you make sure that cmake understands that all individual
> elements from the list belong to the same "value" position in the call
> to the set-function.
>
> Andreas
>
> --
> You are going to have a new love affair.
> ___
> 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
>
___
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


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

2010-07-20 Thread Andreas Pakulat
On 20.07.10 16:18:26, kent williams wrote:
> 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!

It doesn't need to be explicit if you've understood cmake variables (yes
thats not exactly and easy and straight-forward topic). The problem is
that when you have multiple values in a varialy "xyz" and you pass it as
${xyz} to the function, it'll get expanded and as
set_source_files_properties allows multiple properties to be set it
takes the second (third, fourth etc.) element of the list you've passed
in as next property name instead of value to the first property. Using
the quotes you make sure that cmake understands that all individual
elements from the list belong to the same "value" position in the call
to the set-function.

Andreas

-- 
You are going to have a new love affair.
___
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


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

2010-07-20 Thread kent williams
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  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
>
___
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


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

2010-07-20 Thread Andreas Pakulat
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


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

2010-07-20 Thread kent williams
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.

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.

On Tue, Jul 20, 2010 at 3:26 PM, John Drescher  wrote:
> On Tue, Jul 20, 2010 at 4:09 PM, kent williams
>  wrote:
>> Thanks.  I don't know if you've actually tried the project I put up to
>> illustrate the project, but while what you say makes sense, it doesn't
>> appear to fix the problem.
>>
>> It's frustrating for me; apparently, though I'm following exactly the
>> pattern that's reputed to work, CMake isn't generating the Makefile
>> code to deal with the second .ui file.
>>
>> Either there's something wrong in CMake, or I'm somehow missing
>> something in what should be a really simple CMakeLists.txt.
>>
>
> I do not do globbing. I just add the result of QT4_WRAP_UI to my target
>
>
> SET( ${PROJECT_NAME}_SRCS
>        ./src/main.cxx
>        ./src/mainwindow.cxx
>        ./src/textwidget.cxx
>        ./src/upmcLungApp.cxx
>        ./src/AppSettingsDlg.cxx
>        ./src/laFileMenu.cxx
>  )
>
> SET( ${PROJECT_NAME}_MOC_HDR
>        ./Include/mainwindow.h
>        ./Include/textwidget.h
>        ./Include/upmcLungApp.h
>        ./Include/AppSettingsDlg.h
>        ./Include/laFileMenu.h
> )
>
> SET( ${PROJECT_NAME}_HDRS
>        ./Include/ClickedPointEvent.h
>        ./Include/${PROJECT_NAME}Constants.h
>        ./Include/sliceOrientation.h
> )
>
> #
>
> MSVC_PCH_SUPPORT(${PROJECT_NAME})
>
> # some .ui files
> SET( ${PROJECT_NAME}_UIS
>        ./rc/AppSettings.ui
> )
>
> # and finally an resource file
> SET( ${PROJECT_NAME}_RCS
>        ./rc/${PROJECT_NAME}.qrc
> )
>
> # this command will generate rules that will run rcc on all files from
> ${PROJECT_NAME}_RCS
> # in result ${PROJECT_NAME}_RC_SRCS variable will contain paths to
> files produced by rcc
> QT4_ADD_RESOURCES( ${PROJECT_NAME}_RC_SRCS ${${PROJECT_NAME}_RCS} )
>
> # and finally this will run moc:
> QT4_WRAP_CPP( ${PROJECT_NAME}_MOC_SRCS ${${PROJECT_NAME}_MOC_HDR} )
>
> # this will run uic on .ui files:
> QT4_WRAP_UI( ${PROJECT_NAME}_UI_HDRS ${${PROJECT_NAME}_UIS} )
>
> SOURCE_GROUP("Generated" FILES
>          ${${PROJECT_NAME}_RC_SRCS}
>          ${${PROJECT_NAME}_MOC_SRCS}
>          ${${PROJECT_NAME}_UI_HDRS}
> )
>
> SOURCE_GROUP("Resources" FILES
>          ${${PROJECT_NAME}_UIS}
>          ${${PROJECT_NAME}_RCS}
> )
>
> #
>
>
> ADD_EXECUTABLE( ${PROJECT_NAME} ${${PROJECT_NAME}_SRCS}
> ${${PROJECT_NAME}_MOC_SRCS} ${${PROJECT_NAME}_HDRS}
>                ${${PROJECT_NAME}_MOC_HDR} ${${PROJECT_NAME}_RC_SRCS}
> ${${PROJECT_NAME}_UI_HDRS}
> )
>
>
> Right now I am doing all of my development in Visual Studio. In the
> past this project did build under linux.
>
> John
>
___
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


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

2010-07-20 Thread John Drescher
On Tue, Jul 20, 2010 at 4:09 PM, kent williams
 wrote:
> Thanks.  I don't know if you've actually tried the project I put up to
> illustrate the project, but while what you say makes sense, it doesn't
> appear to fix the problem.
>
> It's frustrating for me; apparently, though I'm following exactly the
> pattern that's reputed to work, CMake isn't generating the Makefile
> code to deal with the second .ui file.
>
> Either there's something wrong in CMake, or I'm somehow missing
> something in what should be a really simple CMakeLists.txt.
>

I do not do globbing. I just add the result of QT4_WRAP_UI to my target


SET( ${PROJECT_NAME}_SRCS
./src/main.cxx
./src/mainwindow.cxx
./src/textwidget.cxx
./src/upmcLungApp.cxx
./src/AppSettingsDlg.cxx
./src/laFileMenu.cxx
  )

SET( ${PROJECT_NAME}_MOC_HDR
./Include/mainwindow.h
./Include/textwidget.h
./Include/upmcLungApp.h
./Include/AppSettingsDlg.h
./Include/laFileMenu.h
)

SET( ${PROJECT_NAME}_HDRS
./Include/ClickedPointEvent.h
./Include/${PROJECT_NAME}Constants.h
./Include/sliceOrientation.h
)

#

MSVC_PCH_SUPPORT(${PROJECT_NAME})

# some .ui files
SET( ${PROJECT_NAME}_UIS
./rc/AppSettings.ui
)

# and finally an resource file
SET( ${PROJECT_NAME}_RCS
./rc/${PROJECT_NAME}.qrc
)

# this command will generate rules that will run rcc on all files from
${PROJECT_NAME}_RCS
# in result ${PROJECT_NAME}_RC_SRCS variable will contain paths to
files produced by rcc
QT4_ADD_RESOURCES( ${PROJECT_NAME}_RC_SRCS ${${PROJECT_NAME}_RCS} )

# and finally this will run moc:
QT4_WRAP_CPP( ${PROJECT_NAME}_MOC_SRCS ${${PROJECT_NAME}_MOC_HDR} )

# this will run uic on .ui files:
QT4_WRAP_UI( ${PROJECT_NAME}_UI_HDRS ${${PROJECT_NAME}_UIS} )

SOURCE_GROUP("Generated" FILES
  ${${PROJECT_NAME}_RC_SRCS}
  ${${PROJECT_NAME}_MOC_SRCS}
  ${${PROJECT_NAME}_UI_HDRS}
)

SOURCE_GROUP("Resources" FILES
  ${${PROJECT_NAME}_UIS}
  ${${PROJECT_NAME}_RCS}
)

#


ADD_EXECUTABLE( ${PROJECT_NAME} ${${PROJECT_NAME}_SRCS}
${${PROJECT_NAME}_MOC_SRCS} ${${PROJECT_NAME}_HDRS}
${${PROJECT_NAME}_MOC_HDR} ${${PROJECT_NAME}_RC_SRCS}
${${PROJECT_NAME}_UI_HDRS}
)


Right now I am doing all of my development in Visual Studio. In the
past this project did build under linux.

John
___
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


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

2010-07-20 Thread kent williams
Thanks.  I don't know if you've actually tried the project I put up to
illustrate the project, but while what you say makes sense, it doesn't
appear to fix the problem.

It's frustrating for me; apparently, though I'm following exactly the
pattern that's reputed to work, CMake isn't generating the Makefile
code to deal with the second .ui file.

Either there's something wrong in CMake, or I'm somehow missing
something in what should be a really simple CMakeLists.txt.

On Tue, Jul 20, 2010 at 2:52 PM, Michael Wild  wrote:
>
> Hi
>
> I hope the inline comments below solve your problems. And please, don't 
> cross-post...
>
> On 20. Jul, 2010, at 19:06 , kent williams wrote:
>
>> This is with cmake version 2.8.1 on OS X 10.6.
>>
>> I had a project using CMake and Qt.  As long as I only used one QT
>> Designer-generated .ui file, everything worked perfectly. When I added
>> as second UI file, things no longer worked. I was working from the
>> CMake + Qt4 examples on the web.
>>
>> There are two problems:
>>
>> 1. If you give a list of more than one header file as the dependency
>> on set_source_files_properties, it throws a configure-time error:
>>
>>
>> CMake Error at CMakeLists.txt:33 (set_source_files_properties):
>>  set_source_files_properties called with incorrect number of arguments.
>>
>> 2. If I work around that error (by setting each header dependency
>> individually), then only one of the UI files seems to get processed to
>> create the corresponding C++ header file:
>>
>> /scratch/kent/qtcmake/src/QTCMake.cxx:4:35: error:
>> ui_qvtkpropertydialog.h: No such file or directory
>>
>> I've put a succinct example illustrating the problem I'm having here:
>> http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
>>
>> The CMakeLists.txt file is as follows:
>>
>> project(QTCMake)
>> cmake_minimum_required(VERSION 2.8)
>>
>> #uses QT4 and associated CMake Macros
>> find_package( Qt4 REQUIRED )
>> include(${QT_USE_FILE})
>> set(QT_USE_QTXML 1)
>>
>>
>> #dummy test program
>> set(QTCMake_SRC QTCMake.cxx)
>>
>>
>> # list of QT Designer-generated XML designs
>> set(QTCMake_UIS
>> qvtkpropertydialog.ui qimagetransformdialog.ui
>> )
>>
>> #
>> # this is supposed to wrap all the UI files
>> QT4_WRAP_UI(UIHeaders ${QTCMake_UIS} )
>>
>> include_directories(${CMAKE_CURRENT_BINARY_DIR})
>>
>> add_executable(QTCMake ${QTCMake_SRC})
>>
>> if(GUMBY)
>> #
>> # unless I misunderstood, this should make the objects
>> # depend on the headers generated by UIC.
>> # This doesn't work as it should; I don't know why
>> set_source_files_properties(${QTCMake_SRC}
>> PROPERTIES OBJECT_DEPENDS ${UIHeaders})
>
> Just wrap ${UIHeaders} in quotes:
>
> set_source_files_properties(${QTCMake_SRC} PROPERTIES
>  OBJECT_DEPENDS "${UIHeaders}")
>
>>
>> else()
>> #
>> # this loops through the list of ui_*.h, and adds the dependency
>> # for each.
>> foreach(hdr ${UIHeaders})
>> set_source_files_properties(${QTCMake_SRC}
>> PROPERTIES
>> OBJECT_DEPENDS ${hdr})
>> endforeach()
>
> This loop isn't going to append to the list of dependencies, it overwrites 
> the previous value instead. If you want appending, you have to use the 
> following instead:
>
> foreach(hdr IN LISTS UIHeaders)
>  set_property(SOURCE ${QTCMake_SRC} APPEND PROPERTY
>    OBJECT_DEPENDS ${hdr})
> endforeach()
>
>>
>> endif()
>>
>
> HTH
>
> Michael
>
>
___
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


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

2010-07-20 Thread Michael Wild

Hi

I hope the inline comments below solve your problems. And please, don't 
cross-post...

On 20. Jul, 2010, at 19:06 , kent williams wrote:

> This is with cmake version 2.8.1 on OS X 10.6.
> 
> I had a project using CMake and Qt.  As long as I only used one QT
> Designer-generated .ui file, everything worked perfectly. When I added
> as second UI file, things no longer worked. I was working from the
> CMake + Qt4 examples on the web.
> 
> There are two problems:
> 
> 1. If you give a list of more than one header file as the dependency
> on set_source_files_properties, it throws a configure-time error:
> 
> 
> CMake Error at CMakeLists.txt:33 (set_source_files_properties):
>  set_source_files_properties called with incorrect number of arguments.
> 
> 2. If I work around that error (by setting each header dependency
> individually), then only one of the UI files seems to get processed to
> create the corresponding C++ header file:
> 
> /scratch/kent/qtcmake/src/QTCMake.cxx:4:35: error:
> ui_qvtkpropertydialog.h: No such file or directory
> 
> I've put a succinct example illustrating the problem I'm having here:
> http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
> 
> The CMakeLists.txt file is as follows:
> 
> project(QTCMake)
> cmake_minimum_required(VERSION 2.8)
> 
> #uses QT4 and associated CMake Macros
> find_package( Qt4 REQUIRED )
> include(${QT_USE_FILE})
> set(QT_USE_QTXML 1)
> 
> 
> #dummy test program
> set(QTCMake_SRC QTCMake.cxx)
> 
> 
> # list of QT Designer-generated XML designs
> set(QTCMake_UIS
> qvtkpropertydialog.ui qimagetransformdialog.ui
> )
> 
> #
> # this is supposed to wrap all the UI files
> QT4_WRAP_UI(UIHeaders ${QTCMake_UIS} )
> 
> include_directories(${CMAKE_CURRENT_BINARY_DIR})
> 
> add_executable(QTCMake ${QTCMake_SRC})
> 
> if(GUMBY)
> #
> # unless I misunderstood, this should make the objects
> # depend on the headers generated by UIC.
> # This doesn't work as it should; I don't know why
> set_source_files_properties(${QTCMake_SRC}
> PROPERTIES OBJECT_DEPENDS ${UIHeaders})

Just wrap ${UIHeaders} in quotes:

set_source_files_properties(${QTCMake_SRC} PROPERTIES
  OBJECT_DEPENDS "${UIHeaders}")

> 
> else()
> #
> # this loops through the list of ui_*.h, and adds the dependency
> # for each.
> foreach(hdr ${UIHeaders})
> set_source_files_properties(${QTCMake_SRC}
> PROPERTIES
> OBJECT_DEPENDS ${hdr})
> endforeach()

This loop isn't going to append to the list of dependencies, it overwrites the 
previous value instead. If you want appending, you have to use the following 
instead:

foreach(hdr IN LISTS UIHeaders)
  set_property(SOURCE ${QTCMake_SRC} APPEND PROPERTY
OBJECT_DEPENDS ${hdr})
endforeach()

> 
> endif()
> 

HTH

Michael

___
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


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

2010-07-20 Thread kent williams
http://www.cornwarning.com/xfer/QTCMakeTest.tar.gz

Sorry for the trouble. Safari has a feature, whereby if I type in a
URL to test it, it will initiate a successful download, but then
change the URL in the URL entry box to the incorrect URL.

Steve Jobs wants to ruin my life, and every day he does it in more
subtle devious ways.

On Tue, Jul 20, 2010 at 1:53 PM, John Drescher  wrote:
> On Tue, Jul 20, 2010 at 2:48 PM, Andreas Pakulat  wrote:
>> On 20.07.10 13:30:51, kent williams wrote:
>>> Let's try that again http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
>>
>> Still the same.
>
> Same here. I get a cute image that says "Sorry Sam, I can't seem to
> find that URL."
>
> John
> ___
> 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
>
___
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


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

2010-07-20 Thread John Drescher
On Tue, Jul 20, 2010 at 2:48 PM, Andreas Pakulat  wrote:
> On 20.07.10 13:30:51, kent williams wrote:
>> Let's try that again http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
>
> Still the same.

Same here. I get a cute image that says "Sorry Sam, I can't seem to
find that URL."

John
___
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


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

2010-07-20 Thread Andreas Pakulat
On 20.07.10 13:30:51, kent williams wrote:
> Let's try that again http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz

Still the same.

Andreas

-- 
You will contract a rare disease.
___
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


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

2010-07-20 Thread kent williams
Let's try that again http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz


On Tue, Jul 20, 2010 at 1:20 PM, kent williams
 wrote:
> Sorry -- thanks for trying though.
>
> http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
>
> On Tue, Jul 20, 2010 at 1:00 PM, Andreas Pakulat  wrote:
>> On 20.07.10 12:06:11, kent williams wrote:
>>> This is with cmake version 2.8.1 on OS X 10.6.
>>>
>>> I had a project using CMake and Qt.  As long as I only used one QT
>>> Designer-generated .ui file, everything worked perfectly. When I added
>>> as second UI file, things no longer worked. I was working from the
>>> CMake + Qt4 examples on the web.
>>>
>>> There are two problems:
>>>
>>> 1. If you give a list of more than one header file as the dependency
>>> on set_source_files_properties, it throws a configure-time error:
>>>
>>>
>>> CMake Error at CMakeLists.txt:33 (set_source_files_properties):
>>>   set_source_files_properties called with incorrect number of arguments.
>>>
>>> 2. If I work around that error (by setting each header dependency
>>> individually), then only one of the UI files seems to get processed to
>>> create the corresponding C++ header file:
>>>
>>> /scratch/kent/qtcmake/src/QTCMake.cxx:4:35: error:
>>> ui_qvtkpropertydialog.h: No such file or directory
>>>
>>> I've put a succinct example illustrating the problem I'm having here:
>>> http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
>>
>> That url gives a 404.
>>
>>> The CMakeLists.txt file is as follows:
>>>
>>> project(QTCMake)
>>> cmake_minimum_required(VERSION 2.8)
>>>
>>> #uses QT4 and associated CMake Macros
>>> find_package( Qt4 REQUIRED )
>>> include(${QT_USE_FILE})
>>> set(QT_USE_QTXML 1)
>>>
>>>
>>> #dummy test program
>>> set(QTCMake_SRC QTCMake.cxx)
>>>
>>>
>>> # list of QT Designer-generated XML designs
>>> set(QTCMake_UIS
>>> qvtkpropertydialog.ui qimagetransformdialog.ui
>>> )
>>>
>>> #
>>> # this is supposed to wrap all the UI files
>>> QT4_WRAP_UI(UIHeaders ${QTCMake_UIS} )
>>
>>
>>> include_directories(${CMAKE_CURRENT_BINARY_DIR})
>>>
>>> add_executable(QTCMake ${QTCMake_SRC})
>>
>> Usually you'd also add the UIHeaders to the list of sources. I'm using
>> qt4_wrap_ui+qt4_automoc and add_executable and nothing else and
>> ui-headers are being generated just fine.
>>
>> Andreas
>>
>> --
>> Your depth of comprehension may tend to make you lax in worldly ways.
>> ___
>> 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
>>
>
___
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


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

2010-07-20 Thread kent williams
Sorry -- thanks for trying though.

http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz

On Tue, Jul 20, 2010 at 1:00 PM, Andreas Pakulat  wrote:
> On 20.07.10 12:06:11, kent williams wrote:
>> This is with cmake version 2.8.1 on OS X 10.6.
>>
>> I had a project using CMake and Qt.  As long as I only used one QT
>> Designer-generated .ui file, everything worked perfectly. When I added
>> as second UI file, things no longer worked. I was working from the
>> CMake + Qt4 examples on the web.
>>
>> There are two problems:
>>
>> 1. If you give a list of more than one header file as the dependency
>> on set_source_files_properties, it throws a configure-time error:
>>
>>
>> CMake Error at CMakeLists.txt:33 (set_source_files_properties):
>>   set_source_files_properties called with incorrect number of arguments.
>>
>> 2. If I work around that error (by setting each header dependency
>> individually), then only one of the UI files seems to get processed to
>> create the corresponding C++ header file:
>>
>> /scratch/kent/qtcmake/src/QTCMake.cxx:4:35: error:
>> ui_qvtkpropertydialog.h: No such file or directory
>>
>> I've put a succinct example illustrating the problem I'm having here:
>> http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz
>
> That url gives a 404.
>
>> The CMakeLists.txt file is as follows:
>>
>> project(QTCMake)
>> cmake_minimum_required(VERSION 2.8)
>>
>> #uses QT4 and associated CMake Macros
>> find_package( Qt4 REQUIRED )
>> include(${QT_USE_FILE})
>> set(QT_USE_QTXML 1)
>>
>>
>> #dummy test program
>> set(QTCMake_SRC QTCMake.cxx)
>>
>>
>> # list of QT Designer-generated XML designs
>> set(QTCMake_UIS
>> qvtkpropertydialog.ui qimagetransformdialog.ui
>> )
>>
>> #
>> # this is supposed to wrap all the UI files
>> QT4_WRAP_UI(UIHeaders ${QTCMake_UIS} )
>
>
>> include_directories(${CMAKE_CURRENT_BINARY_DIR})
>>
>> add_executable(QTCMake ${QTCMake_SRC})
>
> Usually you'd also add the UIHeaders to the list of sources. I'm using
> qt4_wrap_ui+qt4_automoc and add_executable and nothing else and
> ui-headers are being generated just fine.
>
> Andreas
>
> --
> Your depth of comprehension may tend to make you lax in worldly ways.
> ___
> 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
>
___
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


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

2010-07-20 Thread Andreas Pakulat
On 20.07.10 12:06:11, kent williams wrote:
> This is with cmake version 2.8.1 on OS X 10.6.
> 
> I had a project using CMake and Qt.  As long as I only used one QT
> Designer-generated .ui file, everything worked perfectly. When I added
> as second UI file, things no longer worked. I was working from the
> CMake + Qt4 examples on the web.
> 
> There are two problems:
> 
> 1. If you give a list of more than one header file as the dependency
> on set_source_files_properties, it throws a configure-time error:
> 
> 
> CMake Error at CMakeLists.txt:33 (set_source_files_properties):
>   set_source_files_properties called with incorrect number of arguments.
> 
> 2. If I work around that error (by setting each header dependency
> individually), then only one of the UI files seems to get processed to
> create the corresponding C++ header file:
> 
> /scratch/kent/qtcmake/src/QTCMake.cxx:4:35: error:
> ui_qvtkpropertydialog.h: No such file or directory
> 
> I've put a succinct example illustrating the problem I'm having here:
> http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz

That url gives a 404.

> The CMakeLists.txt file is as follows:
> 
> project(QTCMake)
> cmake_minimum_required(VERSION 2.8)
> 
> #uses QT4 and associated CMake Macros
> find_package( Qt4 REQUIRED )
> include(${QT_USE_FILE})
> set(QT_USE_QTXML 1)
> 
> 
> #dummy test program
> set(QTCMake_SRC QTCMake.cxx)
> 
> 
> # list of QT Designer-generated XML designs
> set(QTCMake_UIS
> qvtkpropertydialog.ui qimagetransformdialog.ui
> )
> 
> #
> # this is supposed to wrap all the UI files
> QT4_WRAP_UI(UIHeaders ${QTCMake_UIS} )


> include_directories(${CMAKE_CURRENT_BINARY_DIR})
> 
> add_executable(QTCMake ${QTCMake_SRC})

Usually you'd also add the UIHeaders to the list of sources. I'm using
qt4_wrap_ui+qt4_automoc and add_executable and nothing else and
ui-headers are being generated just fine.

Andreas

-- 
Your depth of comprehension may tend to make you lax in worldly ways.
___
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


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

2010-07-20 Thread kent williams
This is with cmake version 2.8.1 on OS X 10.6.

I had a project using CMake and Qt.  As long as I only used one QT
Designer-generated .ui file, everything worked perfectly. When I added
as second UI file, things no longer worked. I was working from the
CMake + Qt4 examples on the web.

There are two problems:

1. If you give a list of more than one header file as the dependency
on set_source_files_properties, it throws a configure-time error:


CMake Error at CMakeLists.txt:33 (set_source_files_properties):
  set_source_files_properties called with incorrect number of arguments.

2. If I work around that error (by setting each header dependency
individually), then only one of the UI files seems to get processed to
create the corresponding C++ header file:

/scratch/kent/qtcmake/src/QTCMake.cxx:4:35: error:
ui_qvtkpropertydialog.h: No such file or directory

I've put a succinct example illustrating the problem I'm having here:
http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz

The CMakeLists.txt file is as follows:

project(QTCMake)
cmake_minimum_required(VERSION 2.8)

#uses QT4 and associated CMake Macros
find_package( Qt4 REQUIRED )
include(${QT_USE_FILE})
set(QT_USE_QTXML 1)


#dummy test program
set(QTCMake_SRC QTCMake.cxx)


# list of QT Designer-generated XML designs
set(QTCMake_UIS
qvtkpropertydialog.ui qimagetransformdialog.ui
)

#
# this is supposed to wrap all the UI files
QT4_WRAP_UI(UIHeaders ${QTCMake_UIS} )

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_executable(QTCMake ${QTCMake_SRC})

if(GUMBY)
#
# unless I misunderstood, this should make the objects
# depend on the headers generated by UIC.
# This doesn't work as it should; I don't know why
set_source_files_properties(${QTCMake_SRC}
PROPERTIES OBJECT_DEPENDS ${UIHeaders})

else()
#
# this loops through the list of ui_*.h, and adds the dependency
# for each.
foreach(hdr ${UIHeaders})
set_source_files_properties(${QTCMake_SRC}
PROPERTIES
OBJECT_DEPENDS ${hdr})
endforeach()

endif()
___
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