Skip to content

Commit

Permalink
native path
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Nov 25, 2018
1 parent 6f7dc95 commit 8f8beed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rosidl_adapter/rosidl_adapter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import argparse
import json
import os
import pathlib
import sys

Expand Down Expand Up @@ -57,4 +58,5 @@ def main(argv=sys.argv[1:]):
output_file.parent.mkdir(exist_ok=True)
with output_file.open('w') as h:
for basepath, relative_path in idl_tuples:
h.write('{basepath}:{relative_path}\n'.format_map(locals()))
line = '{basepath}:{relative_path}\n'.format_map(locals())
h.write(line.replace(os.sep, '/'))
4 changes: 3 additions & 1 deletion rosidl_cmake/cmake/rosidl_generate_interfaces.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ macro(rosidl_generate_interfaces target)
# of the base path and the relative path
set(_interface_tuples "")
foreach(_file ${_ARG_UNPARSED_ARGUMENTS})
file(TO_CMAKE_PATH "${_file}" _file)
if(IS_ABSOLUTE "${_file}")
string(FIND "${_file}" ":" _index)
if(_index EQUAL -1)
Expand All @@ -90,7 +91,8 @@ macro(rosidl_generate_interfaces target)
"'${_file}' doesn't exist relative to the "
"CMAKE_CURRENT_SOURCE_DIR '${CMAKE_CURRENT_SOURCE_DIR}'")
endif()
list(APPEND _interface_tuples "${CMAKE_CURRENT_SOURCE_DIR}:${_file}")
file(TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" _cmake_current_source_dir)
list(APPEND _interface_tuples "${_cmake_current_source_dir}:${_file}")
endif()
endforeach()

Expand Down

0 comments on commit 8f8beed

Please sign in to comment.