Repository: mesos
Updated Branches:
  refs/heads/master eb08f0895 -> de89ac845


CMake: Changed usage of `get_filename_component` function.

The built-in function `get_filename_component` has a legacy argument
'PATH' which is used for CMake versions <= 2.8.11.  The argument is
renamed to 'DIRECTORY' in later versions of CMake.

Since we support CMake down to 2.8.10, we need to use the legacy
argument instead of the newer one.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0eee031f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0eee031f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0eee031f

Branch: refs/heads/master
Commit: 0eee031f90e8896f297bfe96751868dee61930ef
Parents: a95abd0
Author: Joseph Wu <[email protected]>
Authored: Fri Mar 3 14:01:20 2017 -0800
Committer: Joseph Wu <[email protected]>
Committed: Thu Mar 9 11:14:29 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/cmake/GroupSource.cmake | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0eee031f/3rdparty/stout/cmake/GroupSource.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/GroupSource.cmake 
b/3rdparty/stout/cmake/GroupSource.cmake
index 3cf6a90..b0b2b1d 100644
--- a/3rdparty/stout/cmake/GroupSource.cmake
+++ b/3rdparty/stout/cmake/GroupSource.cmake
@@ -71,10 +71,15 @@ function(GROUP_SOURCE GROUP_NAME ROOT_DIRECTORY RELATIVE_TO 
SOURCE_PATTERN)
     # Get relative directory of source file, use to generate a source group
     # that resembles the directory tree.
     get_filename_component(SOURCE_FILE_REALPATH ${SOURCE_FILE} REALPATH)
-    file(RELATIVE_PATH SOURCE_FILE_RELATIVE ${RELATIVE_TO}
-         ${SOURCE_FILE_REALPATH})
-    get_filename_component(SOURCE_DIRECTORY_RELATIVE ${SOURCE_FILE_RELATIVE}
-                           DIRECTORY)
+
+    file(RELATIVE_PATH SOURCE_FILE_RELATIVE
+      ${RELATIVE_TO} ${SOURCE_FILE_REALPATH})
+
+    get_filename_component(
+      SOURCE_DIRECTORY_RELATIVE
+      ${SOURCE_FILE_RELATIVE}
+      PATH)
+
     set(SOURCE_GROUP "${GROUP_NAME}\\${SOURCE_DIRECTORY_RELATIVE}")
 
     # This is necessary because source group names require '\' rather than '/'
@@ -91,7 +96,8 @@ function(GROUP_SOURCE GROUP_NAME ROOT_DIRECTORY RELATIVE_TO 
SOURCE_PATTERN)
     get_filename_component(
       SOURCE_DIRECTORY
       "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}"
-      DIRECTORY)
+      PATH)
+
     file(
       GLOB
       SOURCE_GROUP_FILES

Reply via email to