← Back to team overview

unity-dev team mailing list archive

Re: [Ayatana-dev] Debugging Unity-2d QML

 

On Tuesday, April 12, 2011 02:11:12 PM Ugo Riboni wrote:
> On 04/12/2011 02:31 PM, Richard Dale wrote:
> > On Monday, April 11, 2011 04:57:44 PM Ugo Riboni wrote:
> >>   >  On the other hand, if I try and run unity-2d-spread from qt creator
> >>   >  it
> >>> 
> >>> doesn't start properly, and doesn't log anything in the Application
> >>> Output pane to explain why either. I had assumed this was because it
> >>> wasn't running as root.
> >> 
> >> I normally run all the unity-2d-* applications from qtcreator in debug
> >> or non debug mode without trouble.
> >> What do you mean that "it doesn't start properly" ? There's no process
> >> launched or the process is there but you see no output ? Or something
> >> else ?
> > 
> > The problem was that I was building unity-2d outside of the source tree,
> > in unity-2d/build. The code for isRunningInstalled() and
> > unity2dDirectory() is assuming that the project has been built 'in situ'
> > in the source tree. I needed to copy the qmldir files, qml files and
> > icons across to the build area. It should be possible to add some
> > statements to the CMakeLists.txt files to do that automatically (or I'll
> > just switch to building in the source tree).
> 
> Well, we support running installed, or running from a build inside the
> source directory itself.
> We don't currently support running from separate build directories.
> 
> I suggest you pick one of the two choices above instead of changing the
> environment so much, as it makes it more difficult to figure out what
> problems are caused by your changes and what are actual bugs.
Yes, good point. I will build in the source dir if there seems any doubt that 
I have made changes that give spurious bugs.

> I would personally like running from separate build dirs, but this is at
> present not supported and not a priority, so I just run from the same
> source dir. If you do so, "bzr clean-tree" and "bzr clean-tree
> --ignored" are your friend in case you want to return to a pristine state.
I think you're right about it not being a high priority, but please find an a 
patch attached that copies the qmldir, qml and icon files into the build area 
so that the apps can be run from there. Maybe something similar needs to be 
done for the translation files, I'm not sure, but for normal debugging 
everything seems to work fine.

The patch just adds some rules like this to copy the files across:

file(COPY ${launcher_QML} DESTINATION ${CMAKE_BINARY_DIR}/launcher)

I don't mind at all if the patch isn't commited, but maybe someone would like 
to experiment.

-- Richard
=== modified file 'launcher/CMakeLists.txt'
--- launcher/CMakeLists.txt	2011-03-10 14:41:46 +0000
+++ launcher/CMakeLists.txt	2011-04-13 10:17:25 +0000
@@ -10,6 +10,8 @@
 add_subdirectory(tests)
 
 file(GLOB launcher_QML *.qml)
+file(COPY ${launcher_QML} DESTINATION ${CMAKE_BINARY_DIR}/launcher)
+file(COPY artwork DESTINATION ${CMAKE_BINARY_DIR}/launcher)
 
 # Install
 install(FILES ${launcher_QML} launchermenu.css

=== modified file 'launcher/UnityApplications/CMakeLists.txt'
--- launcher/UnityApplications/CMakeLists.txt	2011-03-22 22:55:11 +0000
+++ launcher/UnityApplications/CMakeLists.txt	2011-04-13 08:56:08 +0000
@@ -48,6 +48,7 @@
     )
 
 qt4_wrap_cpp(UnityApplications_MOC_SRCS ${UnityApplications_MOC_HDRS})
+file(COPY qmldir DESTINATION ${CMAKE_BINARY_DIR}/launcher/UnityApplications)
 
 # Build
 add_definitions(-DWNCK_I_KNOW_THIS_IS_UNSTABLE -DSN_API_NOT_YET_FROZEN)

=== modified file 'libunity-2d-private/Unity2d/CMakeLists.txt'
--- libunity-2d-private/Unity2d/CMakeLists.txt	2011-02-17 12:04:10 +0000
+++ libunity-2d-private/Unity2d/CMakeLists.txt	2011-04-13 09:42:39 +0000
@@ -31,6 +31,7 @@
     )
 
 qt4_wrap_cpp(unity-2d-private-qml_MOC_SRCS ${unity-2d-private-qml_MOC_HDRS})
+file(COPY qmldir DESTINATION ${CMAKE_BINARY_DIR}/libunity-2d-private/Unity2d)
 
 # Build
 add_library(unity-2d-private-qml SHARED ${unity-2d-private-qml_SRCS} ${unity-2d-private-qml_MOC_SRCS})

=== modified file 'panel/CMakeLists.txt'
--- panel/CMakeLists.txt	2011-02-02 16:57:00 +0000
+++ panel/CMakeLists.txt	2011-04-13 10:12:47 +0000
@@ -9,6 +9,8 @@
 add_subdirectory(app)
 add_subdirectory(tests)
 
+file(COPY artwork DESTINATION ${CMAKE_BINARY_DIR}/panel)
+
 # Install
 install(DIRECTORY artwork
     DESTINATION ${UNITY_2D_DIR}/panel

=== modified file 'places/CMakeLists.txt'
--- places/CMakeLists.txt	2011-01-27 09:30:14 +0000
+++ places/CMakeLists.txt	2011-04-13 10:12:47 +0000
@@ -4,6 +4,8 @@
 add_subdirectory(app)
 
 file(GLOB places_QML *.qml *.js)
+file(COPY ${places_QML} DESTINATION ${CMAKE_BINARY_DIR}/places)
+file(COPY artwork DESTINATION ${CMAKE_BINARY_DIR}/places)
 
 # Install
 install(FILES ${places_QML}

=== modified file 'spread/CMakeLists.txt'
--- spread/CMakeLists.txt	2011-02-08 16:29:21 +0000
+++ spread/CMakeLists.txt	2011-04-13 13:26:18 +0000
@@ -4,6 +4,7 @@
 add_subdirectory(app)
 
 file(GLOB spread_QML *.qml *.js)
+file(COPY ${spread_QML} DESTINATION ${CMAKE_BINARY_DIR}/spread)
 
 # Install
 install(FILES ${spread_QML}



References