[Cmake-commits] CMake branch, next, updated. v3.2.2-2945-g5f931e3

Brad King brad.king at kitware.com
Tue May 19 10:39:08 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  5f931e3ffc67260cf9224cbe6684e44aeb602e79 (commit)
       via  9e0c536efd015446a8f9178be6bcb7534c7c0564 (commit)
       via  012357cb2cf255aec304905901cf6806849d94b3 (commit)
       via  da9dddb09020e1dbeb6ec4d29bf9d97ec796102e (commit)
       via  41477d5c0705baa33878c16e979283088efe2c4a (commit)
       via  f3946ba547179f1f06a42215e92d96c65c9c4ec7 (commit)
      from  ad7afbeca3d8140568f671ec488105a4ff07feb2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f931e3ffc67260cf9224cbe6684e44aeb602e79
commit 5f931e3ffc67260cf9224cbe6684e44aeb602e79
Merge: ad7afbe 9e0c536
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 19 10:38:56 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 19 10:38:56 2015 -0400

    Merge topic 'cmake-gui-osx-install-command-line' into next
    
    9e0c536e Help: Add notes for topic 'cmake-gui-osx-install-command-line'
    012357cb cmake-gui: Replace command-line install dialog with information box
    da9dddb0 cmake-gui: Add --install option to add command-line tools on OS X
    41477d5c cmake-gui: Drop undocumented and unused --mac-install option
    f3946ba5 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e0c536efd015446a8f9178be6bcb7534c7c0564
commit 9e0c536efd015446a8f9178be6bcb7534c7c0564
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 19 10:37:29 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 19 10:37:29 2015 -0400

    Help: Add notes for topic 'cmake-gui-osx-install-command-line'

diff --git a/Help/release/dev/cmake-gui-osx-install-command-line.rst b/Help/release/dev/cmake-gui-osx-install-command-line.rst
new file mode 100644
index 0000000..e0f0369
--- /dev/null
+++ b/Help/release/dev/cmake-gui-osx-install-command-line.rst
@@ -0,0 +1,10 @@
+cmake-gui-osx-install-command-line
+----------------------------------
+
+* On OS X the :manual:`cmake-gui(1)` no longer has the
+  ``Install For Command Line Use`` menu item.  Instead there
+  is a ``How to Install For Command Line Use`` menu item
+  that shows an informational dialog box explaining how to
+  make the command line tools available.  For example::
+
+    /Applications/CMake.app/Contents/bin/cmake-gui --install

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=012357cb2cf255aec304905901cf6806849d94b3
commit 012357cb2cf255aec304905901cf6806849d94b3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 19 10:13:08 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 19 10:27:13 2015 -0400

    cmake-gui: Replace command-line install dialog with information box
    
    The QMacInstallDialog infrastructure no longer works on modern OS X
    versions.  Drop it and replace the dialog with a simple info box that
    explains to the user how to run 'cmake-gui --install' to add symlinks.
    Also suggest simply modifying the PATH.
    
    This approach is similar to the Xcode 'xcode-select --install' method
    of installing Xcode Command Line Tools.

diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 9cc993a..168f57d 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -99,15 +99,12 @@ set(SRCS
   QCMakeCacheView.h
   QCMakeWidgets.cxx
   QCMakeWidgets.h
-  QMacInstallDialog.cxx
-  QMacInstallDialog.h
   )
 QT4_WRAP_UI(UI_SRCS
   CMakeSetupDialog.ui
   Compilers.ui
   CrossCompiler.ui
   AddCacheEntry.ui
-  MacInstallDialog.ui
   )
 QT4_WRAP_CPP(MOC_SRCS
   AddCacheEntry.h
@@ -117,7 +114,6 @@ QT4_WRAP_CPP(MOC_SRCS
   QCMake.h
   QCMakeCacheView.h
   QCMakeWidgets.h
-  QMacInstallDialog.h
   )
 QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
 
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 7cf33df..4da33de 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -15,7 +15,6 @@
 #include <QTranslator>
 #include <QLocale>
 #include <QTextCodec>
-#include "QMacInstallDialog.h"
 #include "CMakeSetupDialog.h"
 #include "cmDocumentation.h"
 #include "cmake.h"
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index b8077f2..426fa12 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -27,7 +27,6 @@
 #include <QUrl>
 #include <QShortcut>
 #include <QKeySequence>
-#include <QMacInstallDialog.h>
 #include <QInputDialog>
 
 #include "QCMake.h"
@@ -121,7 +120,7 @@ CMakeSetupDialog::CMakeSetupDialog()
                    this, SLOT(showUserChanges()));
 #if defined(Q_WS_MAC) || defined(Q_OS_MAC)
   this->InstallForCommandLineAction
