Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gazebo9] More enhancement for Windows build #2789

Merged
merged 4 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmake/GazeboUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ endmacro()
#################################################
macro (gz_install_library _name)
set_target_properties(${_name} PROPERTIES SOVERSION ${GAZEBO_MAJOR_VERSION} VERSION ${GAZEBO_VERSION_FULL})
install (TARGETS ${_name} DESTINATION ${LIB_INSTALL_DIR} COMPONENT shlib)
install (TARGETS ${_name}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
COMPONENT shlib)
endmacro ()

#################################################
Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ void Material::SetTextureImage(const std::string &_tex,
}
}
}

// normalize the path
this->texImage = boost::filesystem::path(this->texImage)
.make_preferred().string();
}

//////////////////////////////////////////////////
Expand Down
19 changes: 14 additions & 5 deletions gazebo/common/ModelDatabase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -503,19 +503,28 @@ std::string ModelDatabase::GetModelPath(const std::string &_uri,
continue;
}

std::string outputPath = getenv("HOME");
outputPath += "/.gazebo/models";

#ifndef _WIN32
TAR *tar;
tar_open(&tar, const_cast<char*>(tarfilename.c_str()),
nullptr, O_RDONLY, 0644, TAR_GNU);

std::string outputPath = getenv("HOME");
outputPath += "/.gazebo/models";

tar_extract_all(tar, const_cast<char*>(outputPath.c_str()));
#else
// Tar now is a built-in tool since Windows 10 build 17063.
std::string cmdline = "tar xzf \"";
cmdline += tarfilename + "\" -C \"";
cmdline += outputPath + "\"";
auto ret = system(cmdline.c_str());
if (ret != 0)
{
gzerr << "tar extract ret = " << ret << ", cmdline = " << cmdline << std::endl;
}
#endif
path = outputPath + "/" + modelName;

ModelDatabase::DownloadDependencies(path);
#endif
}

curl_easy_cleanup(curl);
Expand Down