Back to home page

EIC code displayed by LXR

 
 

    


Warning, /jana2/src/python/externals/pybind11-2.10.3/tools/JoinPaths.cmake is written in an unsupported language. File is not indexed.

0001 # This module provides function for joining paths
0002 # known from most languages
0003 #
0004 # SPDX-License-Identifier: (MIT OR CC0-1.0)
0005 # Copyright 2020 Jan Tojnar
0006 # https://github.com/jtojnar/cmake-snips
0007 #
0008 # Modelled after Python’s os.path.join
0009 # https://docs.python.org/3.7/library/os.path.html#os.path.join
0010 # Windows not supported
0011 function(join_paths joined_path first_path_segment)
0012     set(temp_path "${first_path_segment}")
0013     foreach(current_segment IN LISTS ARGN)
0014         if(NOT ("${current_segment}" STREQUAL ""))
0015             if(IS_ABSOLUTE "${current_segment}")
0016                 set(temp_path "${current_segment}")
0017             else()
0018                 set(temp_path "${temp_path}/${current_segment}")
0019             endif()
0020         endif()
0021     endforeach()
0022     set(${joined_path} "${temp_path}" PARENT_SCOPE)
0023 endfunction()