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

bzlmod support #1499

Merged
merged 9 commits into from
Nov 12, 2024
14 changes: 7 additions & 7 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ gz_export_header(
gz_configure_header(
name = "Config",
src = "include/sdf/config.hh.in",
defines = {
"CMAKE_INSTALL_FULL_DATAROOTDIR": "unused",
"SDF_PROTOCOL_VERSION": "11111",
},
defines = [
"CMAKE_INSTALL_FULL_DATAROOTDIR=unused",
"SDF_PROTOCOL_VERSION=1.12",
mjcarroll marked this conversation as resolved.
Show resolved Hide resolved
],
package_xml = "package.xml",
)

Expand Down Expand Up @@ -94,6 +94,9 @@ cc_library(
exclude = [
],
),
data = [
"sdf",
],
defines = [
"CMAKE_INSTALL_RELATIVE_DATAROOTDIR=\\\"\\\"",
'SDF_SHARE_PATH=\\".\\"',
Expand All @@ -103,9 +106,6 @@ cc_library(
"include",
"src",
],
data = [
"sdf"
],
deps = [
":Config",
":Export",
Expand Down
5 changes: 0 additions & 5 deletions src/Actor_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include "sdf/Actor.hh"
#include "sdf/Plugin.hh"

#include <filesystem>

/////////////////////////////////////////////////
sdf::Animation CreateDummyAnimation()
{
Expand Down Expand Up @@ -511,9 +509,6 @@ TEST(DOMActor, ToElement)
{
sdf::Actor actor;

// Output the current working directory
std::cout << std::filesystem::current_path() << std::endl;

actor.SetName("my-actor");
actor.SetRawPose(gz::math::Pose3d(1, 2, 3, 0.1, 0.2, 0.3));
actor.SetSkinFilename("my-skinfilename");
Expand Down
4 changes: 0 additions & 4 deletions src/SDF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,9 @@ const std::string &SDF::EmbeddedSpec(
const std::string &SDF::EmbeddedSpec(
sdf::Errors &_errors, const std::string &_filename)
{

try
{
const std::string pathname = SDF::Version() + "/" + _filename;

std::cout << "Reading: " << pathname << std::endl;

return GetEmbeddedSdf().at(pathname);
}
catch(const std::out_of_range &)
Expand Down
21 changes: 19 additions & 2 deletions src/bazel/InstallationDirectories.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
// Generate an installation directories file for bazel specifically
/*
* Copyright (C) 2024 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <sdf/InstallationDirectories.hh>

Expand All @@ -7,9 +22,11 @@ namespace sdf

inline namespace SDF_VERSION_NAMESPACE {

// Generate an install prefix specifically for bazel build.
std::string getInstallPrefix()
{
return ".";
}
} // namespace SDF_VERSION_NAMESPACE
} // namespace sdf
} // namespace sdf

Loading