Browse Source

Fixed correct installation path of the web-client on non-osx

The copy_resources() command have probably never been used on anything
but OSX so it had some strange logic there.

We also have to install the web-client sources on non osx since its not
copied as part of a bundle.
Tobias Hieta 7 years ago
parent
commit
9d804c6724
2 changed files with 10 additions and 5 deletions
  1. 4 2
      CMakeModules/utils.cmake
  2. 6 3
      src/CMakeLists.txt

+ 4 - 2
CMakeModules/utils.cmake

@@ -22,10 +22,12 @@ function(copy_resources target)
   # in the output field, and this is still cleaner than hardcoding the path
   # of the output binary.
   #  
-  get_property(_LOC TARGET ${target} PROPERTY LOCATION)
+  get_property(TARGET_LOC TARGET ${target} PROPERTY LOCATION)
+  get_filename_component(TARGET_DIR ${TARGET_LOC} DIRECTORY)
   if(APPLE)
-    get_filename_component(TARGET_DIR ${_LOC} DIRECTORY)
     set(TARGET_LOC ${TARGET_DIR}/..)
+  else()
+    set(TARGET_LOC ${TARGET_DIR})
   endif()
   
   if(RESOURCE_LIST)

+ 6 - 3
src/CMakeLists.txt

@@ -90,7 +90,7 @@ list(APPEND RESOURCE_FILES qrc_resources.cpp)
 
 if(APPLE)
   if(HAVE_UPDATER)
-    add_resources(TARGET ${MAIN_TARGET} SOURCES ${UPDATER_PATH} DEST Resources)
+    add_resources(TARGET ${MAIN_TARGET} SOURCES ${UPDATER_PATH} DEST ${INSTALL_RESOURCE_DIR})
   endif(HAVE_UPDATER)
 
   set_source_files_properties(
@@ -100,7 +100,7 @@ if(APPLE)
 
   # copy the qt.conf so that when running PMP from a debugger it finds the plugins and QML files
   if(EXISTS ${QTROOT}/bin/qt.conf)
-    add_resources(TARGET ${MAIN_TARGET} SOURCES ${QTROOT}/bin/qt.conf DEST Resources)
+    add_resources(TARGET ${MAIN_TARGET} SOURCES ${QTROOT}/bin/qt.conf DEST ${INSTALL_RESOURCE_DIR})
   endif()
 
   set(PLISTPARSER plistparser)
@@ -116,7 +116,10 @@ if(WIN32)
   list(APPEND RESOURCE_FILES ${CMAKE_SOURCE_DIR}/bundle/win/iconres.rc)
 endif()
 
-add_resources(TARGET ${MAIN_TARGET} SOURCES ${WEB_CLIENT_DIR} DEST Resources/web-client-${WEB_CLIENT_VERSTR})
+add_resources(TARGET ${MAIN_TARGET} SOURCES ${WEB_CLIENT_DIR} DEST ${INSTALL_RESOURCE_DIR}/web-client-${WEB_CLIENT_VERSTR})
+if(NOT APPLE)
+  install(DIRECTORY ${WEB_CLIENT_DIR} DESTINATION ${INSTALL_RESOURCE_DIR})
+endif()
 
 get_property(BUNDLED_FILES GLOBAL PROPERTY CONFIG_BUNDLED_FILES)
 add_executable(${MAIN_TARGET} WIN32 MACOSX_BUNDLE ${SOURCES} ${BUNDLED_FILES} ${RESOURCE_FILES})