Browse Source

Clean-up dependency chain for the windows installer

Tobias Hieta 9 years ago
parent
commit
38aa3555ba
2 changed files with 14 additions and 15 deletions
  1. 14 14
      CMakeModules/WindowsInstaller.cmake
  2. 0 1
      src/CMakeLists.txt

+ 14 - 14
CMakeModules/WindowsInstaller.cmake

@@ -11,7 +11,7 @@ set(WIX_VARIABLES -dDeploymentPath="${CMAKE_INSTALL_PREFIX}" -dOutputPath="${CMA
 include(CMakeParseArguments)
 
 function(wix_harvest_directory dir fragment)
-  set(ARGS REFVARIABLE CGROUP)
+  set(ARGS REFVARIABLE CGROUP DEPENDS)
   cmake_parse_arguments(_WHD "" "${ARGS}" "" ${ARGN})
   
   if(NOT _WHD_REFVARIABLE)
@@ -22,11 +22,12 @@ function(wix_harvest_directory dir fragment)
     set(CGROUP -cg ${_WHD_CGROUP})
   endif()
   
-  if(IS_DIRECTORY ${dir})
-    add_custom_command(OUTPUT ${fragment}
-                       COMMAND ${WIX_HEAT} dir "${dir}" -srd -nologo -sw5150 ${CGROUP} -dr ${_WHD_REFVARIABLE} -ag -out ${fragment} -var var.DeploymentPath
-                       COMMENT "Harvesting dir ${dir} to ${fragment}")
-  endif()
+  add_custom_command(OUTPUT ${fragment}
+                     DEPENDS ${_WHD_DEPENDS}
+                     COMMAND ${WIX_HEAT} dir "${dir}" -srd -nologo -sw5150 ${CGROUP} -dr ${_WHD_REFVARIABLE} -ag -out ${fragment} -var var.DeploymentPath
+                     COMMENT "Harvesting dir ${dir} to ${fragment}")
+  add_custom_target(heat_${fragment} DEPENDS ${fragment})
+  
 endfunction()
 
 function(wix_get_extension VARIABLE)
@@ -119,7 +120,12 @@ function(wix_create_installer output)
             TARGET ${_WCI_TARGET})
 endfunction()
 
-wix_harvest_directory("${CMAKE_INSTALL_PREFIX}" "files.wxs" CGROUP ProgramFilesComponentGroup)
+add_custom_target(wix_install
+                  COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake > wix_install.log
+                  COMMENT "Copying files..."
+                  DEPENDS PMPHelper PlexMediaPlayer)
+
+wix_harvest_directory("${CMAKE_INSTALL_PREFIX}" files.wxs CGROUP ProgramFilesComponentGroup DEPENDS wix_install)
 
 wix_create_installer(PMP.msi 
                      WXS_FILES files.wxs "${PROJECT_SOURCE_DIR}/bundle/win/PMP.wxs"
@@ -134,10 +140,4 @@ wix_create_installer(PlexMediaPlayer-${VERSION_STRING}-windows-x64.exe
                      BASEDIR "${PROJECT_SOURCE_DIR}/bundle/win"
 )
 
-add_custom_target(wix_install
-                  COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake > wix_install.log
-                  DEPENDS PlexMediaPlayer PMPHelper
-                  COMMENT Installing files...)
-                  
-add_custom_target(windows_package
-                  DEPENDS wix_install PlexMediaPlayerInstaller)
+add_custom_target(windows_package DEPENDS PlexMediaPlayerInstaller)

+ 0 - 1
src/CMakeLists.txt

@@ -122,7 +122,6 @@ set(MACOSX_BUNDLE_GUI_IDENTIFIER tv.plex.player)
 
 if(WIN32)
   list(APPEND RESOURCE_FILES ${CMAKE_SOURCE_DIR}/bundle/win/iconres.rc)
-  install(PROGRAMS ${CMAKE_BINARY_DIR}/updater.exe DESTINATION ${INSTALL_BIN_DIR})
 endif()
 
 get_property(BUNDLED_FILES GLOBAL PROPERTY CONFIG_BUNDLED_FILES)