# -*- python -*-
# This file contains rules for Bazel; see drake/doc/bazel.rst.

# This file is named BUILD.bazel instead of the more typical BUILD, so that on
# OSX it won't conflict with a build artifacts directory named "build".

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

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

exports_files([
    "CPPLINT.cfg",
    ".clang-format",
    ".drake-resource-sentinel",
])

alias(
    name = "protoc",
    actual = "@protobuf//:protoc",
)

alias(
    name = "protobuf",
    actual = "@protobuf//:protobuf",
)

alias(
    name = "protobuf_python",
    actual = "@protobuf//:protobuf_python",
)

DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [
    "bullet",
    "ccd",
    "drake_visualizer",
    "eigen",
    "fcl",
    "fmt",
    "ignition_math",
    "ignition_rndf",
    "lcm",
    "lcmtypes_bot2_core",
    "lcmtypes_robotlocomotion",
    "libbot",
    "nlopt",
    "octomap",
    "pybind11",
    "sdformat",
    "spdlog",
    "tinyobjloader",
    "vtk",
    "yaml_cpp",
]] + ["//tools/install/%s:install" % p for p in [
    "gflags",
    "jchart2d",
    "optitrack_driver",
    "protobuf",
]]

install(
    name = "install",
    docs = ["LICENSE.TXT"],
    deps = [
        "//drake:install",
        "//drake/automotive:install_data",
        "//drake/bindings:install",
        "//drake/common:install",
        "//drake/examples:install_data",
        "//drake/lcmtypes:install",
        "//drake/manipulation/models:install_data",
        "//tools:install",
    ] + DRAKE_EXTERNAL_PACKAGE_INSTALLS,
)

check_licenses(DRAKE_EXTERNAL_PACKAGE_INSTALLS + [":install"])

add_lint_tests()
