summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/prop_tgt/BUILD_RPATH.rst10
-rw-r--r--Help/release/3.7.rst9
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/add-BUILD_RPATH.rst6
-rw-r--r--Help/release/index.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH.rst10
-rw-r--r--Modules/FindMatlab.cmake16
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/CPack/cmCPackGenerator.h10
-rw-r--r--Source/CPack/cmCPackLog.cxx2
-rw-r--r--Source/CPack/cmCPackLog.h10
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx4
-rw-r--r--Source/QtIFW/cmake.org.html2
-rw-r--r--Source/cmCTest.cxx7
-rw-r--r--Source/cmComputeLinkInformation.cxx6
-rw-r--r--Source/cmFileMonitor.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmServerConnection.cxx162
-rw-r--r--Source/cmServerConnection.h15
-rw-r--r--Source/cmTarget.cxx1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx6
-rw-r--r--Source/ctest.cxx4
-rw-r--r--Tests/MacRuntimePath/A/CMakeLists.txt15
-rw-r--r--Utilities/GitSetup/config2
-rw-r--r--Utilities/Release/README2
-rw-r--r--Utilities/Release/linux64_release.cmake1
-rw-r--r--Utilities/Release/osx_release.cmake2
30 files changed, 218 insertions, 112 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 271f497..fa21a1f 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -121,6 +121,7 @@ Properties on Targets
/prop_tgt/AUTORCC
/prop_tgt/AUTORCC_OPTIONS
/prop_tgt/BINARY_DIR
+ /prop_tgt/BUILD_RPATH
/prop_tgt/BUILD_WITH_INSTALL_RPATH
/prop_tgt/BUNDLE_EXTENSION
/prop_tgt/BUNDLE
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index b74f867..f76c467 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -257,6 +257,7 @@ Variables that Control the Build
/variable/CMAKE_AUTORCC_OPTIONS
/variable/CMAKE_AUTOUIC
/variable/CMAKE_AUTOUIC_OPTIONS
+ /variable/CMAKE_BUILD_RPATH
/variable/CMAKE_BUILD_WITH_INSTALL_RPATH
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
diff --git a/Help/prop_tgt/BUILD_RPATH.rst b/Help/prop_tgt/BUILD_RPATH.rst
new file mode 100644
index 0000000..27393f5
--- /dev/null
+++ b/Help/prop_tgt/BUILD_RPATH.rst
@@ -0,0 +1,10 @@
+BUILD_RPATH
+-----------
+
+A :ref:`;-list <CMake Language Lists>` specifying runtime path (``RPATH``)
+entries to add to binaries linked in the build tree (for platforms that
+support it). The entries will *not* be used for binaries in the install
+tree. See also the :prop_tgt:`INSTALL_RPATH` target property.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_BUILD_RPATH` if it is set when a target is created.
diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst
index f02b62d..9794267 100644
--- a/Help/release/3.7.rst
+++ b/Help/release/3.7.rst
@@ -176,7 +176,14 @@ Modules
* A :module:`FindICU` module was introduced to find the International
Components for Unicode (ICU) libraries and programs.
-* The :module:`FindMatlab` module learned to find a SIMULINK component.
+* The :module:`FindMatlab` module learned to find the SIMULINK and MAT
+ components.
+
+* The :module:`FindMatlab` module :command:`matlab_add_mex` command learned
+ to add executables and modules.
+
+* The :module:`FindMatlab` module :command:`matlab_add_unit_test` command
+ learned to support inline Matlab test code.
* The :module:`FindOpenCL` module now provides imported targets.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000..e4cc01e
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+0-sample-topic
+--------------
+
+* This is a sample release note for the change in a topic.
+ Developers should add similar notes for each topic branch
+ making a noteworthy change. Each document should be named
+ and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/add-BUILD_RPATH.rst b/Help/release/dev/add-BUILD_RPATH.rst
new file mode 100644
index 0000000..0d69e45
--- /dev/null
+++ b/Help/release/dev/add-BUILD_RPATH.rst
@@ -0,0 +1,6 @@
+add-BUILD_RPATH
+---------------
+
+* A :variable:`CMAKE_BUILD_RPATH` variable and corresponding
+ :prop_tgt:`BUILD_RPATH` target property were added to support custom
+ ``RPATH`` locations to be added to binaries in the build tree.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 25c6c3e..30decd5 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -5,6 +5,8 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
+.. include:: dev.txt
+
Releases
========
diff --git a/Help/variable/CMAKE_BUILD_RPATH.rst b/Help/variable/CMAKE_BUILD_RPATH.rst
new file mode 100644
index 0000000..f20eb41
--- /dev/null
+++ b/Help/variable/CMAKE_BUILD_RPATH.rst
@@ -0,0 +1,10 @@
+CMAKE_BUILD_RPATH
+-----------------
+
+A :ref:`;-list <CMake Language Lists>` specifying runtime path (``RPATH``)
+entries to add to binaries linked in the build tree (for platforms that
+support it). The entries will *not* be used for binaries in the install
+tree. See also the :variable:`CMAKE_INSTALL_RPATH` variable.
+
+This is used to initialize the :prop_tgt:`BUILD_RPATH` target property
+for all targets.
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 6beacce..b7f2db5 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -737,9 +737,9 @@ endfunction()
# added to the Matlab path.
# ``CUSTOM_MATLAB_COMMAND``
# Matlab script command to run as the test.
-# IIf this is not set, then the following is run:
-# "runtests('matlab_file_name'), exit(max([ans(1,:).Failed]))
-# matlab_file_name comes from UNITTEST_FILE without the .m.
+# If this is not set, then the following is run:
+# ``runtests('matlab_file_name'), exit(max([ans(1,:).Failed]))``
+# where ``matlab_file_name`` is the ``UNITTEST_FILE`` without the extension.
# ``UNITTEST_PRECOMMAND``
# Matlab script command to be ran before the file
# containing the test (eg. GPU device initialisation based on CMake
@@ -753,7 +753,7 @@ endfunction()
# ``MATLAB_ADDITIONAL_STARTUP_OPTIONS``
# a list of additional option in order
# to run Matlab from the command line.
-# -nosplash -nodesktop -nodisplay are always added.
+# ``-nosplash -nodesktop -nodisplay`` are always added.
# ``TEST_ARGS``
# Additional options provided to the add_test command. These
# options are added to the default options (eg. "CONFIGURATIONS Release")
@@ -763,7 +763,7 @@ endfunction()
# ``WORKING_DIRECTORY``
# This will be the working directory for the test. If specified it will
# also be the output directory used for the log file of the test run.
-# If not specifed the temporary directory ${CMAKE_BINARY_DIR}/Matlab will
+# If not specifed the temporary directory ``${CMAKE_BINARY_DIR}/Matlab`` will
# be used as the working directory and the log location.
#
function(matlab_add_unit_test)
@@ -844,7 +844,6 @@ endfunction()
# the same folder without any processing, with the same name as the final
# mex file, and with extension `.m`. In that case, typing ``help <name>``
# in Matlab prints the documentation contained in this file.
-#
# ``MODULE`` or ``SHARED`` may be given to specify the type of library to be
# created. ``EXECUTABLE`` may be given to create an executable instead of
# a library. If no type is given explicitly, the type is ``SHARED``.
@@ -1246,8 +1245,8 @@ if(_numbers_of_matlab_roots GREATER 0)
endif()
-# check if the root changed against the previous defined one, if so
-# clear all the cached variables
+# check if the root changed wrt. the previous defined one, if so
+# clear all the cached variables for being able to reconfigure properly
if(DEFINED Matlab_ROOT_DIR_LAST_CACHED)
if(NOT Matlab_ROOT_DIR_LAST_CACHED STREQUAL Matlab_ROOT_DIR)
@@ -1260,6 +1259,7 @@ if(DEFINED Matlab_ROOT_DIR_LAST_CACHED)
Matlab_ENG_LIBRARY
Matlab_MAT_LIBRARY
Matlab_MEX_EXTENSION
+ Matlab_SIMULINK_INCLUDE_DIR
# internal
Matlab_MEXEXTENSIONS_PROG
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6cb0fea..ee2f4af 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 7)
-set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_RC 1)
+set(CMake_VERSION_PATCH 20161007)
+#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 9232ffc..db20998 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -32,16 +32,6 @@ class cmMakefile;
cmCPackLog_msg.str().c_str()); \
} while (0)
-#ifdef cerr
-#undef cerr
-#endif
-#define cerr no_cerr_use_cmCPack_Log
-
-#ifdef cout
-#undef cout
-#endif
-#define cout no_cout_use_cmCPack_Log
-
/** \class cmCPackGenerator
* \brief A superclass of all CPack Generators
*
diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx
index be429fe..317f613 100644
--- a/Source/CPack/cmCPackLog.cxx
+++ b/Source/CPack/cmCPackLog.cxx
@@ -15,8 +15,6 @@ cmCPackLog::cmCPackLog()
this->NewLine = true;
this->LastTag = cmCPackLog::NOTAG;
-#undef cerr
-#undef cout
this->DefaultOutput = &std::cout;
this->DefaultError = &std::cerr;
diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h
index 0831843..370879d 100644
--- a/Source/CPack/cmCPackLog.h
+++ b/Source/CPack/cmCPackLog.h
@@ -19,16 +19,6 @@
(ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str()); \
} while (0)
-#ifdef cerr
-#undef cerr
-#endif
-#define cerr no_cerr_use_cmCPack_Log
-
-#ifdef cout
-#undef cout
-#endif
-#define cout no_cout_use_cmCPack_Log
-
/** \class cmCPackLog
* \brief A container for CPack generators
*
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 5c45b14..a3281ab 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -415,9 +415,7 @@ int main(int argc, char const* const* argv)
}
doc.SetSection("Generators", v);
-#undef cout
return doc.PrintRequestedDocumentation(std::cout) ? 0 : 1;
-#define cout no_cout_use_cmCPack_Log
}
if (cmSystemTools::GetErrorOccuredFlag()) {
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index b37db30..0052a16 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -375,11 +375,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
xml.StartElement("DefectList");
for (cc = 0; cc < this->GlobalResults.size(); cc++) {
if (this->GlobalResults[cc]) {
-#ifdef cerr
-#undef cerr
-#endif
std::cerr.width(35);
-#define cerr no_cerr
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
this->ResultStringsLong[cc]
<< " - " << this->GlobalResults[cc] << std::endl,
diff --git a/Source/QtIFW/cmake.org.html b/Source/QtIFW/cmake.org.html
index cf5649d..001d634 100644
--- a/Source/QtIFW/cmake.org.html
+++ b/Source/QtIFW/cmake.org.html
@@ -1,6 +1,6 @@
<html>
<head>
-<meta http-equiv="Refresh" content="0; url=http://cmake.org/" />
+<meta http-equiv="Refresh" content="0; url=https://cmake.org/" />
</head>
<body>
</body>
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 1824d94..7dc9e33 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2651,13 +2651,6 @@ static const char* cmCTestStringLogType[] = { "DEBUG",
"ERROR_MESSAGE",
CM_NULLPTR };
-#ifdef cerr
-#undef cerr
-#endif
-#ifdef cout
-#undef cout
-#endif
-
#define cmCTestLogOutputFileLine(stream) \
if (this->ShowLineNumbers) { \
(stream) << std::endl << file << ":" << line << " "; \
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index dc8236d..0807ef8 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1710,6 +1710,12 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
const char* install_rpath = this->Target->GetProperty("INSTALL_RPATH");
cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted);
}
+ if (use_build_rpath) {
+ // Add directories explicitly specified by user
+ if (const char* build_rpath = this->Target->GetProperty("BUILD_RPATH")) {
+ cmCLI_ExpandListUnique(build_rpath, runtimeDirs, emitted);
+ }
+ }
if (use_build_rpath || use_link_rpath) {
std::string rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
const char* stagePath =
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index b97590b..41ec8b4 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -12,7 +12,7 @@
namespace {
void on_directory_change(uv_fs_event_t* handle, const char* filename,
int events, int status);
-void on_handle_close(uv_handle_t* handle);
+void on_fs_close(uv_handle_t* handle);
} // namespace
class cmIBaseWatcher
@@ -177,7 +177,7 @@ public:
{
if (this->Handle) {
uv_fs_event_stop(this->Handle);
- uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_handle_close);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_fs_close);
this->Handle = nullptr;
}
cmVirtualDirectoryWatcher::StopWatching();
@@ -292,9 +292,9 @@ void on_directory_change(uv_fs_event_t* handle, const char* filename,
watcher->Trigger(pathSegment, events, status);
}
-void on_handle_close(uv_handle_t* handle)
+void on_fs_close(uv_handle_t* handle)
{
- delete (reinterpret_cast<uv_fs_event_t*>(handle));
+ delete reinterpret_cast<uv_fs_event_t*>(handle);
}
} // namespace
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e8d66a2..7eb0ebf 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4965,6 +4965,9 @@ bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const
if (this->GetPropertyAsBool("SKIP_BUILD_RPATH")) {
return false;
}
+ if (this->GetProperty("BUILD_RPATH")) {
+ return true;
+ }
if (cmLinkImplementationLibraries const* impl =
this->GetLinkImplementationLibraries(config)) {
return !impl->Libraries.empty();
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index c9822d3..a814d16 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -30,7 +30,7 @@ void on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
if (nread >= 0) {
conn->ReadData(std::string(buf->base, buf->base + nread));
} else {
- conn->HandleEof();
+ conn->TriggerShutdown();
}
delete[](buf->base);
@@ -56,6 +56,28 @@ void on_new_connection(uv_stream_t* stream, int status)
conn->Connect(stream);
}
+void on_signal(uv_signal_t* signal, int signum)
+{
+ auto conn = reinterpret_cast<cmServerConnection*>(signal->data);
+ (void)(signum);
+ conn->TriggerShutdown();
+}
+
+void on_signal_close(uv_handle_t* handle)
+{
+ delete reinterpret_cast<uv_signal_t*>(handle);
+}
+
+void on_pipe_close(uv_handle_t* handle)
+{
+ delete reinterpret_cast<uv_pipe_t*>(handle);
+}
+
+void on_tty_close(uv_handle_t* handle)
+{
+ delete reinterpret_cast<uv_tty_t*>(handle);
+}
+
} // namespace
class LoopGuard
@@ -64,19 +86,25 @@ public:
LoopGuard(cmServerConnection* connection)
: Connection(connection)
{
- Connection->mLoop = uv_default_loop();
- if (Connection->mLoop) {
- Connection->mFileMonitor = new cmFileMonitor(Connection->mLoop);
+ this->Connection->mLoop = uv_default_loop();
+ if (!this->Connection->mLoop) {
+ return;
}
+ this->Connection->mFileMonitor =
+ new cmFileMonitor(this->Connection->mLoop);
}
~LoopGuard()
{
- if (Connection->mFileMonitor) {
- delete Connection->mFileMonitor;
+ if (!this->Connection->mLoop) {
+ return;
}
- uv_loop_close(Connection->mLoop);
- Connection->mLoop = nullptr;
+
+ if (this->Connection->mFileMonitor) {
+ delete this->Connection->mFileMonitor;
+ }
+ uv_loop_close(this->Connection->mLoop);
+ this->Connection->mLoop = nullptr;
}
private:
@@ -111,6 +139,16 @@ bool cmServerConnection::ProcessEvents(std::string* errorMessage)
return false;
}
+ this->SIGINTHandler = new uv_signal_t;
+ uv_signal_init(this->mLoop, this->SIGINTHandler);
+ this->SIGINTHandler->data = static_cast<void*>(this);
+ uv_signal_start(this->SIGINTHandler, &on_signal, SIGINT);
+
+ this->SIGHUPHandler = new uv_signal_t;
+ uv_signal_init(this->mLoop, this->SIGHUPHandler);
+ this->SIGHUPHandler->data = static_cast<void*>(this);
+ uv_signal_start(this->SIGHUPHandler, &on_signal, SIGHUP);
+
if (!DoSetup(errorMessage)) {
return false;
}
@@ -162,9 +200,21 @@ void cmServerConnection::ReadData(const std::string& data)
}
}
-void cmServerConnection::HandleEof()
+void cmServerConnection::TriggerShutdown()
{
this->FileMonitor()->StopMonitoring();
+
+ uv_signal_stop(this->SIGINTHandler);
+ uv_signal_stop(this->SIGHUPHandler);
+
+ uv_close(reinterpret_cast<uv_handle_t*>(this->SIGINTHandler),
+ &on_signal_close); // delete handle
+ uv_close(reinterpret_cast<uv_handle_t*>(this->SIGHUPHandler),
+ &on_signal_close); // delete handle
+
+ this->SIGINTHandler = nullptr;
+ this->SIGHUPHandler = nullptr;
+
this->TearDown();
}
@@ -194,30 +244,42 @@ void cmServerConnection::SendGreetings()
Server->PrintHello();
}
+cmServerStdIoConnection::cmServerStdIoConnection()
+{
+ this->Input.tty = nullptr;
+ this->Output.tty = nullptr;
+}
+
bool cmServerStdIoConnection::DoSetup(std::string* errorMessage)
{
(void)(errorMessage);
if (uv_guess_handle(1) == UV_TTY) {
- uv_tty_init(this->Loop(), &this->Input.tty, 0, 1);
- uv_tty_set_mode(&this->Input.tty, UV_TTY_MODE_NORMAL);
- Input.tty.data = this;
- this->ReadStream = reinterpret_cast<uv_stream_t*>(&this->Input.tty);
-
- uv_tty_init(this->Loop(), &this->Output.tty, 1, 0);
- uv_tty_set_mode(&this->Output.tty, UV_TTY_MODE_NORMAL);
- Output.tty.data = this;
- this->WriteStream = reinterpret_cast<uv_stream_t*>(&this->Output.tty);
+ usesTty = true;
+ this->Input.tty = new uv_tty_t;
+ uv_tty_init(this->Loop(), this->Input.tty, 0, 1);
+ uv_tty_set_mode(this->Input.tty, UV_TTY_MODE_NORMAL);
+ Input.tty->data = this;
+ this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.tty);
+
+ this->Output.tty = new uv_tty_t;
+ uv_tty_init(this->Loop(), this->Output.tty, 1, 0);
+ uv_tty_set_mode(this->Output.tty, UV_TTY_MODE_NORMAL);
+ Output.tty->data = this;
+ this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.tty);
} else {
- uv_pipe_init(this->Loop(), &this->Input.pipe, 0);
- uv_pipe_open(&this->Input.pipe, 0);
- Input.pipe.data = this;
- this->ReadStream = reinterpret_cast<uv_stream_t*>(&this->Input.pipe);
-
- uv_pipe_init(this->Loop(), &this->Output.pipe, 0);
- uv_pipe_open(&this->Output.pipe, 1);
- Output.pipe.data = this;
- this->WriteStream = reinterpret_cast<uv_stream_t*>(&this->Output.pipe);
+ usesTty = false;
+ this->Input.pipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->Input.pipe, 0);
+ uv_pipe_open(this->Input.pipe, 0);
+ Input.pipe->data = this;
+ this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.pipe);
+
+ this->Output.pipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->Output.pipe, 0);
+ uv_pipe_open(this->Output.pipe, 1);
+ Output.pipe->data = this;
+ this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.pipe);
}
SendGreetings();
@@ -228,26 +290,35 @@ bool cmServerStdIoConnection::DoSetup(std::string* errorMessage)
void cmServerStdIoConnection::TearDown()
{
- uv_close(reinterpret_cast<uv_handle_t*>(this->ReadStream), nullptr);
+ if (usesTty) {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Input.tty), &on_tty_close);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Output.tty), &on_tty_close);
+ this->Input.tty = nullptr;
+ this->Output.tty = nullptr;
+ } else {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Input.pipe), &on_pipe_close);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Output.pipe),
+ &on_pipe_close);
+ this->Input.pipe = nullptr;
+ this->Input.pipe = nullptr;
+ }
this->ReadStream = nullptr;
- uv_close(reinterpret_cast<uv_handle_t*>(this->WriteStream), nullptr);
this->WriteStream = nullptr;
}
cmServerPipeConnection::cmServerPipeConnection(const std::string& name)
: PipeName(name)
{
- this->ServerPipe.data = nullptr;
- this->ClientPipe.data = nullptr;
}
bool cmServerPipeConnection::DoSetup(std::string* errorMessage)
{
- uv_pipe_init(this->Loop(), &this->ServerPipe, 0);
- this->ServerPipe.data = this;
+ this->ServerPipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->ServerPipe, 0);
+ this->ServerPipe->data = this;
int r;
- if ((r = uv_pipe_bind(&this->ServerPipe, this->PipeName.c_str())) != 0) {
+ if ((r = uv_pipe_bind(this->ServerPipe, this->PipeName.c_str())) != 0) {
*errorMessage = std::string("Internal Error with ") + this->PipeName +
": " + uv_err_name(r);
return false;
@@ -265,31 +336,34 @@ bool cmServerPipeConnection::DoSetup(std::string* errorMessage)
void cmServerPipeConnection::TearDown()
{
- if (this->WriteStream->data) {
- uv_close(reinterpret_cast<uv_handle_t*>(this->WriteStream), nullptr);
+ if (this->ClientPipe) {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->ClientPipe), &on_pipe_close);
this->WriteStream->data = nullptr;
}
- uv_close(reinterpret_cast<uv_handle_t*>(&this->ServerPipe), nullptr);
+ uv_close(reinterpret_cast<uv_handle_t*>(&this->ServerPipe), &on_pipe_close);
+ this->ClientPipe = nullptr;
+ this->ServerPipe = nullptr;
this->WriteStream = nullptr;
this->ReadStream = nullptr;
}
void cmServerPipeConnection::Connect(uv_stream_t* server)
{
- if (this->ClientPipe.data == this) {
+ if (this->ClientPipe) {
// Accept and close all pipes but the first:
- uv_pipe_t rejectPipe;
+ uv_pipe_t* rejectPipe = new uv_pipe_t;
- uv_pipe_init(this->Loop(), &rejectPipe, 0);
- auto rejecter = reinterpret_cast<uv_stream_t*>(&rejectPipe);
+ uv_pipe_init(this->Loop(), rejectPipe, 0);
+ auto rejecter = reinterpret_cast<uv_stream_t*>(rejectPipe);
uv_accept(server, rejecter);
- uv_close(reinterpret_cast<uv_handle_t*>(rejecter), nullptr);
+ uv_close(reinterpret_cast<uv_handle_t*>(rejecter), &on_pipe_close);
return;
}
- uv_pipe_init(this->Loop(), &this->ClientPipe, 0);
- this->ClientPipe.data = this;
+ this->ClientPipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->ClientPipe, 0);
+ this->ClientPipe->data = this;
auto client = reinterpret_cast<uv_stream_t*>(&this->ClientPipe);
if (uv_accept(server, client) != 0) {
uv_close(reinterpret_cast<uv_handle_t*>(client), nullptr);
diff --git a/Source/cmServerConnection.h b/Source/cmServerConnection.h
index 78842e7..3efe28d 100644
--- a/Source/cmServerConnection.h
+++ b/Source/cmServerConnection.h
@@ -24,7 +24,7 @@ public:
bool ProcessEvents(std::string* errorMessage);
void ReadData(const std::string& data);
- void HandleEof();
+ void TriggerShutdown();
void WriteData(const std::string& data);
void ProcessNextRequest();
@@ -51,6 +51,8 @@ private:
uv_loop_t* mLoop = nullptr;
cmFileMonitor* mFileMonitor = nullptr;
cmServer* Server = nullptr;
+ uv_signal_t* SIGINTHandler = nullptr;
+ uv_signal_t* SIGHUPHandler = nullptr;
friend class LoopGuard;
};
@@ -58,6 +60,7 @@ private:
class cmServerStdIoConnection : public cmServerConnection
{
public:
+ cmServerStdIoConnection();
bool DoSetup(std::string* errorMessage) override;
void TearDown() override;
@@ -65,10 +68,12 @@ public:
private:
typedef union
{
- uv_tty_t tty;
- uv_pipe_t pipe;
+ uv_tty_t* tty;
+ uv_pipe_t* pipe;
} InOutUnion;
+ bool usesTty = false;
+
InOutUnion Input;
InOutUnion Output;
};
@@ -85,6 +90,6 @@ public:
private:
const std::string PipeName;
- uv_pipe_t ServerPipe;
- uv_pipe_t ClientPipe;
+ uv_pipe_t* ServerPipe = nullptr;
+ uv_pipe_t* ClientPipe = nullptr;
};
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 54e0bea..13a4744 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -102,6 +102,7 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type,
this->SetPropertyDefault("ANDROID_JAR_DEPENDENCIES", CM_NULLPTR);
this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", CM_NULLPTR);
this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", CM_NULLPTR);
+ this->SetPropertyDefault("BUILD_RPATH", CM_NULLPTR);
this->SetPropertyDefault("INSTALL_NAME_DIR", CM_NULLPTR);
this->SetPropertyDefault("INSTALL_RPATH", "");
this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF");
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d81f59d..6690bfa 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2736,8 +2736,10 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
(*this->BuildFileStream) << cmVS10EscapeXML(artifactDir)
<< "\\</AppxPackageArtifactsDir>\n";
this->WriteString("<ProjectPriFullPath>", 2);
- (*this->BuildFileStream) << cmVS10EscapeXML(artifactDir)
- << "\\resources.pri</ProjectPriFullPath>\n";
+ std::string resourcePriFile =
+ this->DefaultArtifactDir + "/resources.pri";
+ this->ConvertToWindowsSlash(resourcePriFile);
+ (*this->BuildFileStream) << resourcePriFile << "</ProjectPriFullPath>\n";
// If we are missing files and we don't have a certificate and
// aren't targeting WP8.0, add a default certificate
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 1fb39ff..8ab17b9 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -163,11 +163,7 @@ int main(int argc, char const* const* argv)
doc.SetSection("Name", cmDocumentationName);
doc.SetSection("Usage", cmDocumentationUsage);
doc.PrependSection("Options", cmDocumentationOptions);
-#ifdef cout
-#undef cout
-#endif
return doc.PrintRequestedDocumentation(std::cout) ? 0 : 1;
-#define cout no_cout_use_cmCTestLog
}
}
diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt
index ade0a3c..bf937e6 100644
--- a/Tests/MacRuntimePath/A/CMakeLists.txt
+++ b/Tests/MacRuntimePath/A/CMakeLists.txt
@@ -40,21 +40,30 @@ target_link_libraries(test3 framework)
add_executable(test4 test1.cpp)
target_link_libraries(test4 shared2)
+# executable to test a shared library dependency with build rpath
+add_executable(test5 test1.cpp)
+
+# avoid linking by 'target_link_libraries' so CMake
+# will not be able to set correct RPATH automatically
+add_dependencies(test5 shared)
+target_link_libraries(test5 "$<TARGET_FILE:shared>")
+set_target_properties(test5 PROPERTIES BUILD_RPATH "@loader_path/../lib")
+
set_target_properties(shared shared2 framework PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
-set_target_properties(test1 test2 test3 test4 PROPERTIES
+set_target_properties(test1 test2 test3 test4 test5 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} CONFIG)
set_target_properties(shared shared2 framework PROPERTIES
LIBRARY_OUTPUT_DIRECTORY_${CONFIG}
"${CMAKE_CURRENT_BINARY_DIR}/${config}/lib")
- set_target_properties(test1 test2 test3 test4 PROPERTIES
+ set_target_properties(test1 test2 test3 test4 test5 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_${CONFIG}
"${CMAKE_CURRENT_BINARY_DIR}/${config}/bin")
endforeach()
-foreach(test test1 test2 test3 test4)
+foreach(test test1 test2 test3 test4 test5)
add_custom_target(${test}_run ALL
COMMAND ${test}
DEPENDS ${test}
diff --git a/Utilities/GitSetup/config b/Utilities/GitSetup/config
index b7d5423..d69a679 100644
--- a/Utilities/GitSetup/config
+++ b/Utilities/GitSetup/config
@@ -1,5 +1,5 @@
[hooks]
- url = http://cmake.org/cmake.git
+ url = https://cmake.org/cmake.git
[ssh]
host = cmake.org
key = id_git_cmake
diff --git a/Utilities/Release/README b/Utilities/Release/README
index ed1d52e..11de1c3 100644
--- a/Utilities/Release/README
+++ b/Utilities/Release/README
@@ -1,7 +1,7 @@
To create a cmake release, make sure the "release" tag is pointing to the
expected git commit:
-http://cmake.org/gitweb?p=cmake.git;a=shortlog;h=refs/heads/release
+https://cmake.org/gitweb?p=cmake.git;a=shortlog;h=refs/heads/release
Then as kitware@hythloth, using an up-to-date CMake:
diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake
index b72fc12..b9447ca 100644
--- a/Utilities/Release/linux64_release.cmake
+++ b/Utilities/Release/linux64_release.cmake
@@ -2,6 +2,7 @@ set(PROCESSORS 4)
set(BOOTSTRAP_ARGS "--docdir=doc/cmake")
set(HOST linux64)
set(MAKE_PROGRAM "make")
+set(CPACK_BINARY_GENERATORS "STGZ TGZ")
set(CC /opt/gcc-6.1.0/bin/gcc)
set(CXX /opt/gcc-6.1.0/bin/g++)
set(CFLAGS "")
diff --git a/Utilities/Release/osx_release.cmake b/Utilities/Release/osx_release.cmake
index 27c820f..88ea39b 100644
--- a/Utilities/Release/osx_release.cmake
+++ b/Utilities/Release/osx_release.cmake
@@ -4,7 +4,7 @@ set(BOOTSTRAP_ARGS "--prefix=/ --docdir=doc/cmake")
set(HOST dragnipur)
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j5")
-set(CPACK_BINARY_GENERATORS "DragNDrop TGZ TZ")
+set(CPACK_BINARY_GENERATORS "DragNDrop TGZ")
set(CPACK_SOURCE_GENERATORS "TGZ TZ")
set(CPACK_DMG_FORMAT "UDBZ") #build using bzip2 for smaller package size
set(CC clang)