-    = ToolsMenu->addAction(tr("&Install For Command Line Use"));
+    = ToolsMenu->addAction(tr("&How to Install For Command Line Use"));
   QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
                    this, SLOT(doInstallForCommandLine()));
 #endif
@@ -420,8 +419,37 @@ bool CMakeSetupDialog::doConfigureInternal()
 
 void CMakeSetupDialog::doInstallForCommandLine()
 {
-  QMacInstallDialog setupdialog(0);
-  setupdialog.exec();
+  QString title = tr("How to Install For Command Line Use");
+  QString msg = tr(
+    "One may add CMake to the PATH:\n"
+    "\n"
+    " PATH=\"%1\":\"$PATH\"\n"
+    "\n"
+    "Or, to install symlinks to '/usr/bin', run:\n"
+    "\n"
+    " sudo \"%2\" --install\n"
+    "\n"
+    "Or, to install symlinks to another directory, run:\n"
+    "\n"
+    " sudo \"%3\" --install=/path/to/bin\n"
+    );
+  msg = msg.arg(cmSystemTools::GetFilenamePath(
+                  cmSystemTools::GetCMakeCommand()).c_str());
+  msg = msg.arg(cmSystemTools::GetCMakeGUICommand().c_str());
+  msg = msg.arg(cmSystemTools::GetCMakeGUICommand().c_str());
+
+  QDialog dialog;
+  dialog.setWindowTitle(title);
+  QVBoxLayout* l = new QVBoxLayout(&dialog);
+  QLabel* lab = new QLabel(&dialog);
+  l->addWidget(lab);
+  lab->setText(msg);
+  lab->setWordWrap(false);
+  QDialogButtonBox* btns = new QDialogButtonBox(QDialogButtonBox::Ok,
+                                                Qt::Horizontal, &dialog);
+  QObject::connect(btns, SIGNAL(accepted()), &dialog, SLOT(accept()));
+  l->addWidget(btns);
+  dialog.exec();
 }
 
 bool CMakeSetupDialog::doGenerateInternal()
