Skip to content

Commit

Permalink
Remove the workspace entry for find_protobuf_cmake
Browse files Browse the repository at this point in the history
Using a workspace to identify these files isn't terribly useful,
because there isn't great cause for allowing Drake downstreams to
replace them with a different copy.  Using new_local_repository
is a bit tricky to get right so we are trying to avoid it, thus
its worth just dropping this down to package-level dependencies
instead of a workspace.
  • Loading branch information
jwnimmer-tri committed Jan 12, 2018
1 parent 364a1a2 commit 2b49d4d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 31 deletions.
6 changes: 0 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ local_repository(
path = "third_party/com_github_google_protobuf",
)

new_local_repository(
name = "find_protobuf_cmake",
build_file = "@drake//tools/workspace/protobuf:package.BUILD.bazel",
path = __workspace_dir__ + "/third_party/com_kitware_gitlab_cmake_cmake",
)

load("//tools/workspace/ibex:package.bzl", "ibex_repository")

ibex_repository(name = "ibex")
Expand Down
5 changes: 5 additions & 0 deletions third_party/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ exports_files(
visibility = ["@libbot//:__pkg__"],
)

exports_files(
glob(["com_kitware_gitlab_cmake_cmake/**"]),
visibility = ["//tools/workspace/find_protobuf_cmake:__pkg__"],
)

add_lint_tests()
2 changes: 1 addition & 1 deletion tools/install/install.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ install_files = rule(
"rename": attr.string_dict(),
"strip_prefix": attr.string_list(),
"workspace": attr.string(),
"allowed_externals": attr.string_list(),
"allowed_externals": attr.label_list(allow_files = True),
},
implementation = _install_files_impl,
)
Expand Down
2 changes: 1 addition & 1 deletion tools/workspace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ _DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [
"drake_visualizer",
"eigen",
"fcl",
"find_protobuf_cmake",
"fmt",
"ignition_math",
"ignition_rndf",
Expand All @@ -39,6 +38,7 @@ _DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [
"vtk",
]] + ["//tools/workspace/%s:install" % p for p in [
"net_sf_jchart2d",
"find_protobuf_cmake",
"optitrack_driver",
]] + select({
"//tools:with_gurobi": ["@gurobi//:install"],
Expand Down
27 changes: 27 additions & 0 deletions tools/workspace/find_protobuf_cmake/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- python -*-

load(
"@drake//tools/install:install.bzl",
"install_files",
)

package(default_visibility = ["//visibility:public"])

install_files(
name = "install",
dest = "lib/cmake/drake/modules",
files = [
"//third_party:com_kitware_gitlab_cmake_cmake/3.10/Copyright.txt",
"//third_party:com_kitware_gitlab_cmake_cmake/3.10/Modules/FindProtobuf.cmake",
],
allowed_externals = [
"//third_party:com_kitware_gitlab_cmake_cmake/3.10/Copyright.txt",
],
strip_prefix = [
# The first strip_prefix match wins; thus, we will end up with:
# - install to "lib/cmake/drake/modules/FindProtobuf.cmake"
"com_kitware_gitlab_cmake_cmake/3.10/Modules",
# - install to "lib/cmake/drake/modules/3.10/Copyright.txt"
"com_kitware_gitlab_cmake_cmake",
],
)
5 changes: 0 additions & 5 deletions tools/workspace/protobuf/BUILD.bazel

This file was deleted.

18 changes: 0 additions & 18 deletions tools/workspace/protobuf/package.BUILD.bazel

This file was deleted.

0 comments on commit 2b49d4d

Please sign in to comment.