Skip to content

Commit

Permalink
Generate drake-config.cmake at build time
Browse files Browse the repository at this point in the history
Remove the hand-generated drake-config.cmake and replace with a rule to
generate it from drake.cps at build time. Update packaging accordingly.
  • Loading branch information
mwoehlke-kitware committed May 3, 2017
1 parent 37486b6 commit cbd6cce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 59 deletions.
9 changes: 9 additions & 0 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ alias(
actual = "@com_github_bazelbuild_buildtools//buildifier",
)

genrule(
name = "cmake_exports",
srcs = ["drake.cps"],
outs = ["drake-config.cmake"],
cmd = "$(location @pycps//:cps2cmake_executable) $(location drake.cps) > \"$@\"",
tools = ["@pycps//:cps2cmake_executable"],
visibility = ["//visibility:private"],
)

# This pulls the otherwise-unused libbot targets into the "//..." label tree.
genrule(
name = "force_libbot",
Expand Down
58 changes: 0 additions & 58 deletions tools/drake-config.cmake

This file was deleted.

1 change: 1 addition & 0 deletions tools/drake.cps
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Meta-Schema": "https://mwoehlke.github.io/cps/",
"X-Purpose": "Used to generate drake-config.cmake via cps2cmake",
"X-See-Also": "https://github.com/mwoehlke/pycps",
"Cps-Version": "0.8.0",
"Name": "drake",
"Website": "http://drake.mit.edu/",
"Components": {
Expand Down
2 changes: 1 addition & 1 deletion tools/package_drake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function canonicalize
# Copy source artifacts to specified install prefix.
function copy_source_artifacts
{
cp tools/drake-config.cmake "$1/lib/cmake/drake/"
cp LICENSE.TXT "$1/"
}

Expand All @@ -32,6 +31,7 @@ function copy_source_artifacts
function copy_build_artifacts
{
cp bazel-bin/drake/libdrake.so "$1/lib/"
cp bazel-genfiles/tools/drake-config.cmake "$1/lib/cmake/drake/"
}

#------------------------------------------------------------------------------
Expand Down

0 comments on commit cbd6cce

Please sign in to comment.