aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-02-24 15:40:15 -0800
committerHaibo Huang <hhb@google.com>2021-03-01 20:51:10 +0000
commitb0bee82c6434575fe39b01882583afe32040ab6e (patch)
treedf5150314b77dc7ca67a45208b7d3b36458dc27c /cmake
parent83709faa5a51c806501e7a7ac628e886b198e65f (diff)
downloadjsoncpp-b0bee82c6434575fe39b01882583afe32040ab6e.tar.gz
Upgrade jsoncpp to 1.9.4
Bug: 170642246 Change-Id: Id1fae5a1b6421117f923c616718ee4b3571231e0
Diffstat (limited to 'cmake')
-rw-r--r--cmake/JoinPaths.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/JoinPaths.cmake b/cmake/JoinPaths.cmake
new file mode 100644
index 0000000..2b376b7
--- /dev/null
+++ b/cmake/JoinPaths.cmake
@@ -0,0 +1,23 @@
+# This module provides a function for joining paths
+# known from most languages
+#
+# SPDX-License-Identifier: (MIT OR CC0-1.0)
+# Copyright 2020 Jan Tojnar
+# https://github.com/jtojnar/cmake-snips
+#
+# Modelled after Python’s os.path.join
+# https://docs.python.org/3.7/library/os.path.html#os.path.join
+# Windows not supported
+function(join_paths joined_path first_path_segment)
+ set(temp_path "${first_path_segment}")
+ foreach(current_segment IN LISTS ARGN)
+ if(NOT ("${current_segment}" STREQUAL ""))
+ if(IS_ABSOLUTE "${current_segment}")
+ set(temp_path "${current_segment}")
+ else()
+ set(temp_path "${temp_path}/${current_segment}")
+ endif()
+ endif()
+ endforeach()
+ set(${joined_path} "${temp_path}" PARENT_SCOPE)
+endfunction()