diff --git a/Source/QtDialog/MacInstallDialog.ui b/Source/QtDialog/MacInstallDialog.ui
deleted file mode 100644
index c7e31db..0000000
--- a/Source/QtDialog/MacInstallDialog.ui
+++ /dev/null
@@ -1,103 +0,0 @@
-<ui version="4.0" >
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>470</width>
-    <height>159</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Install Command Line Tools</string>
-  </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item row="3" column="1" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="0" colspan="3" >
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="skipInstallButton" >
-       <property name="text" >
-        <string>Skip Install Command Line </string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="doInstallButton" >
-       <property name="text" >
-        <string>Install Command Line Links</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="2" >
-    <widget class="QPushButton" name="choosePathButton" >
-     <property name="text" >
-      <string>Choose...</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0" >
-    <widget class="QLabel" name="label" >
-     <property name="text" >
-      <string>Install Folder:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1" >
-    <widget class="QLineEdit" name="InstallPrefix" />
-   </item>
-   <item row="1" column="0" colspan="3" >
-    <widget class="QLabel" name="label_2" >
-     <property name="text" >
-      <string>This will create symbolic links to the command line tools of cmake into the specified install folder.</string>
-     </property>
-     <property name="wordWrap" >
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx
deleted file mode 100644
index fa7df43..0000000
--- a/Source/QtDialog/QMacInstallDialog.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-#include "QMacInstallDialog.h"
-#include <QMessageBox>
-#include "cmSystemTools.h"
-#include <iostream>
-#include <QFileDialog>
-#include "ui_MacInstallDialog.h"
-
-class QMacInstallDialog::QMacInstallDialogInternals : public Ui::Dialog
-{
-public:
-};
-
-QMacInstallDialog::QMacInstallDialog(QWidget*w)
-  :QDialog(w)
-{
-  this->Internals = new QMacInstallDialogInternals;
-  this->Internals->setupUi(this);
-  QObject::connect(this->Internals->choosePathButton, SIGNAL(clicked(bool)),
-                   this, SLOT(ShowBrowser()));
-  QObject::connect(this->Internals->skipInstallButton, SIGNAL(clicked(bool)),
-                   this, SLOT(SkipInstall()));
-  QObject::connect(this->Internals->doInstallButton, SIGNAL(clicked(bool)),
-                   this, SLOT(DoInstall()));
-  this->Internals->InstallPrefix->setText("/usr/bin/");
-
-}
-
-QMacInstallDialog::~QMacInstallDialog()
-{
-  delete this->Internals;
-}
-
-void QMacInstallDialog::DoInstall()
-{
-  QDir installDir(this->Internals->InstallPrefix->text());
-  QString installTo = installDir.path();
-  if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data()))
-    {
-    QString message = tr("Build install does not exist, "
-                         "should I create it?\n\n"
-                         "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.toLocal8Bit().data());
-      }
-    }
-  QDir cmExecDir(QApplication::applicationDirPath());
-  cmExecDir.cd("../bin");
-  QFileInfoList list = cmExecDir.entryInfoList();
-  for (int i = 0; i < list.size(); ++i)
-    {
-    QFileInfo fileInfo = list.at(i);
-    QString filename = fileInfo.fileName();
-    if(filename.size() && filename[0] == '.')
-      {
-      continue;
-      }
-    QString file = fileInfo.absoluteFilePath();
-    QString newName = installTo;
-    newName += "/";
-    newName += filename;
-    // Remove the old files
-    if(cmSystemTools::FileExists(newName.toLocal8Bit().data()))
-      {
-      std::cout << "rm [" << newName.toLocal8Bit().data() << "]\n";
-      if(!cmSystemTools::RemoveFile(newName.toLocal8Bit().data()))
-        {
-        QString message = tr("Failed to remove file "
-                             "installation may be incomplete: ");
-        message += newName;
-        QString title = tr("Error Removing file");
-        QMessageBox::StandardButton btn =
-          QMessageBox::critical(this, title, message,
-                                QMessageBox::Ok|QMessageBox::Abort);
-        if(btn == QMessageBox::Abort)
-          {
-          return;
-          }
-        }
-      }
-    std::cout << "ln -s [" << file.toLocal8Bit().data() << "] [";
-    std::cout << newName.toLocal8Bit().data() << "]\n";
-    if(!cmSystemTools::CreateSymlink(file.toLocal8Bit().data(),
-                                     newName.toLocal8Bit().data()))
-      {
-      QString message = tr("Failed create symlink "
-                           "installation may be incomplete: ");
-      message += newName;
-      QString title = tr("Error Creating Symlink");
-      QMessageBox::StandardButton btn =
-        QMessageBox::critical(this, title, message,
-                              QMessageBox::Ok|QMessageBox::Abort);
-      if(btn == QMessageBox::Abort)
-        {
-        return;
-        }
-      }
-    }
-  this->done(0);
-}
-
-void QMacInstallDialog::SkipInstall()
-{
-  this->done(0);
-}
-
-
-void QMacInstallDialog::ShowBrowser()
-{
-  QString dir = QFileDialog::getExistingDirectory(this,
-    tr("Enter Install Prefix"), this->Internals->InstallPrefix->text());
-  if(!dir.isEmpty())
-    {
-    this->Internals->InstallPrefix->setText(dir);
-    }
-}
diff --git a/Source/QtDialog/QMacInstallDialog.h b/Source/QtDialog/QMacInstallDialog.h
deleted file mode 100644
index efe67df..0000000
--- a/Source/QtDialog/QMacInstallDialog.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef QMacInstallDialog_h
-#define QMacInstallDialog_h
-#include <QDialog>
-
-class QMacInstallDialog : public QDialog
-{
-  Q_OBJECT;
-public:
-  QMacInstallDialog(QWidget*w);
-  ~QMacInstallDialog();
-private slots:
-  void ShowBrowser();
-  void SkipInstall();
-  void DoInstall();
-private:
-  class QMacInstallDialogInternals;
-  QMacInstallDialogInternals* Internals;
-};
-
-#endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da9dddb09020e1dbeb6ec4d29bf9d97ec796102e
commit da9dddb09020e1dbeb6ec4d29bf9d97ec796102e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 19 09:44:19 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 19 10:26:51 2015 -0400

    cmake-gui: Add --install option to add command-line tools on OS X
    
    On OS X add an "--install[=/path/to/bin]" option (defaulting to
    /usr/bin) that installs symbolic links into the given directory.
    This will help OS X users make the tools available on the command
    line even when they sit inside a CMake.app bundle.

diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index cf1729c..7cf33df 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -20,6 +20,7 @@
 #include "cmDocumentation.h"
 #include "cmake.h"
 #include "cmVersion.h"
+#include "cmAlgorithms.h"
 #include <cmsys/CommandLineArguments.hxx>
 #include <cmsys/SystemTools.hxx>
 #include <cmsys/Encoding.hxx>
@@ -48,6 +49,10 @@ static const char * cmDocumentationOptions[][2] =
   {0,0}
 };
 
