diff options
34 files changed, 401 insertions, 245 deletions
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index ae00653..4ebf306 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -194,9 +194,9 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") # Reset CPACK_PACKAGE_VERSION to deal with WiX restriction. # But the file names still use the full CMake_VERSION value: set(CPACK_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME}-@CMake_VERSION@-${CPACK_SYSTEM_NAME}") + "cmake-@CMake_VERSION@-${CPACK_SYSTEM_NAME}") set(CPACK_SOURCE_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME}-@CMake_VERSION@-Source") + "cmake-@CMake_VERSION@") if(NOT CPACK_WIX_SIZEOF_VOID_P) set(CPACK_WIX_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@") diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 4cbe976..91af3e3 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -167,7 +167,8 @@ Available commands are: Change the current working directory and run a command. ``compare_files <file1> <file2>`` - Check if file1 is same as file2. + Check if ``<file1>`` is same as ``<file2>``. If files are the same, + then returns 0, if not itreturns 1. ``copy <file>... <destination>`` Copy files to ``<destination>`` (either file or directory). @@ -194,10 +195,11 @@ Available commands are: Run command in a modified environment. ``environment`` - Display the current environment. + Display the current environment variables. -``make_directory <dir>`` - Create a directory. +``make_directory <dir>...`` + Create ``<dir>`` directories. If necessary, create parent + directories too. ``md5sum <file>...`` Compute md5sum of files. diff --git a/Help/release/dev/FindOpenMP-clang.rst b/Help/release/dev/FindOpenMP-clang.rst new file mode 100644 index 0000000..44c805c --- /dev/null +++ b/Help/release/dev/FindOpenMP-clang.rst @@ -0,0 +1,4 @@ +FindOpenMP-clang +---------------- + +* The :module:`FindOpenMP` module learned to support Clang. diff --git a/Help/release/dev/cmake-E-copy-multiple-inputs.rst b/Help/release/dev/cmake-E-multiple-inputs.rst index eeb1fab..480261d 100644 --- a/Help/release/dev/cmake-E-copy-multiple-inputs.rst +++ b/Help/release/dev/cmake-E-multiple-inputs.rst @@ -1,8 +1,11 @@ -cmake-E-copy-multiple-inputs ----------------------------- +cmake-E-multiple-inputs +----------------------- * The :manual:`cmake(1)` ``-E copy`` and ``-E copy_if_different`` command-line tools learned to support copying multiple input files to a directory. * The :manual:`cmake(1)` ``-E copy_directory`` command-line tool learned to support copying multiple input directories to a directory. + +* The :manual:`cmake(1)` ``-E make_directory`` command-line + tool learned to support copying multiple input directories to a directory. diff --git a/Help/release/dev/cmake-W-options.rst b/Help/release/dev/cmake-W-options.rst index 57d375f..38e71f9 100644 --- a/Help/release/dev/cmake-W-options.rst +++ b/Help/release/dev/cmake-W-options.rst @@ -10,3 +10,6 @@ cmake-W-options * Warnings about deprecated functionality are now enabled by default. They may be suppressed with ``-Wno-deprecated`` or by setting the :variable:`CMAKE_WARN_DEPRECATED` variable to false. + +* Warnings about deprecated functionality can now be controlled in the + :manual:`cmake-gui(1)` application. diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake index 8150ff2..eb63cef 100644 --- a/Modules/FindOpenAL.cmake +++ b/Modules/FindOpenAL.cmake @@ -79,11 +79,17 @@ find_path(OPENAL_INCLUDE_DIR al.h [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] ) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_OpenAL_ARCH_DIR libs/Win64) +else() + set(_OpenAL_ARCH_DIR libs/Win32) +endif() + find_library(OPENAL_LIBRARY NAMES OpenAL al openal OpenAL32 HINTS ENV OPENALDIR - PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 + PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR} PATHS ~/Library/Frameworks /Library/Frameworks @@ -94,6 +100,7 @@ find_library(OPENAL_LIBRARY [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] ) +unset(_OpenAL_ARCH_DIR) # handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if # all listed variables are TRUE diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index a102c66..ee4bdd6 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -50,6 +50,8 @@ function(_OPENMP_FLAG_CANDIDATES LANG) " " #GNU "-fopenmp" + #Clang + "-fopenmp=libomp" #Microsoft Visual Studio "/openmp" #Intel windows @@ -67,6 +69,7 @@ function(_OPENMP_FLAG_CANDIDATES LANG) ) set(OMP_FLAG_GNU "-fopenmp") + set(OMP_FLAG_Clang "-fopenmp=libomp") set(OMP_FLAG_HP "+Oopenmp") if(WIN32) set(OMP_FLAG_Intel "-Qopenmp") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index fab29ab..6c6ba32 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 20151210) +set(CMake_VERSION_PATCH 20151211) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index d5246db..da8b486 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -911,8 +911,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( relativeDirectoryPath = "."; } - cmInstalledFile const* directoryInstalledFile = - this->GetInstalledFile(relativeDirectoryPath); + cmInstalledFile const* directoryInstalledFile = this->GetInstalledFile( + this->RelativePathWithoutComponentPrefix(relativeDirectoryPath) + ); bool emptyDirectory = dir.GetNumberOfFiles() == 2; bool createDirectory = false; @@ -980,8 +981,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( } else { - cmInstalledFile const* installedFile = - this->GetInstalledFile(relativePath); + cmInstalledFile const* installedFile = this->GetInstalledFile( + this->RelativePathWithoutComponentPrefix(relativePath) + ); if(installedFile) { @@ -1230,3 +1232,16 @@ void cmCPackWIXGenerator::AddCustomFlags( stream << " " << QuotePath(*i); } } + +std::string cmCPackWIXGenerator::RelativePathWithoutComponentPrefix( + std::string const& path) +{ + if(this->Components.empty()) + { + return path; + } + + std::string::size_type pos = path.find('/'); + + return path.substr(pos + 1); +} diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index d501609..3f66b2c 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -168,6 +168,9 @@ private: void AddCustomFlags( std::string const& variableName, std::ostream& stream); + std::string RelativePathWithoutComponentPrefix( + std::string const& path); + std::vector<std::string> WixSources; id_map_t PathToIdMap; ambiguity_map_t IdAmbiguityCounter; diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index cad11f5..9161ad3 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -115,6 +115,8 @@ set(SRCS QCMakeWidgets.h RegexExplorer.cxx RegexExplorer.h + WarningMessagesDialog.cxx + WarningMessagesDialog.h ) QT4_WRAP_UI(UI_SRCS CMakeSetupDialog.ui @@ -122,6 +124,7 @@ QT4_WRAP_UI(UI_SRCS CrossCompiler.ui AddCacheEntry.ui RegexExplorer.ui + WarningMessagesDialog.ui ) QT4_WRAP_CPP(MOC_SRCS AddCacheEntry.h @@ -132,6 +135,7 @@ QT4_WRAP_CPP(MOC_SRCS QCMakeCacheView.h QCMakeWidgets.h RegexExplorer.h + WarningMessagesDialog.h ) QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 2b12834..2fc4faf 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -34,6 +34,7 @@ #include "AddCacheEntry.h" #include "FirstConfigure.h" #include "RegexExplorer.h" +#include "WarningMessagesDialog.h" #include "cmSystemTools.h" #include "cmVersion.h" @@ -145,9 +146,8 @@ CMakeSetupDialog::CMakeSetupDialog() this, SLOT(doOutputErrorNext())); // in Eclipse QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options")); - this->SuppressDevWarningsAction = - OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)")); - this->SuppressDevWarningsAction->setCheckable(true); + OptionsMenu->addAction(tr("Warning Messages..."), + this, SLOT(doWarningMessagesDialog())); this->WarnUninitializedAction = OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)")); this->WarnUninitializedAction->setCheckable(true); @@ -278,9 +278,6 @@ void CMakeSetupDialog::initialize() QObject::connect(this->AddEntry, SIGNAL(clicked(bool)), this, SLOT(addCacheEntry())); - QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)), - this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool))); - QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)), this->CMakeThread->cmakeInstance(), SLOT(setWarnUninitializedMode(bool))); @@ -1369,3 +1366,9 @@ void CMakeSetupDialog::doOutputErrorNext() this->Output->setTextCursor(textCursor); } } + +void CMakeSetupDialog::doWarningMessagesDialog() +{ + WarningMessagesDialog dialog(this, this->CMakeThread->cmakeInstance()); + dialog.exec(); +} diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index bfd2bc9..4b53b1c 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -83,6 +83,8 @@ protected slots: void doOutputFindPrev(); void doOutputErrorNext(); void doRegexExplorerDialog(); + /// display the modal warning messages dialog window + void doWarningMessagesDialog(); protected: @@ -102,7 +104,6 @@ protected: QAction* ExitAction; QAction* ConfigureAction; QAction* GenerateAction; - QAction* SuppressDevWarningsAction; QAction* WarnUninitializedAction; QAction* WarnUnusedAction; QAction* InstallForCommandLineAction; diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 1fcb676..71b7940 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -26,7 +26,6 @@ QCMake::QCMake(QObject* p) : QObject(p) { - this->SuppressDevWarnings = false; this->WarnUninitializedMode = false; this->WarnUnusedMode = false; qRegisterMetaType<QCMakeProperty>(); @@ -167,7 +166,6 @@ void QCMake::configure() this->CMakeInstance->SetGeneratorPlatform(""); this->CMakeInstance->SetGeneratorToolset(this->Toolset.toLocal8Bit().data()); this->CMakeInstance->LoadCache(); - this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode); this->CMakeInstance->PreLoadCMakeFiles(); @@ -457,10 +455,24 @@ bool QCMake::getDebugOutput() const return this->CMakeInstance->GetDebugOutput(); } +bool QCMake::getSuppressDevWarnings() +{ + return this->CMakeInstance->GetSuppressDevWarnings(); +} void QCMake::setSuppressDevWarnings(bool value) { - this->SuppressDevWarnings = value; + this->CMakeInstance->SetSuppressDevWarnings(value); +} + +bool QCMake::getSuppressDeprecatedWarnings() +{ + return this->CMakeInstance->GetSuppressDeprecatedWarnings(); +} + +void QCMake::setSuppressDeprecatedWarnings(bool value) +{ + this->CMakeInstance->SetSuppressDeprecatedWarnings(value); } void QCMake::setWarnUninitializedMode(bool value) diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 2d45da9..4b787b9 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -91,8 +91,14 @@ public slots: void reloadCache(); /// set whether to do debug output void setDebugOutput(bool); + /// get whether to do suppress dev warnings + bool getSuppressDevWarnings(); /// set whether to do suppress dev warnings void setSuppressDevWarnings(bool value); + /// get whether to do suppress deprecated warnings + bool getSuppressDeprecatedWarnings(); + /// set whether to do suppress deprecated warnings + void setSuppressDeprecatedWarnings(bool value); /// set whether to run cmake with warnings about uninitialized variables void setWarnUninitializedMode(bool value); /// set whether to run cmake with warnings about unused variables @@ -146,7 +152,6 @@ protected: bool&, void* cd); static void stdoutCallback(const char* msg, size_t len, void* cd); static void stderrCallback(const char* msg, size_t len, void* cd); - bool SuppressDevWarnings; bool WarnUninitializedMode; bool WarnUnusedMode; bool WarnUnusedAllMode; diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx new file mode 100644 index 0000000..735b71c --- /dev/null +++ b/Source/QtDialog/WarningMessagesDialog.cxx @@ -0,0 +1,43 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Kitware, Inc., Gregor Jasny + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#include "WarningMessagesDialog.h" + +WarningMessagesDialog::WarningMessagesDialog(QWidget* prnt, QCMake* instance) + : QDialog(prnt), cmakeInstance(instance) +{ + this->setupUi(this); + this->setInitialValues(); + this->setupSignals(); +} + +void WarningMessagesDialog::setInitialValues() +{ + this->suppressDeveloperWarnings->setChecked( + this->cmakeInstance->getSuppressDevWarnings()); + this->suppressDeprecatedWarnings->setChecked( + this->cmakeInstance->getSuppressDeprecatedWarnings()); +} + +void WarningMessagesDialog::setupSignals() +{ + QObject::connect(this->buttonBox, SIGNAL(accepted()), + this, SLOT(doAccept())); +} + +void WarningMessagesDialog::doAccept() +{ + this->cmakeInstance->setSuppressDevWarnings( + this->suppressDeveloperWarnings->isChecked()); + this->cmakeInstance->setSuppressDeprecatedWarnings( + this->suppressDeprecatedWarnings->isChecked()); +} diff --git a/Source/QtDialog/WarningMessagesDialog.h b/Source/QtDialog/WarningMessagesDialog.h new file mode 100644 index 0000000..028ec10 --- /dev/null +++ b/Source/QtDialog/WarningMessagesDialog.h @@ -0,0 +1,53 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Kitware, Inc., Gregor Jasny + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef WarningMessagesDialog_h +#define WarningMessagesDialog_h + +#include <QDialog> +#include <QWidget> + +#include "ui_WarningMessagesDialog.h" +#include "QCMake.h" + +/** + * Dialog window for setting the warning message related options. + */ +class WarningMessagesDialog : public QDialog, public Ui_MessagesDialog +{ + Q_OBJECT + +public: + WarningMessagesDialog(QWidget* prnt, QCMake* instance); + +private slots: + /** + * Handler for the accept event of the ok/cancel button box. + */ + void doAccept(); + +private: + QCMake* cmakeInstance; + + /** + * Set the initial values of the widgets on this dialog window, using the + * current state of the cache. + */ + void setInitialValues(); + + /** + * Setup the signals for the widgets on this dialog window. + */ + void setupSignals(); +}; + +#endif /* MessageDialog_h */ diff --git a/Source/QtDialog/WarningMessagesDialog.ui b/Source/QtDialog/WarningMessagesDialog.ui new file mode 100644 index 0000000..2367772 --- /dev/null +++ b/Source/QtDialog/WarningMessagesDialog.ui @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MessagesDialog</class> + <widget class="QDialog" name="MessagesDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>250</width> + <height>150</height> + </rect> + </property> + <property name="windowTitle"> + <string>Warning Messages</string> + </property> + <property name="modal"> + <bool>true</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Suppress Warnings</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="suppressDeveloperWarnings"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Developer Warnings</string> + </property> + <property name="tristate"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="suppressDeprecatedWarnings"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Deprecated Warnings</string> + </property> + <property name="tristate"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>MessagesDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>MessagesDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index a63b6e3..448306f 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -292,7 +292,7 @@ void cmGraphVizWriter::WriteGlobalFile(const char* fileName) void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& str) const { - str << this->GraphType << " " << this->GraphName << " {" << std::endl; + str << this->GraphType << " \"" << this->GraphName << "\" {" << std::endl; str << this->GraphHeader << std::endl; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c0a1196..7992495 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1269,17 +1269,11 @@ int cmake::Configure() diagLevel = this->DiagLevels["deprecated"]; if (diagLevel == DIAG_IGNORE) { - this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "FALSE", - "Whether to issue warnings for deprecated " - "functionality.", - cmState::INTERNAL); + this->SetSuppressDeprecatedWarnings(true); } else if (diagLevel == DIAG_WARN) { - this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "TRUE", - "Whether to issue warnings for deprecated " - "functionality.", - cmState::INTERNAL); + this->SetSuppressDeprecatedWarnings(false); } } @@ -1299,32 +1293,20 @@ int cmake::Configure() diagLevel = this->DiagLevels["dev"]; if (diagLevel == DIAG_IGNORE) { - this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", - "Suppress Warnings that are meant for" - " the author of the CMakeLists.txt files.", - cmState::INTERNAL); + this->SetSuppressDevWarnings(true); if (setDeprecatedVariables) { - this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "FALSE", - "Whether to issue warnings for deprecated " - "functionality.", - cmState::INTERNAL); + this->SetSuppressDeprecatedWarnings(true); } } else if (diagLevel == DIAG_WARN) { - this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", - "Suppress Warnings that are meant for" - " the author of the CMakeLists.txt files.", - cmState::INTERNAL); + this->SetSuppressDevWarnings(false); if (setDeprecatedVariables) { - this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "TRUE", - "Whether to issue warnings for deprecated " - "functionality.", - cmState::INTERNAL); + this->SetSuppressDeprecatedWarnings(false); } } } @@ -2881,21 +2863,6 @@ void cmake::RunCheckForUnusedVariables() #endif } -void cmake::SetSuppressDevWarnings(bool b) -{ - // equivalent to -Wno-dev - if (b) - { - this->DiagLevels["dev"] = DIAG_IGNORE; - } - // equivalent to -Wdev - else - { - this->DiagLevels["dev"] = std::max(this->DiagLevels["dev"], - DIAG_WARN); - } -} - bool cmake::GetSuppressDevWarnings(cmMakefile const* mf) { /* @@ -2914,6 +2881,27 @@ bool cmake::GetSuppressDevWarnings(cmMakefile const* mf) } } +void cmake::SetSuppressDevWarnings(bool b) +{ + std::string value; + + // equivalent to -Wno-dev + if (b) + { + value = "TRUE"; + } + // equivalent to -Wdev + else + { + value = "FALSE"; + } + + this->AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", value.c_str(), + "Suppress Warnings that are meant for" + " the author of the CMakeLists.txt files.", + cmState::INTERNAL); +} + bool cmake::GetSuppressDeprecatedWarnings(cmMakefile const* mf) { /* @@ -2932,3 +2920,24 @@ bool cmake::GetSuppressDeprecatedWarnings(cmMakefile const* mf) return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue); } } + +void cmake::SetSuppressDeprecatedWarnings(bool b) +{ + std::string value; + + // equivalent to -Wno-deprecated + if (b) + { + value = "FALSE"; + } + // equivalent to -Wdeprecated + else + { + value = "TRUE"; + } + + this->AddCacheEntry("CMAKE_WARN_DEPRECATED", value.c_str(), + "Whether to issue warnings for deprecated " + "functionality.", + cmState::INTERNAL); +} diff --git a/Source/cmake.h b/Source/cmake.h index 4c5515b..298d82b 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -308,13 +308,16 @@ class cmake std::string const& GetCMakeEditCommand() const { return this->CMakeEditCommand; } - void SetSuppressDevWarnings(bool v); /* * Get the state of the suppression of developer (author) warnings. * Returns false, by default, if developer warnings should be shown, true * otherwise. */ bool GetSuppressDevWarnings(cmMakefile const* mf = NULL); + /* + * Set the state of the suppression of developer (author) warnings. + */ + void SetSuppressDevWarnings(bool v); /* * Get the state of the suppression of deprecated warnings. @@ -322,6 +325,10 @@ class cmake * otherwise. */ bool GetSuppressDeprecatedWarnings(cmMakefile const* mf = NULL); + /* + * Set the state of the suppression of deprecated warnings. + */ + void SetSuppressDeprecatedWarnings(bool v); /** Display a message to the user. */ void IssueMessage(cmake::MessageType t, std::string const& text, diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6a4234f..fb7b1f5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -68,7 +68,7 @@ void CMakeCommandUsage(const char* program) << " env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...\n" << " - run command in a modified environment\n" << " environment - display the current environment\n" - << " make_directory dir - create a directory\n" + << " make_directory <dir>... - create parent and <dir> directories\n" << " md5sum <file>... - compute md5sum of files\n" << " remove [-f] <file>... - remove the file(s), use -f to force " "it\n" @@ -447,15 +447,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) } #endif - else if (args[1] == "make_directory" && args.size() == 3) + else if (args[1] == "make_directory" && args.size() > 2) { - if(!cmSystemTools::MakeDirectory(args[2].c_str())) + // If error occurs we want to continue copying next files. + bool return_value = 0; + for (std::string::size_type cc = 2; cc < args.size(); cc ++) { - std::cerr << "Error making directory \"" << args[2] - << "\".\n"; - return 1; + if(!cmSystemTools::MakeDirectory(args[cc].c_str())) + { + std::cerr << "Error creating directory \"" + << args[cc] << "\".\n"; + return_value = 1; + } } - return 0; + return return_value; } else if (args[1] == "remove_directory" && args.size() == 3) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index ce7f563..b859e79 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -124,7 +124,6 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_USE_FStream 1) SET(KWSYS_USE_String 1) SET(KWSYS_USE_SystemInformation 1) - SET(KWSYS_USE_CPU 1) ENDIF() # Enforce component dependencies. @@ -425,13 +424,6 @@ IF(KWSYS_USE_FundamentalType) ENDIF() ENDFOREACH() - IF(KWSYS_USE___INT64) - KWSYS_PLATFORM_CXX_TEST(KWSYS_CAN_CONVERT_UI64_TO_DOUBLE - "Checking whether unsigned __int64 can convert to double" DIRECT) - ELSE() - SET(KWSYS_CAN_CONVERT_UI64_TO_DOUBLE 1) - ENDIF() - # Check signedness of "char" type. KWSYS_PLATFORM_CXX_TEST_RUN(KWSYS_CHAR_IS_SIGNED "Checking whether char is signed" DIRECT) @@ -749,7 +741,7 @@ ENDFOREACH() # Add selected C components. FOREACH(c - Process Base64 Encoding FundamentalType MD5 Terminal System String CPU + Process Base64 Encoding FundamentalType MD5 Terminal System String ) IF(KWSYS_USE_${c}) # Use the corresponding header file. diff --git a/Source/kwsys/CPU.h.in b/Source/kwsys/CPU.h.in deleted file mode 100644 index 66ffbb1..0000000 --- a/Source/kwsys/CPU.h.in +++ /dev/null @@ -1,141 +0,0 @@ -/*============================================================================ - KWSys - Kitware System Library - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#ifndef @KWSYS_NAMESPACE@_CPU_h -#define @KWSYS_NAMESPACE@_CPU_h - -#include <@KWSYS_NAMESPACE@/Configure.h> - -/* Identify possible endian cases. The macro - @KWSYS_NAMESPACE@_CPU_ENDIAN_ID will be defined to one of these, or - 0 if unknown. */ -#define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG 4321 -#define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE 1234 - -/* Apple always defines one of these. */ -#if defined(__LITTLE_ENDIAN__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -#elif defined(__BIG_ENDIAN__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* Alpha */ -#elif defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE - -/* Arm */ -#elif defined(__arm__) -# if !defined(__ARMEB__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -# else -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG -# endif - -/* Intel x86 */ -#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -#elif defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -#elif defined(__MWERKS__) && defined(__INTEL__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE - -/* Intel x86-64 */ -#elif defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -#elif defined(__amd64) || defined(__amd64__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE - -/* Intel Architecture-64 (Itanium) */ -#elif defined(__ia64) || defined(__ia64__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -#elif defined(_IA64) || defined(__IA64__) || defined(_M_IA64) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE - -/* PowerPC */ -#elif defined(__powerpc) || defined(__powerpc__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG -#elif defined(__ppc) || defined(__ppc__) || defined(__POWERPC__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* SPARC */ -#elif defined(__sparc) || defined(__sparc__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* HP/PA RISC */ -#elif defined(__hppa) || defined(__hppa__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* Motorola 68k */ -#elif defined(__m68k__) || defined(M68000) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* MIPSel (MIPS little endian) */ -#elif defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE - -/* MIPSeb (MIPS big endian) */ -#elif defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* MIPS (fallback, big endian) */ -#elif defined(__mips) || defined(__mips__) || defined(__MIPS__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* NIOS2 */ -#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE - -/* OpenRISC 1000 */ -#elif defined(__or1k__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* RS/6000 */ -#elif defined(__THW_RS600) || defined(_IBMR2) || defined(_POWER) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG -#elif defined(_ARCH_PWR) || defined(_ARCH_PWR2) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* System/370 */ -#elif defined(__370__) || defined(__THW_370__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* System/390 */ -#elif defined(__s390__) || defined(__s390x__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* z/Architecture */ -#elif defined(__SYSC_ZARCH__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG - -/* Aarch64 */ -#elif defined(__aarch64__) -# if !defined(__AARCH64EB__) -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -# else -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG -# endif - -/* Unknown CPU */ -#else -# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID 0 -# if !defined(@KWSYS_NAMESPACE@_CPU_UNKNOWN_OKAY) -# error "The target CPU architecture is not known." -# endif -#endif - -/* If building a C or C++ file in kwsys itself, give the source file - access to the macros without a configured namespace. */ -#if defined(KWSYS_NAMESPACE) -# define KWSYS_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID -# define KWSYS_CPU_ENDIAN_ID_BIG @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG -# define KWSYS_CPU_ENDIAN_ID_LITTLE @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE -#endif - -#endif diff --git a/Source/kwsys/FundamentalType.h.in b/Source/kwsys/FundamentalType.h.in index ff20063..e702a7a 100644 --- a/Source/kwsys/FundamentalType.h.in +++ b/Source/kwsys/FundamentalType.h.in @@ -90,18 +90,12 @@ typedef unsigned long kwsysFundamentalType_UInt32; #if @KWSYS_NAMESPACE@_SIZEOF_LONG == 8 typedef signed long kwsysFundamentalType_Int64; typedef unsigned long kwsysFundamentalType_UInt64; -/* Whether UInt64 can be converted to double. */ -# define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE 1 #elif @KWSYS_NAMESPACE@_USE_LONG_LONG && @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG == 8 typedef signed long long kwsysFundamentalType_Int64; typedef unsigned long long kwsysFundamentalType_UInt64; -/* Whether UInt64 can be converted to double. */ -# define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE 1 #elif @KWSYS_NAMESPACE@_USE___INT64 && @KWSYS_NAMESPACE@_SIZEOF___INT64 == 8 typedef signed __int64 kwsysFundamentalType_Int64; typedef unsigned __int64 kwsysFundamentalType_UInt64; -/* Whether UInt64 can be converted to double. */ -# define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE @KWSYS_CAN_CONVERT_UI64_TO_DOUBLE@ #else # error "No native data type can represent a 64-bit integer." #endif @@ -140,7 +134,6 @@ typedef unsigned __int64 kwsysFundamentalType_UInt64; # define KWSYS_USE_LONG_LONG @KWSYS_NAMESPACE@_USE_LONG_LONG # define KWSYS_USE___INT64 @KWSYS_NAMESPACE@_USE___INT64 # define KWSYS_CHAR_IS_SIGNED @KWSYS_NAMESPACE@_CHAR_IS_SIGNED -# define KWSYS_CAN_CONVERT_UI64_TO_DOUBLE @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE #endif #endif diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx index 9626937..aaa33b8 100644 --- a/Source/kwsys/kwsysPlatformTestsCXX.cxx +++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx @@ -78,21 +78,6 @@ int main() } #endif -#ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE -void function(double& l, unsigned __int64 const& r) -{ - l = static_cast<double>(r); -} - -int main() -{ - double tTo = 0.0; - unsigned __int64 tFrom = 0; - function(tTo, tFrom); - return 0; -} -#endif - #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG # include <iostream> int test_istream(std::istream& is, long long& x) diff --git a/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-result.txt b/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-stderr.txt b/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-stderr.txt b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-stderr.txt new file mode 100644 index 0000000..08a9428 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-stderr.txt @@ -0,0 +1 @@ +^Error creating directory .*file_for_test.txt\".$ diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-result.txt b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-stderr.txt b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-stderr.txt diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 57036ba..5e2200f 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -140,6 +140,20 @@ unset(in) unset(out) unset(outfile) +set(out ${RunCMake_BINARY_DIR}/make_directory_output) +set(outfile ${out}/file_for_test.txt) +file(REMOVE_RECURSE "${out}") +file(MAKE_DIRECTORY ${out}) +file(WRITE ${outfile} "") +run_cmake_command(E_make_directory-three-directories + ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${out}/d2) +run_cmake_command(E_make_directory-directory-with-parent + ${CMAKE_COMMAND} -E make_directory ${out}/parent/child) +run_cmake_command(E_make_directory-three-directories-and-file + ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${outfile}) +unset(out) +unset(outfile) + run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env) run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1) diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index c50602d..0a3d324 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -112,6 +112,9 @@ foreach(gen ${generators}) if("${gen}" STREQUAL "TZ") set(SUFFIXES ${SUFFIXES} "*.tar.Z") endif() + if("${gen}" STREQUAL "WIX") + set(SUFFIXES ${SUFFIXES} "*.msi") + endif() if("${gen}" STREQUAL "ZIP") set(SUFFIXES ${SUFFIXES} "*.zip") endif() @@ -120,6 +123,10 @@ foreach(gen ${generators}) endif() endforeach() +if(SUFFIXES) + list(REMOVE_DUPLICATES SUFFIXES) +endif() + if(LOCAL_DIR) file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${LOCAL_DIR}") else() |