[Cmake-commits] [cmake-commits] hoffman committed CMakeLists.txt 1.16 1.17 CMakeSetup.cxx 1.18 1.19 QMacInstallDialog.cxx 1.3 1.4 postflight.sh.in 1.1 1.2

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Apr 4 16:02:52 EDT 2008


Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv7111/Source/QtDialog

Modified Files:
	CMakeLists.txt CMakeSetup.cxx QMacInstallDialog.cxx 
	postflight.sh.in 
Log Message:
ENH: install the mac application bundle into /Applications directly with no enclosing folder


Index: postflight.sh.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/postflight.sh.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** postflight.sh.in	19 Feb 2008 19:26:20 -0000	1.1
--- postflight.sh.in	4 Apr 2008 20:02:50 -0000	1.2
***************
*** 1,4 ****
  #!/bin/bash
! echo "$2/@CMAKE_INSTALL_SUBDIR@/cmake-gui.app/Contents/MacOS/cmake-gui" >>/tmp/mylog
! "$2/@CMAKE_INSTALL_SUBDIR@/cmake-gui.app/Contents/MacOS/cmake-gui" --mac-install
  exit 0
--- 1,3 ----
  #!/bin/bash
! "$2 at CMAKE_INSTALL_SUBDIR@/@CMAKE_BUNDLE_NAME at .app/Contents/MacOS/@CMAKE_BUNDLE_NAME@" --mac-install
  exit 0

Index: QMacInstallDialog.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QMacInstallDialog.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** QMacInstallDialog.cxx	3 Apr 2008 21:02:26 -0000	1.3
--- QMacInstallDialog.cxx	4 Apr 2008 20:02:50 -0000	1.4
***************
*** 1,3 ****
--- 1,4 ----
  #include "QMacInstallDialog.h"
+ #include <QMessageBox>
  #include "cmSystemTools.h"
  #include <iostream>
***************
*** 34,37 ****
--- 35,54 ----
    QDir installDir(this->Internals->InstallPrefix->text());
    std::string installTo = installDir.path().toStdString();
+   if(!cmSystemTools::FileExists(installTo.c_str()))
+     {
+     QString message = tr("Build install does not exist, "
+                          "should I create it?")
+                       + "\n\n"
+                       + tr("Directory: ");
+     message += installDir.path();
+     QString title = tr("Create Directory");
+     QMessageBox::StandardButton btn;
+     btn = QMessageBox::information(this, title, message, 
+                                    QMessageBox::Yes | QMessageBox::No);
+     if(btn == QMessageBox::Yes)
+       {
+       cmSystemTools::MakeDirectory(installTo.c_str());
+       }
+     }
    QDir cmExecDir(QApplication::applicationDirPath());
    cmExecDir.cd("../bin");

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeLists.txt,v
retrieving revision 1.16
retrieving revision 1.17
diff -C 2 -d -r1.16 -r1.17
*** CMakeLists.txt	11 Mar 2008 21:27:41 -0000	1.16
--- CMakeLists.txt	4 Apr 2008 20:02:50 -0000	1.17
***************
*** 56,59 ****
--- 56,63 ----
  
    ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
+   IF(APPLE)
+     SET_TARGET_PROPERTIES(cmake-gui PROPERTIES
+      OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
+   ENDIF(APPLE)
    TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
    IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
***************
*** 85,90 ****
      configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
        "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
!     INSTALL(CODE "set(input_file 
!        \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/cmake-gui\")")
      INSTALL(SCRIPT "${CMake_SOURCE_DIR}/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake")
    ENDIF(APPLE)
--- 89,96 ----
      configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
        "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
!     INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
!                   WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
!     INSTALL(CODE "set(input_file
!        \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}\")")
      INSTALL(SCRIPT "${CMake_SOURCE_DIR}/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake")
    ENDIF(APPLE)

Index: CMakeSetup.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetup.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -C 2 -d -r1.18 -r1.19
*** CMakeSetup.cxx	14 Mar 2008 19:18:04 -0000	1.18
--- CMakeSetup.cxx	4 Apr 2008 20:02:50 -0000	1.19
***************
*** 67,70 ****
--- 67,71 ----
  int main(int argc, char** argv)
  {
+   cmSystemTools::FindExecutableDirectory(argv[0]);
    QApplication app(argc, argv);
    
***************
*** 114,118 ****
      cmake hcm;
      hcm.AddCMakePaths();
!     doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
      std::vector<cmDocumentationEntry> commands;
      std::vector<cmDocumentationEntry> compatCommands;
--- 115,124 ----
      cmake hcm;
      hcm.AddCMakePaths();
!     // just incase the install is bad avoid a seg fault
!     const char* root = hcm.GetCacheDefinition("CMAKE_ROOT");
!     if(root)
!       {
!       doc.SetCMakeRoot(root);
!       }
      std::vector<cmDocumentationEntry> commands;
      std::vector<cmDocumentationEntry> compatCommands;



More information about the Cmake-commits mailing list