Browse Source

Merge topic 'cpack-drag-n-drop-rez'

53d6ebb cpack: For DragNDrop generator, add sysroot option when calling Rez.
193029c cpack: For DragNDrop generator, add sysroot option when calling Rez.
Brad King 12 years ago
parent
commit
f3698f7c4a

+ 5 - 0
Modules/CPack.cmake

@@ -519,6 +519,11 @@ cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
 # WiX specific variables
 cpack_set_if_not_set(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
 
+# set sysroot so SDK tools can be used
+if(CMAKE_OSX_SYSROOT)
+  cpack_set_if_not_set(CPACK_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
+endif()
+
 if(DEFINED CPACK_COMPONENTS_ALL)
   if(CPACK_MONOLITHIC_INSTALL)
     message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")

+ 6 - 1
Source/CPack/cmCPackDragNDropGenerator.cxx

@@ -474,7 +474,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
     udco_image_command << " convert \"" << temp_image << "\"";
     udco_image_command << " -format UDCO";
-    udco_image_command << " -o \"" << temp_udco << "\"";
+    udco_image_command << " -ov -o \"" << temp_udco << "\"";
 
     std::string error;
     if(!this->RunCommand(udco_image_command, &error))
@@ -504,6 +504,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     // Rez the SLA
     cmOStringStream embed_sla_command;
     embed_sla_command << this->GetOption("CPACK_COMMAND_REZ");
+    const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT");
+    if(sysroot && sysroot[0] != '\0')
+      {
+      embed_sla_command << " -isysroot \"" << sysroot << "\"";
+      }
     embed_sla_command << " \"" << sla_r << "\"";
     embed_sla_command << " -a -o ";
     embed_sla_command << "\"" << temp_udco << "\"";

+ 2 - 1
Tests/CPackComponentsForAll/CMakeLists.txt

@@ -59,6 +59,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR "1")
 set(CPACK_PACKAGE_VERSION_MINOR "0")
 set(CPACK_PACKAGE_VERSION_PATCH "2")
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
+set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt)
 
 # Tell CPack all of the components to install. The "ALL"
 # refers to the fact that this is the set of components that
@@ -120,4 +121,4 @@ if (NOT ("${CPackComponentWay}" STREQUAL "default"))
   set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake)
 endif ()
 # Include CPack to introduce the appropriate targets
-include(CPack)
+include(CPack)

+ 3 - 0
Tests/CPackComponentsForAll/license.txt

@@ -0,0 +1,3 @@
+LICENSE
+-------
+This is an installer created using CPack (http://www.cmake.org). No license provided.