summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FetchContent.cmake4
-rw-r--r--Modules/FindOpenGL.cmake44
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmcmd.cxx37
-rw-r--r--Source/kwsys/SystemTools.cxx19
5 files changed, 62 insertions, 44 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 132354f..98cdf6c 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -754,7 +754,9 @@ function(__FetchContent_directPopulate contentName)
list(APPEND generatorOpts "-T${CMAKE_GENERATOR_TOOLSET}")
endif()
- list(APPEND generatorOpts "-DCMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}")
+ if(CMAKE_MAKE_PROGRAM)
+ list(APPEND generatorOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}")
+ endif()
else()
# Likely we've been invoked via CMake's script mode where no
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 8cceabd..11843ef 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -53,7 +53,7 @@
# Path to the EGL include directory.
# ``OPENGL_LIBRARIES``
# Paths to the OpenGL library, windowing system libraries, and GLU libraries.
-# On Linux, this assumes glX and is never correct for EGL-based targets.
+# On Linux, this assumes GLX and is never correct for EGL-based targets.
# Clients are encouraged to use the ``OpenGL::*`` import targets instead.
#
# Cache variables
@@ -80,12 +80,14 @@
# context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and
# contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way
# to get OpenGL 3+ functionality via EGL in a manner portable across vendors.
+# Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either
+# ``OpenGL::GLX`` or ``OpenGL::EGL``.
#
-# On Linux systems FindOpenGL defaults to using GLVND if available. Users can
-# utilize GLVND explicitly with targets ``OpenGL::OpenGL``, ``OpenGL::GLX``, and
-# ``OpenGL::EGL``. Additionally, when GLVND is available the ``OpenGL::GL``
-# target is equivalent to ``OpenGL::OpenGL OpenGL::GLX``. When the system is
-# not GLVND-based, ``OpenGL::GL`` expands to libGL as it has historically done.
+# Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable)
+# to use legacy GL. By default, these will use the legacy libGL library file.
+# If ``OPENGL_gl_LIBRARY`` is empty or not found and GLVND is available, the
+# ``OpenGL::GL`` target will use GLVND ``OpenGL::OpenGL`` and ``OpenGL::GLX``
+# (and the ``OPENGL_LIBRARIES`` variable will use the corresponding libraries).
# Thus, for non-EGL-based Linux targets, the ``OpenGL::GL`` target is most
# portable.
#
@@ -360,18 +362,8 @@ if(OPENGL_FOUND)
"${OPENGL_GLX_INCLUDE_DIR}")
endif()
- if(TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX AND NOT TARGET OpenGL::GL)
- # if GLVND with GLX is available, make ::GL a synonym for 'OpenGL::OpenGL
- # OpenGL::GLX'.
- add_library(OpenGL::GL INTERFACE IMPORTED)
- set_target_properties(OpenGL::GL PROPERTIES INTERFACE_LINK_LIBRARIES
- OpenGL::OpenGL)
- set_property(TARGET OpenGL::GL APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- OpenGL::GLX)
- set_target_properties(OpenGL::GL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
- "${OPENGL_INCLUDE_DIR}")
-
- elseif(NOT TARGET OpenGL::GL)
+ if(OPENGL_gl_LIBRARY AND NOT TARGET OpenGL::GL)
+ # A legacy GL library is available, so use it for the legacy GL target.
if(IS_ABSOLUTE "${OPENGL_gl_LIBRARY}")
add_library(OpenGL::GL UNKNOWN IMPORTED)
if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
@@ -392,6 +384,16 @@ if(OPENGL_FOUND)
endif()
set_target_properties(OpenGL::GL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}")
+ elseif(NOT TARGET OpenGL::GL AND TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
+ # A legacy GL library is not available, but we can provide the legacy GL
+ # target using GLVND OpenGL+GLX.
+ add_library(OpenGL::GL INTERFACE IMPORTED)
+ set_target_properties(OpenGL::GL PROPERTIES INTERFACE_LINK_LIBRARIES
+ OpenGL::OpenGL)
+ set_property(TARGET OpenGL::GL APPEND PROPERTY INTERFACE_LINK_LIBRARIES
+ OpenGL::GLX)
+ set_target_properties(OpenGL::GL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+ "${OPENGL_INCLUDE_DIR}")
endif()
# ::EGL is a GLVND library, and thus Linux-only: we don't bother checking
@@ -440,10 +442,12 @@ if(OPENGL_FOUND)
endif()
# OPENGL_LIBRARIES mirrors OpenGL::GL's logic ...
- if(TARGET OpenGL::GLX AND TARGET OpenGL::OpenGL)
+ if(OPENGL_gl_LIBRARY)
+ set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY})
+ elseif(TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
set(OPENGL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
else()
- set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY})
+ set(OPENGL_LIBRARIES "")
endif()
# ... and also includes GLU, if available.
if(TARGET OpenGL::GLU)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 4c66678..d9f6abd 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 10)
-set(CMake_VERSION_PATCH 20171109)
+set(CMake_VERSION_PATCH 20171110)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index ef75b01..24c67c6 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1577,9 +1577,11 @@ std::ostream& operator<<(std::ostream& stream,
stream.flags(flags);
return stream;
}
+
static bool RunCommand(const char* comment, std::vector<std::string>& command,
bool verbose, NumberFormat exitFormat,
- int* retCodeOut = nullptr)
+ int* retCodeOut = nullptr,
+ bool (*retCodeOkay)(int) = nullptr)
{
if (verbose) {
std::cout << comment << ":\n";
@@ -1589,18 +1591,17 @@ static bool RunCommand(const char* comment, std::vector<std::string>& command,
int retCode = 0;
bool commandResult = cmSystemTools::RunSingleCommand(
command, &output, &output, &retCode, nullptr, cmSystemTools::OUTPUT_NONE);
- bool returnValue;
+ bool const retCodeSuccess =
+ retCode == 0 || (retCodeOkay && retCodeOkay(retCode));
+ bool const success = commandResult && retCodeSuccess;
if (retCodeOut) {
- if (!commandResult) {
- *retCodeOut = (retCode == 0) ? -1 : retCode;
- } else {
+ if (commandResult || !retCodeOkay) {
*retCodeOut = retCode;
+ } else {
+ *retCodeOut = -1;
}
- returnValue = true; // always return true if retCodeOut is requested
- } else {
- returnValue = commandResult && (retCode == 0);
}
- if (!commandResult || retCode) {
+ if (!success) {
std::cout << comment << ": command \"" << cmJoin(command, " ")
<< "\" failed (exit code "
<< NumberFormatter(exitFormat, retCode)
@@ -1613,7 +1614,7 @@ static bool RunCommand(const char* comment, std::vector<std::string>& command,
std::cout << output;
}
}
- return returnValue;
+ return success;
}
bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
@@ -1711,6 +1712,13 @@ int cmVSLink::Link()
return LinkNonIncremental();
}
+static bool mtRetIsUpdate(int mtRet)
+{
+ // 'mt /notify_update' returns a special value (differing between
+ // Windows and POSIX hosts) when it updated the manifest file.
+ return mtRet == 0x41020001 || mtRet == 0xbb;
+}
+
int cmVSLink::LinkIncremental()
{
// This follows the steps listed here:
@@ -1782,9 +1790,9 @@ int cmVSLink::LinkIncremental()
// Run the manifest tool to create the final manifest.
int mtRet = this->RunMT("/out:" + this->ManifestFile, true);
- // If mt returns 1090650113 (or 187 on a posix host) then it updated the
- // manifest file so we need to embed it again. Otherwise we are done.
- if (mtRet != 1090650113 && mtRet != 187) {
+ // If mt returns a special value then it updated the manifest file so
+ // we need to embed it again. Otherwise we are done.
+ if (!mtRetIsUpdate(mtRet)) {
return mtRet;
}
@@ -1837,7 +1845,8 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
mtCommand.push_back("/notify_update");
}
int mtRet = 0;
- if (!RunCommand("MT", mtCommand, this->Verbose, FORMAT_HEX, &mtRet)) {
+ if (!RunCommand("MT", mtCommand, this->Verbose, FORMAT_HEX, &mtRet,
+ mtRetIsUpdate)) {
return -1;
}
return mtRet;
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1f7ee10..50aa857 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -27,6 +27,7 @@
#include <iostream>
#include <set>
#include <sstream>
+#include <utility>
#include <vector>
// Work-around CMake dependency scanning limitation. This must
@@ -3372,7 +3373,7 @@ std::string SystemTools::RelativePath(const std::string& local,
}
#ifdef _WIN32
-static std::string GetCasePathName(std::string const& pathIn)
+static std::pair<std::string, bool> GetCasePathName(std::string const& pathIn)
{
std::string casePath;
std::vector<std::string> path_components;
@@ -3381,7 +3382,7 @@ static std::string GetCasePathName(std::string const& pathIn)
{
// Relative paths cannot be converted.
casePath = pathIn;
- return casePath;
+ return std::make_pair(casePath, false);
}
// Start with root component.
@@ -3433,7 +3434,7 @@ static std::string GetCasePathName(std::string const& pathIn)
casePath += path_components[idx];
}
- return casePath;
+ return std::make_pair(casePath, converting);
}
#endif
@@ -3448,12 +3449,14 @@ std::string SystemTools::GetActualCaseForPath(const std::string& p)
if (i != SystemTools::PathCaseMap->end()) {
return i->second;
}
- std::string casePath = GetCasePathName(p);
- if (casePath.size() > MAX_PATH) {
- return casePath;
+ std::pair<std::string, bool> casePath = GetCasePathName(p);
+ if (casePath.first.size() > MAX_PATH) {
+ return casePath.first;
}
- (*SystemTools::PathCaseMap)[p] = casePath;
- return casePath;
+ if (casePath.second) {
+ (*SystemTools::PathCaseMap)[p] = casePath.first;
+ }
+ return casePath.first;
#endif
}