+#if defined(Q_OS_MAC)
+static int cmOSXInstall(std::string dir);
+#endif
+
 int main(int argc, char** argv)
 {
   cmsys::Encoding::CommandLineArguments encoding_args =
@@ -77,6 +82,17 @@ int main(int argc, char** argv)
     return (doc.PrintRequestedDocumentation(std::cout)? 0:1);
     }
 
+#if defined(Q_OS_MAC)
+  if (argc2 == 2 && strcmp(argv2[1], "--install") == 0)
+    {
+    return cmOSXInstall("/usr/bin");
+    }
+  if (argc2 == 2 && cmHasLiteralPrefix(argv2[1], "--install="))
+    {
+    return cmOSXInstall(argv2[1]+10);
+    }
+#endif
+
   QApplication app(argc, argv);
 
 #if defined(CMAKE_ENCODING_UTF8)
@@ -177,3 +193,52 @@ int main(int argc, char** argv)
   return app.exec();
 }
 
+#if defined(Q_OS_MAC)
+# include <unistd.h>
+# include <sys/stat.h>
+static bool cmOSXInstall(std::string const& dir, std::string const& tool)
+{
+  if (tool.empty())
+    {
+    return true;
+    }
+  std::string link = dir + cmSystemTools::GetFilenameName(tool);
+  struct stat st;
+  if (lstat(link.c_str(), &st) == 0 && S_ISLNK(st.st_mode))
+    {
+    char buf[4096];
+    ssize_t s = readlink(link.c_str(), buf, sizeof(buf)-1);
+    if (s >= 0 && std::string(buf, s) == tool)
+      {
+      std::cerr << "Exists: '" << link << "' -> '" << tool << "'\n";
+      return true;
+      }
+    }
+  if (symlink(tool.c_str(), link.c_str()) == 0)
+    {
+    std::cerr << "Linked: '" << link << "' -> '" << tool << "'\n";
+    return true;
+    }
+  else
+    {
+    int err = errno;
+    std::cerr << "Failed: '" << link << "' -> '" << tool << "': "
+              << strerror(err) << "\n";
+    return false;
+    }
+}
+static int cmOSXInstall(std::string dir)
+{
+  if (!cmHasLiteralSuffix(dir, "/"))
+    {
+    dir += "/";
+    }
+  return (
+    cmOSXInstall(dir, cmSystemTools::GetCMakeCommand()) &&
+    cmOSXInstall(dir, cmSystemTools::GetCTestCommand()) &&
+    cmOSXInstall(dir, cmSystemTools::GetCPackCommand()) &&
+    cmOSXInstall(dir, cmSystemTools::GetCMakeGUICommand()) &&
+    cmOSXInstall(dir, cmSystemTools::GetCMakeCursesCommand())
+    ) ? 0 : 1;
+}
+#endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41477d5c0705baa33878c16e979283088efe2c4a
commit 41477d5c0705baa33878c16e979283088efe2c4a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 19 09:38:26 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 19 09:39:16 2015 -0400

    cmake-gui: Drop undocumented and unused --mac-install option
    
    This option was once used by our OS X package installer to create
    symlinks at install time.  Since switching to the DragNDrop installer
    we no longer use this option.

diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 8a72a24..cf1729c 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -91,16 +91,6 @@ int main(int argc, char** argv)
     QApplication::removeLibraryPath(p);
     }
 
-  // if arg for install
-  for(int i =0; i < argc2; i++)
-    {
-    if(strcmp(argv2[i], "--mac-install") == 0)
-      {
-      QMacInstallDialog setupdialog(0);
-      setupdialog.exec();
-      return 0;
-      }
-    }
   // tell the cmake library where cmake is
   QDir cmExecDir(QApplication::applicationDirPath());
 #if defined(Q_OS_MAC)

-----------------------------------------------------------------------

Summary of changes:
 .../dev/cmake-gui-osx-install-command-line.rst     |   10 ++
 Source/CMakeVersion.cmake                          |    2 +-
 Source/QtDialog/CMakeLists.txt                     |    4 -
 Source/QtDialog/CMakeSetup.cxx                     |   76 ++++++++++--
 Source/QtDialog/CMakeSetupDialog.cxx               |   36 +++++-
 Source/QtDialog/MacInstallDialog.ui                |  103 -----------------
 Source/QtDialog/QMacInstallDialog.cxx              |  121 --------------------
 Source/QtDialog/QMacInstallDialog.h                |   20 ----
 8 files changed, 108 insertions(+), 264 deletions(-)
 create mode 100644 Help/release/dev/cmake-gui-osx-install-command-line.rst
 delete mode 100644 Source/QtDialog/MacInstallDialog.ui
 delete mode 100644 Source/QtDialog/QMacInstallDialog.cxx
 delete mode 100644 Source/QtDialog/QMacInstallDialog.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list