[Cmake-commits] CMake branch, master, updated. v3.10.0-rc2-67-g60f982a
Kitware Robot
kwrobot at kitware.com
Mon Oct 16 09:55:08 EDT 2017
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, master has been updated
via 60f982aab4fc99bab5cafee1db148f61ba3b9d77 (commit)
via 800c0e810520bd6fe2827c9c89b0b863df1592b9 (commit)
via 9de7ae6e5ec46f87b318591c0e1a32f98df26c63 (commit)
via 42461a2a01e314dffe8841bef329d44d180e0044 (commit)
via 9c3bdbd584bf449ccc80565185839ccd7ab939a5 (commit)
via 22beb07f9871338c3cdc1ce47bf1da0433519547 (commit)
via 2de0e0fdfaed1c10d3b38a8fb7ff86698a0308aa (commit)
via e1409101c99f7a3487990e9927e8bd0e275f564f (commit)
via e258fe03968d27871d6a57e3f4571bc8fbba6b9b (commit)
via df92617b7323978c0a8d589fd6b41fcc2c67613e (commit)
via e44b0cb2f0d6d0065faabd510efdcfc6359a8025 (commit)
via 48dcb2f0556a6780e50c94ff2e50d5b7c705ac68 (commit)
via 1943dc6bd5820424352db08dd2d65fb5a3cb2ef6 (commit)
from 386f7c6e98a6ed2bb64915670b28aa7e95b517a6 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60f982aab4fc99bab5cafee1db148f61ba3b9d77
commit 60f982aab4fc99bab5cafee1db148f61ba3b9d77
Merge: 800c0e8 22beb07
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 16 13:51:43 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 16 09:51:46 2017 -0400
Merge topic 'imported-interface-no-system'
22beb07f Help: Clarify documentation of NO_SYSTEM_FROM_IMPORTED
2de0e0fd Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1386
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=800c0e810520bd6fe2827c9c89b0b863df1592b9
commit 800c0e810520bd6fe2827c9c89b0b863df1592b9
Merge: 9de7ae6 48dcb2f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 16 13:48:48 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 16 09:48:53 2017 -0400
Merge topic 'UseJava-add_jar-split-build-and-output-dirs'
48dcb2f0 UseJava: add_jar OUTPUT_DIR option used only for jar generation.
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1380
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9de7ae6e5ec46f87b318591c0e1a32f98df26c63
commit 9de7ae6e5ec46f87b318591c0e1a32f98df26c63
Merge: 42461a2 e140910
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 16 13:47:53 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 16 09:48:02 2017 -0400
Merge topic 'cpack-wix-cygwin'
e1409101 cpack wix: support WiX generator on Cygwin
e258fe03 cpack wix: fix path error on cygwin
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1367
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42461a2a01e314dffe8841bef329d44d180e0044
commit 42461a2a01e314dffe8841bef329d44d180e0044
Merge: 9c3bdbd 1943dc6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 16 13:46:32 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 16 09:47:34 2017 -0400
Merge topic 'cpack-dmg-errors'
1943dc6b cmCPackDragNDropGenerator: Improve error reporting
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1379
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c3bdbd584bf449ccc80565185839ccd7ab939a5
commit 9c3bdbd584bf449ccc80565185839ccd7ab939a5
Merge: 386f7c6 df92617
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 16 13:46:10 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 16 09:46:23 2017 -0400
Merge topic 'update-kwsys'
df92617b Merge branch 'upstream-KWSys' into update-kwsys
e44b0cb2 KWSys 2017-10-12 (ef0ad34d)
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1384
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=22beb07f9871338c3cdc1ce47bf1da0433519547
commit 22beb07f9871338c3cdc1ce47bf1da0433519547
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 13 14:27:20 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 13 14:32:15 2017 -0400
Help: Clarify documentation of NO_SYSTEM_FROM_IMPORTED
This property is meant to be set on the consumers of imported targets,
not the imported targets themselves.
Fixes: #17348
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 5cfe725..ae538ed 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -687,7 +687,8 @@ property are treated as ``SYSTEM`` include directories, as if they were
listed in the :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` of the
dependency. This can result in omission of compiler warnings for headers
found in those directories. This behavior for :ref:`imported targets` may
-be controlled with the :prop_tgt:`NO_SYSTEM_FROM_IMPORTED` target property.
+be controlled by setting the :prop_tgt:`NO_SYSTEM_FROM_IMPORTED` target
+property on the *consumers* of imported targets.
If a binary target is linked transitively to a Mac OX framework, the
``Headers`` directory of the framework is also treated as a usage requirement.
diff --git a/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst b/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst
index 070dd30..880343d 100644
--- a/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst
+++ b/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst
@@ -1,11 +1,15 @@
NO_SYSTEM_FROM_IMPORTED
-----------------------
-Do not treat includes from IMPORTED target interfaces as SYSTEM.
+Do not treat include directories from the interfaces of consumed
+:ref:`imported targets` as ``SYSTEM``.
-The contents of the INTERFACE_INCLUDE_DIRECTORIES of IMPORTED targets
-are treated as SYSTEM includes by default. If this property is
-enabled, the contents of the INTERFACE_INCLUDE_DIRECTORIES of IMPORTED
-targets are not treated as system includes. This property is
-initialized by the value of the variable CMAKE_NO_SYSTEM_FROM_IMPORTED
-if it is set when a target is created.
+The contents of the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property
+of imported targets are treated as ``SYSTEM`` includes by default. If this
+property is enabled on a target, compilation of sources in that target will
+not treat the contents of the ``INTERFACE_INCLUDE_DIRECTORIES`` of consumed
+imported targets as system includes.
+
+This property is initialized by the value of the
+:variable:`CMAKE_NO_SYSTEM_FROM_IMPORTED` variable if it is set when a target
+is created.
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2de0e0fdfaed1c10d3b38a8fb7ff86698a0308aa
commit 2de0e0fdfaed1c10d3b38a8fb7ff86698a0308aa
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 13 14:24:52 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 13 14:32:14 2017 -0400
Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
The change in commit v3.8.0-rc1~276^2 (Allow NO_SYSTEM_FROM_IMPORTED on
imported INTERFACE libraries, 2016-11-21) was incorrect. The property
is not meant to be set on imported targets at all. It is meant to be
set on their consumers that compile sources. Since INTERFACE libraries
have no sources to compile, the property is not needed on them.
Revert most of that change. Unfortunately we must still tolerate
project code setting NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
because they were allowed by CMake 3.8 and 3.9.
Issue: #17348
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index debaf23..5cfe725 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -970,7 +970,6 @@ are:
* ``EXPORT_NAME``
* ``IMPORTED``
* ``NAME``
-* ``NO_SYSTEM_FROM_IMPORTED``
* Properties matching ``IMPORTED_LIBNAME_*``
* Properties matching ``MAP_IMPORTED_CONFIG_*``
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7a3cc76..c6cd502 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -256,6 +256,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("WIN32_EXECUTABLE", nullptr);
this->SetPropertyDefault("MACOSX_BUNDLE", nullptr);
this->SetPropertyDefault("MACOSX_RPATH", nullptr);
+ this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", nullptr);
this->SetPropertyDefault("BUILD_WITH_INSTALL_NAME_DIR", nullptr);
this->SetPropertyDefault("C_CLANG_TIDY", nullptr);
this->SetPropertyDefault("C_COMPILER_LAUNCHER", nullptr);
@@ -282,10 +283,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("LINK_SEARCH_END_STATIC", nullptr);
}
- if (this->GetType() != cmStateEnums::UTILITY) {
- this->SetPropertyDefault("NO_SYSTEM_FROM_IMPORTED", nullptr);
- }
-
// Collect the set of configuration types.
std::vector<std::string> configNames;
mf->GetConfigurations(configNames);
diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx
index 3a3c165..1d2520d 100644
--- a/Source/cmTargetPropertyComputer.cxx
+++ b/Source/cmTargetPropertyComputer.cxx
@@ -66,12 +66,19 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty(
}
if (prop == "IMPORTED_CONFIGURATIONS" || prop == "IMPORTED_LIBNAME" ||
- prop == "NO_SYSTEM_FROM_IMPORTED" ||
cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME_") ||
cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_")) {
return true;
}
+ // This property should not be allowed but was incorrectly added in
+ // CMake 3.8. We can't remove it from the whitelist without breaking
+ // projects that try to set it. One day we could warn about this, but
+ // for now silently accept it.
+ if (prop == "NO_SYSTEM_FROM_IMPORTED") {
+ return true;
+ }
+
return false;
}
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 33c4b90..3db210a 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -64,7 +64,6 @@ target_link_libraries(iface_whitelist INTERFACE $<$<BOOL:$<TARGET_PROPERTY:CUSTO
add_executable(exec_whitelist dummy.cpp)
target_link_libraries(exec_whitelist iface_whitelist)
-set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1)
add_library(iface_imported INTERFACE IMPORTED)
set_property(TARGET iface_imported PROPERTY
INTERFACE_COMPILE_DEFINITIONS
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e1409101c99f7a3487990e9927e8bd0e275f564f
commit e1409101c99f7a3487990e9927e8bd0e275f564f
Author: Stephen Sorley <ssorley at monetra.com>
AuthorDate: Mon Oct 9 11:39:29 2017 -0400
Commit: Stephen Sorley <ssorley at monetra.com>
CommitDate: Fri Oct 13 13:07:37 2017 -0400
cpack wix: support WiX generator on Cygwin
Cygwin-built CMake now converts paths from Cygwin to Windows form
(using cygpath -w) before they're passed to WiX.
The Wix generator on Cygwin requires the libuuid-dev package when
building CMake. However, the DLL it links to is installed by default
as part of Cygwin's core libs, so it does not need to be distributed.
If libuuid-dev isn't available, CMake is simply built without Wix
support on Cygwin.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index a4dd918..e1c34bf 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -936,8 +936,13 @@ if(UNIX)
endif()
endif()
-if(WIN32)
+if(CYGWIN)
+ find_package(LibUUID)
+endif()
+if(WIN32 OR (CYGWIN AND LibUUID_FOUND))
set(CPACK_SRCS ${CPACK_SRCS}
+ CPack/Wix/cmCMakeToWixPath.cxx
+ CPack/Wix/cmCMakeToWixPath.h
CPack/WiX/cmCPackWIXGenerator.cxx
CPack/WiX/cmCPackWIXGenerator.h
CPack/WiX/cmWIXAccessControlList.cxx
@@ -958,7 +963,7 @@ if(WIN32)
CPack/WiX/cmWIXShortcut.h
CPack/WiX/cmWIXSourceWriter.cxx
CPack/WiX/cmWIXSourceWriter.h
- )
+ )
endif()
if(APPLE)
@@ -991,6 +996,11 @@ if(APPLE)
"See CMakeFiles/CMakeError.log for details of the failure.")
endif()
endif()
+if(CYGWIN AND LibUUID_FOUND)
+ target_link_libraries(CPackLib ${LibUUID_LIBRARIES})
+ include_directories(CPackLib ${LibUUID_INCLUDE_DIRS})
+ set_property(SOURCE CPack/cmCPackGeneratorFactory.cxx PROPERTY COMPILE_DEFINITIONS HAVE_LIBUUID)
+endif()
if(CPACK_ENABLE_FREEBSD_PKG AND FREEBSD_PKG_INCLUDE_DIRS AND FREEBSD_PKG_LIBRARIES)
target_link_libraries(CPackLib ${FREEBSD_PKG_LIBRARIES})
include_directories(${FREEBSD_PKG_INCLUDE_DIRS})
diff --git a/Source/CPack/WiX/cmCMakeToWixPath.cxx b/Source/CPack/WiX/cmCMakeToWixPath.cxx
new file mode 100644
index 0000000..0b0e42a
--- /dev/null
+++ b/Source/CPack/WiX/cmCMakeToWixPath.cxx
@@ -0,0 +1,39 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmCMakeToWixPath.h"
+
+#include "cmSystemTools.h"
+
+#include <string>
+#include <vector>
+
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+std::string CMakeToWixPath(const std::string& cygpath)
+{
+ std::vector<char> winpath_chars;
+ ssize_t winpath_size;
+
+ // Get the required buffer size.
+ winpath_size =
+ cygwin_conv_path(CCP_POSIX_TO_WIN_A, cygpath.c_str(), nullptr, 0);
+ if (winpath_size <= 0) {
+ return cygpath;
+ }
+
+ winpath_chars.assign(static_cast<size_t>(winpath_size) + 1, '\0');
+
+ winpath_size = cygwin_conv_path(CCP_POSIX_TO_WIN_A, cygpath.c_str(),
+ winpath_chars.data(), winpath_size);
+ if (winpath_size < 0) {
+ return cygpath;
+ }
+
+ return cmSystemTools::TrimWhitespace(winpath_chars.data());
+}
+#else
+std::string CMakeToWixPath(const std::string& path)
+{
+ return path;
+}
+#endif
diff --git a/Source/CPack/WiX/cmCMakeToWixPath.h b/Source/CPack/WiX/cmCMakeToWixPath.h
new file mode 100644
index 0000000..8bb9e04
--- /dev/null
+++ b/Source/CPack/WiX/cmCMakeToWixPath.h
@@ -0,0 +1,12 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmCMakeToWixPath_h
+#define cmCMakeToWixPath_h
+
+#include "cmConfigure.h" //IWYU pragma: keep
+
+#include <string>
+
+std::string CMakeToWixPath(const std::string& cygpath);
+
+#endif // cmCMakeToWixPath_h
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index ba07d08..a0bc0ea 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -22,7 +22,13 @@
#include "cmsys/FStream.hxx"
#include "cmsys/SystemTools.hxx"
-#include <rpc.h> // for GUID generation
+#ifdef _WIN32
+#include <rpc.h> // for GUID generation (windows only)
+#else
+#include <uuid/uuid.h> // for GUID generation (libuuid)
+#endif
+
+#include "cmCMakeToWixPath.h"
cmCPackWIXGenerator::cmCPackWIXGenerator()
: Patch(0)
@@ -110,7 +116,7 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles)
std::ostringstream command;
command << QuotePath(executable);
command << " -nologo";
- command << " -out " << QuotePath(packageFileNames.at(0));
+ command << " -out " << QuotePath(CMakeToWixPath(packageFileNames.at(0)));
for (std::string const& ext : this->LightExtensions) {
command << " -ext " << QuotePath(ext);
@@ -270,11 +276,12 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
std::string objectFilename =
this->CPackTopLevel + "/" + uniqueBaseName + ".wixobj";
- if (!RunCandleCommand(sourceFilename, objectFilename)) {
+ if (!RunCandleCommand(CMakeToWixPath(sourceFilename),
+ CMakeToWixPath(objectFilename))) {
return false;
}
- objectFiles << " " << QuotePath(objectFilename);
+ objectFiles << " " << QuotePath(CMakeToWixPath(objectFilename));
}
AppendUserSuppliedExtraObjects(objectFiles);
@@ -320,10 +327,10 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
CopyDefinition(includeFile, "CPACK_PACKAGE_VENDOR");
CopyDefinition(includeFile, "CPACK_PACKAGE_NAME");
CopyDefinition(includeFile, "CPACK_PACKAGE_VERSION");
- CopyDefinition(includeFile, "CPACK_WIX_LICENSE_RTF");
- CopyDefinition(includeFile, "CPACK_WIX_PRODUCT_ICON");
- CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER");
- CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG");
+ CopyDefinition(includeFile, "CPACK_WIX_LICENSE_RTF", DefinitionType::PATH);
+ CopyDefinition(includeFile, "CPACK_WIX_PRODUCT_ICON", DefinitionType::PATH);
+ CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER", DefinitionType::PATH);
+ CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG", DefinitionType::PATH);
SetOptionIfNotSet("CPACK_WIX_PROGRAM_MENU_FOLDER",
GetOption("CPACK_PACKAGE_NAME"));
CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER");
@@ -390,11 +397,16 @@ void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile()
}
void cmCPackWIXGenerator::CopyDefinition(cmWIXSourceWriter& source,
- std::string const& name)
+ std::string const& name,
+ DefinitionType type)
{
const char* value = GetOption(name.c_str());
if (value) {
- AddDefinition(source, name, value);
+ if (type == DefinitionType::PATH) {
+ AddDefinition(source, name, CMakeToWixPath(value));
+ } else {
+ AddDefinition(source, name, value);
+ }
}
}
@@ -966,6 +978,7 @@ std::string cmCPackWIXGenerator::GetArchitecture() const
std::string cmCPackWIXGenerator::GenerateGUID()
{
+#ifdef _WIN32
UUID guid;
UuidCreate(&guid);
@@ -975,6 +988,14 @@ std::string cmCPackWIXGenerator::GenerateGUID()
std::string result =
cmsys::Encoding::ToNarrow(reinterpret_cast<wchar_t*>(tmp));
RpcStringFreeW(&tmp);
+#else
+ uuid_t guid;
+ char guid_ch[37] = { 0 };
+
+ uuid_generate(guid);
+ uuid_unparse(guid, guid_ch);
+ std::string result = guid_ch;
+#endif
return cmSystemTools::UpperCase(result);
}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index b2633a7..128a04d 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -48,6 +48,12 @@ private:
typedef std::map<std::string, size_t> ambiguity_map_t;
typedef std::set<std::string> extension_set_t;
+ enum class DefinitionType
+ {
+ STRING,
+ PATH
+ };
+
bool InitializeWiXConfiguration();
bool PackageFilesImpl();
@@ -58,7 +64,8 @@ private:
void CreateWiXProductFragmentIncludeFile();
- void CopyDefinition(cmWIXSourceWriter& source, std::string const& name);
+ void CopyDefinition(cmWIXSourceWriter& source, std::string const& name,
+ DefinitionType type = DefinitionType::STRING);
void AddDefinition(cmWIXSourceWriter& source, std::string const& name,
std::string const& value);
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
index b4cd1a3..dd3caf9 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
@@ -11,6 +11,8 @@
#include "cm_sys_stat.h"
+#include "cmCMakeToWixPath.h"
+
cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(cmCPackLog* logger,
std::string const& filename,
GuidType componentGuidType)
@@ -139,7 +141,7 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile(
patch.ApplyFragment(componentId, *this);
BeginElement("File");
AddAttribute("Id", fileId);
- AddAttribute("Source", filePath);
+ AddAttribute("Source", CMakeToWixPath(filePath));
AddAttribute("KeyPath", "yes");
mode_t fileMode = 0;
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 4b81bbc..47e7527 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -40,7 +40,7 @@
#include "cmCPackRPMGenerator.h"
#endif
-#ifdef _WIN32
+#if defined(_WIN32) || (defined(__CYGWIN__) && defined(HAVE_LIBUUID))
#include "WiX/cmCPackWIXGenerator.h"
#endif
@@ -87,7 +87,7 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
this->RegisterGenerator("7Z", "7-Zip file format",
cmCPack7zGenerator::CreateGenerator);
}
-#ifdef _WIN32
+#if defined(_WIN32) || (defined(__CYGWIN__) && defined(HAVE_LIBUUID))
if (cmCPackWIXGenerator::CanGenerate()) {
this->RegisterGenerator("WIX", "MSI file format via WiX tools",
cmCPackWIXGenerator::CreateGenerator);
diff --git a/Source/Modules/FindLibUUID.cmake b/Source/Modules/FindLibUUID.cmake
new file mode 100644
index 0000000..17f11c1
--- /dev/null
+++ b/Source/Modules/FindLibUUID.cmake
@@ -0,0 +1,85 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindLibUUID
+------------
+
+Find LibUUID include directory and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+An :ref:`imported target <Imported targets>` named
+``LibUUID::LibUUID`` is provided if LibUUID has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``LibUUID_FOUND``
+ True if LibUUID was found, false otherwise.
+``LibUUID_INCLUDE_DIRS``
+ Include directories needed to include LibUUID headers.
+``LibUUID_LIBRARIES``
+ Libraries needed to link to LibUUID.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+This module uses the following cache variables:
+
+``LibUUID_LIBRARY``
+ The location of the LibUUID library file.
+``LibUUID_INCLUDE_DIR``
+ The location of the LibUUID include directory containing ``uuid/uuid.h``.
+
+The cache variables should not be used by project code.
+They may be set by end users to point at LibUUID components.
+#]=======================================================================]
+
+#-----------------------------------------------------------------------------
+if(CYGWIN)
+ # Note: on current version of Cygwin, linking to libuuid.dll.a doesn't
+ # import the right symbols sometimes. Fix this by linking directly
+ # to the DLL that provides the symbols, instead.
+ set(old_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
+ find_library(LibUUID_LIBRARY
+ NAMES cyguuid-1.dll
+ )
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${old_suffixes})
+else()
+ find_library(LibUUID_LIBRARY
+ NAMES uuid
+ )
+endif()
+mark_as_advanced(LibUUID_LIBRARY)
+
+find_path(LibUUID_INCLUDE_DIR
+ NAMES uuid/uuid.h
+ )
+mark_as_advanced(LibUUID_INCLUDE_DIR)
+
+#-----------------------------------------------------------------------------
+include(${CMAKE_CURRENT_LIST_DIR}/../../Modules/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibUUID
+ FOUND_VAR LibUUID_FOUND
+ REQUIRED_VARS LibUUID_LIBRARY LibUUID_INCLUDE_DIR
+ )
+set(LIBUUID_FOUND ${LibUUID_FOUND})
+
+#-----------------------------------------------------------------------------
+# Provide documented result variables and targets.
+if(LibUUID_FOUND)
+ set(LibUUID_INCLUDE_DIRS ${LibUUID_INCLUDE_DIR})
+ set(LibUUID_LIBRARIES ${LibUUID_LIBRARY})
+ if(NOT TARGET LibUUID::LibUUID)
+ add_library(LibUUID::LibUUID UNKNOWN IMPORTED)
+ set_target_properties(LibUUID::LibUUID PROPERTIES
+ IMPORTED_LOCATION "${LibUUID_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LibUUID_INCLUDE_DIRS}"
+ )
+ endif()
+endif()
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e258fe03968d27871d6a57e3f4571bc8fbba6b9b
commit e258fe03968d27871d6a57e3f4571bc8fbba6b9b
Author: Stephen Sorley <ssorley at monetra.com>
AuthorDate: Mon Oct 9 11:28:25 2017 -0400
Commit: Stephen Sorley <ssorley at monetra.com>
CommitDate: Fri Oct 13 11:48:36 2017 -0400
cpack wix: fix path error on cygwin
Under Cygwin, file(TO_CMAKE_PATH...) outputs invalid paths when given
a Windows path as input (the colon after the drive letter gets replaced
by a semicolon).
As a workaround, just use a string replace to change the slashes instead.
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 1dc37d4..c723e72 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -289,7 +289,7 @@
#
if(NOT CPACK_WIX_ROOT)
- file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT)
+ string(REPLACE "\\" "/" CPACK_WIX_ROOT "$ENV{WIX}")
endif()
find_program(CPACK_WIX_CANDLE_EXECUTABLE candle
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df92617b7323978c0a8d589fd6b41fcc2c67613e
commit df92617b7323978c0a8d589fd6b41fcc2c67613e
Merge: 18eec11 e44b0cb
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 13 09:14:04 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 13 09:14:04 2017 -0400
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2017-10-12 (ef0ad34d)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e44b0cb2f0d6d0065faabd510efdcfc6359a8025
commit e44b0cb2f0d6d0065faabd510efdcfc6359a8025
Author: KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Thu Oct 12 06:59:48 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 13 09:13:56 2017 -0400
KWSys 2017-10-12 (ef0ad34d)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit ef0ad34d280f0553fc4f6e7202a5e7d6241cdc9c (master).
Upstream Shortlog
-----------------
Rolf Eike Beer (2):
8717ac15 DynamicLoader: use std::string instead of strcpy() + strcat()
88d4dd4b CommandLineArguments: use std::string in GenerateHelp()
Wouter Klouwen (1):
749b7506 ProcessUNIX: Use monotonic clock in kwsysProcessTimeGetCurrent() for POSIX
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21568bb..f36f9b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -445,8 +445,13 @@ KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
"Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
"Checking whether C compiler has ssize_t in unistd.h" DIRECT)
+IF(KWSYS_USE_Process)
+ KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC
+ "Checking whether C compiler has clock_gettime" DIRECT)
+ENDIF()
+
SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES
- COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
+ COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T} -DKWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC=${KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC}"
)
IF(DEFINED KWSYS_PROCESS_USE_SELECT)
diff --git a/CommandLineArguments.cxx b/CommandLineArguments.cxx
index 5498377..5792da9 100644
--- a/CommandLineArguments.cxx
+++ b/CommandLineArguments.cxx
@@ -529,10 +529,7 @@ void CommandLineArguments::GenerateHelp()
}
}
- // Create format for that string
- char format[80];
- sprintf(format, " %%-%us ", static_cast<unsigned int>(maxlen));
-
+ CommandLineArguments::Internal::String::size_type maxstrlen = maxlen;
maxlen += 4; // For the space before and after the option
// Print help for each option
@@ -540,27 +537,24 @@ void CommandLineArguments::GenerateHelp()
CommandLineArguments::Internal::SetOfStrings::iterator sit;
for (sit = mpit->second.begin(); sit != mpit->second.end(); sit++) {
str << std::endl;
- char argument[100];
- sprintf(argument, "%s", sit->c_str());
+ std::string argument = *sit;
switch (this->Internals->Callbacks[*sit].ArgumentType) {
case CommandLineArguments::NO_ARGUMENT:
break;
case CommandLineArguments::CONCAT_ARGUMENT:
- strcat(argument, "opt");
+ argument += "opt";
break;
case CommandLineArguments::SPACE_ARGUMENT:
- strcat(argument, " opt");
+ argument += " opt";
break;
case CommandLineArguments::EQUAL_ARGUMENT:
- strcat(argument, "=opt");
+ argument += "=opt";
break;
case CommandLineArguments::MULTI_ARGUMENT:
- strcat(argument, " opt opt ...");
+ argument += " opt opt ...";
break;
}
- char buffer[80];
- sprintf(buffer, format, argument);
- str << buffer;
+ str << " " << argument.substr(0, maxstrlen) << " ";
}
const char* ptr = this->Internals->Callbacks[mpit->first].Help;
size_t len = strlen(ptr);
diff --git a/DynamicLoader.cxx b/DynamicLoader.cxx
index 1b4596a..664f183 100644
--- a/DynamicLoader.cxx
+++ b/DynamicLoader.cxx
@@ -163,17 +163,13 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
{
void* result = 0;
// Need to prepend symbols with '_' on Apple-gcc compilers
- size_t len = sym.size();
- char* rsym = new char[len + 1 + 1];
- strcpy(rsym, "_");
- strcat(rsym + 1, sym.c_str());
+ std::string rsym = '_' + sym;
- NSSymbol symbol = NSLookupSymbolInModule(lib, rsym);
+ NSSymbol symbol = NSLookupSymbolInModule(lib, rsym.c_str());
if (symbol) {
result = NSAddressOfSymbol(symbol);
}
- delete[] rsym;
// Hack to cast pointer-to-data to pointer-to-function.
return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
}
@@ -237,17 +233,12 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
void* result;
#if defined(__BORLANDC__) || defined(__WATCOMC__)
// Need to prepend symbols with '_'
- size_t len = sym.size();
- char* rsym = new char[len + 1 + 1];
- strcpy(rsym, "_");
- strcat(rsym, sym.c_str());
+ std::string ssym = '_' + sym;
+ const char* rsym = ssym.c_str();
#else
const char* rsym = sym.c_str();
#endif
result = (void*)GetProcAddress(lib, rsym);
-#if defined(__BORLANDC__) || defined(__WATCOMC__)
- delete[] rsym;
-#endif
// Hack to cast pointer-to-data to pointer-to-function.
#ifdef __WATCOMC__
return *(DynamicLoader::SymbolPointer*)(&result);
diff --git a/ProcessUNIX.c b/ProcessUNIX.c
index 1431f30..e62ef34 100644
--- a/ProcessUNIX.c
+++ b/ProcessUNIX.c
@@ -2026,7 +2026,15 @@ static kwsysProcessTime kwsysProcessTimeGetCurrent(void)
{
kwsysProcessTime current;
kwsysProcessTimeNative current_native;
+#if KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC
+ struct timespec current_timespec;
+ clock_gettime(CLOCK_MONOTONIC, ¤t_timespec);
+
+ current_native.tv_sec = current_timespec.tv_sec;
+ current_native.tv_usec = current_timespec.tv_nsec / 1000;
+#else
gettimeofday(¤t_native, 0);
+#endif
current.tv_sec = (long)current_native.tv_sec;
current.tv_usec = (long)current_native.tv_usec;
return current;
diff --git a/kwsysPlatformTestsC.c b/kwsysPlatformTestsC.c
index 64a361b..5432633 100644
--- a/kwsysPlatformTestsC.c
+++ b/kwsysPlatformTestsC.c
@@ -55,6 +55,21 @@ int KWSYS_PLATFORM_TEST_C_MAIN()
}
#endif
+#ifdef TEST_KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC
+#if defined(__APPLE__)
+#include <AvailabilityMacros.h>
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
+#error "clock_gettime not available on macOS < 10.12"
+#endif
+#endif
+#include <time.h>
+int KWSYS_PLATFORM_TEST_C_MAIN()
+{
+ struct timespec ts;
+ return clock_gettime(CLOCK_MONOTONIC, &ts);
+}
+#endif
+
#ifdef TEST_KWSYS_C_TYPE_MACROS
char* info_macros =
#if defined(__SIZEOF_SHORT__)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48dcb2f0556a6780e50c94ff2e50d5b7c705ac68
commit 48dcb2f0556a6780e50c94ff2e50d5b7c705ac68
Author: Marc Chevrier <marc.chevrier at sap.com>
AuthorDate: Thu Oct 12 12:51:01 2017 +0200
Commit: Marc Chevrier <marc.chevrier at sap.com>
CommitDate: Thu Oct 12 13:05:17 2017 +0200
UseJava: add_jar OUTPUT_DIR option used only for jar generation.
Build artifacts go to CMAKE_CURRENT_BINARY_DIR subdirectory in all cases.
Fixes: #17341
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index b925ee2..5e06adc 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -481,6 +481,8 @@ function(add_jar _TARGET_NAME)
else()
get_filename_component(_add_jar_OUTPUT_DIR ${_add_jar_OUTPUT_DIR} ABSOLUTE)
endif()
+ # ensure output directory exists
+ file (MAKE_DIRECTORY "${_add_jar_OUTPUT_DIR}")
if (_add_jar_ENTRY_POINT)
set(_ENTRY_POINT_OPTION e)
@@ -515,9 +517,7 @@ function(add_jar _TARGET_NAME)
string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
- set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
- # ensure output directory exists
- file (MAKE_DIRECTORY "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
+ set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
if (_add_jar_OUTPUT_NAME AND _add_jar_VERSION)
@@ -548,7 +548,7 @@ function(add_jar _TARGET_NAME)
list(APPEND _JAVA_COMPILE_FILELISTS ${_JAVA_FULL})
elseif (_JAVA_EXT MATCHES ".java")
- file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${_add_jar_OUTPUT_DIR} ${_JAVA_FULL})
+ file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR} ${_JAVA_FULL})
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1943dc6bd5820424352db08dd2d65fb5a3cb2ef6
commit 1943dc6bd5820424352db08dd2d65fb5a3cb2ef6
Author: Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Wed Oct 11 20:40:59 2017 -0600
Commit: Clinton Stimpson <clinton at elemtech.com>
CommitDate: Wed Oct 11 20:40:59 2017 -0600
cmCPackDragNDropGenerator: Improve error reporting
When running hdiutil and other commands, capture errors and log them.
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 1e1543f..bb35623 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -411,6 +411,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
temp_image += "/temp.dmg";
+ std::string create_error;
std::ostringstream temp_image_command;
temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
temp_image_command << " create";
@@ -421,9 +422,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
temp_image_command << " -format " << temp_image_format;
temp_image_command << " \"" << temp_image << "\"";
- if (!this->RunCommand(temp_image_command)) {
+ if (!this->RunCommand(temp_image_command, &create_error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error generating temporary disk image." << std::endl);
+ "Error generating temporary disk image." << std::endl
+ << create_error
+ << std::endl);
return 0;
}
@@ -464,15 +467,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally set the custom icon flag for the image ...
if (!had_error && !cpack_package_icon.empty()) {
+ std::string error;
std::ostringstream setfile_command;
setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
setfile_command << " -a C";
setfile_command << " \"" << temp_mount << "\"";
- if (!this->RunCommand(setfile_command)) {
+ if (!this->RunCommand(setfile_command, &error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error assigning custom icon to temporary disk image."
- << std::endl);
+ << std::endl
+ << error << std::endl);
had_error = true;
}
@@ -717,9 +722,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
final_image_command << " zlib-level=9";
final_image_command << " -o \"" << output_file << "\"";
- if (!this->RunCommand(final_image_command)) {
+ std::string convert_error;
+
+ if (!this->RunCommand(final_image_command, &convert_error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error compressing disk image."
- << std::endl);
+ << std::endl
+ << convert_error << std::endl);
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-buildsystem.7.rst | 4 +-
Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst | 18 +++---
Modules/CPackWIX.cmake | 2 +-
Modules/UseJava.cmake | 8 +--
Source/CMakeLists.txt | 14 ++++-
Source/CPack/WiX/cmCMakeToWixPath.cxx | 39 ++++++++++++
Source/CPack/WiX/cmCMakeToWixPath.h | 12 ++++
Source/CPack/WiX/cmCPackWIXGenerator.cxx | 41 +++++++++----
Source/CPack/WiX/cmCPackWIXGenerator.h | 9 ++-
Source/CPack/WiX/cmWIXFilesSourceWriter.cxx | 4 +-
Source/CPack/cmCPackDragNDropGenerator.cxx | 20 +++++--
Source/CPack/cmCPackGeneratorFactory.cxx | 4 +-
Source/Modules/FindLibUUID.cmake | 85 +++++++++++++++++++++++++++
Source/cmTarget.cxx | 5 +-
Source/cmTargetPropertyComputer.cxx | 9 ++-
Source/kwsys/CMakeLists.txt | 7 ++-
Source/kwsys/CommandLineArguments.cxx | 20 +++----
Source/kwsys/DynamicLoader.cxx | 17 ++----
Source/kwsys/ProcessUNIX.c | 8 +++
Source/kwsys/kwsysPlatformTestsC.c | 15 +++++
Tests/InterfaceLibrary/CMakeLists.txt | 1 -
21 files changed, 273 insertions(+), 69 deletions(-)
create mode 100644 Source/CPack/WiX/cmCMakeToWixPath.cxx
create mode 100644 Source/CPack/WiX/cmCMakeToWixPath.h
create mode 100644 Source/Modules/FindLibUUID.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list