Browse Source

Copy a qt.conf to the local app so that it can be debugged without being installed.

Tobias Hieta 9 years ago
parent
commit
669a41872a
2 changed files with 10 additions and 0 deletions
  1. 1 0
      CMakeModules/CompleteBundleOSX.cmake.in
  2. 9 0
      src/CMakeLists.txt

+ 1 - 0
CMakeModules/CompleteBundleOSX.cmake.in

@@ -15,6 +15,7 @@ set(ENV{DYLD_LIBRARY_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
 set(ENV{DYLD_FRAMEWORK_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
 
 execute_process(
+  COMMAND ${CMAKE_COMMAND} -E remove ${app}/Contents/Resources/qt.conf
   COMMAND @QTROOT@/bin/macdeployqt ${args}
   WORKING_DIRECTORY @QTROOT@/bin
 )

+ 9 - 0
src/CMakeLists.txt

@@ -136,6 +136,15 @@ set_target_properties(${MAIN_TARGET} PROPERTIES
   CXX_STANDARD_REQUIRED TRUE
 )
 
+# copy the qt.conf so that when running PMP from a debugger it finds the plugins and QML files
+if(APPLE)
+  add_custom_command(
+    TARGET ${MAIN_TARGET} POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy ${QTROOT}/bin/qt.conf $<TARGET_FILE_DIR:${MAIN_TARGET}>/../Resources
+    COMMENT "Copy qt.conf to main bundle"
+  )
+endif(APPLE)
+
 target_link_libraries(${MAIN_TARGET}
   shared
   qhttpserver