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

Introduce build_visualization option #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,14 @@ def bundle_package(*args, &block)
Autoproj.config.set 'syskit_use_bundles', true, true
end

Autoproj.config.declare 'build_visualization', 'boolean',
default: true,
short_doc: 'Whether vizkit visualizaztion plugins in "viz" subfolders of packages should be built',
doc: ['Should the visualizations be built (viz subfolder of packages)?',
'This will also evaluate the manifest.xml in the viz subfolder of a package',
'and install them',
'These dependencies will appear as dependencies of the main package']

unless Autoproj.config.has_value_for?('build_visualization')
Autoproj.config.set 'build_visualization', true, true
end
23 changes: 23 additions & 0 deletions overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,29 @@
end

if pkg.kind_of?(Autobuild::CMake)
if File.directory?(File.join(pkg.srcdir, 'viz'))
if Autoproj.config.has_value_for?('build_visualization')
if Autoproj.config.get 'build_visualization'
pkg.define 'ROCK_VIZ_ENABLED', 'OFF'
else
# load manifest.xml from viz folder
viz_manifest_file = File.join(pkg.srcdir, 'viz', 'manifest.xml')
if File.file?(viz_manifest_file)
manifest = Autoproj::PackageManifest.load(pkg, viz_manifest_file, ros_manifest: false)
if manifest
manifest.each_dependency do |name, is_optional|
if is_optional
pkg.optional_dependency name
else
pkg.depends_on name
end
end
end
end
end
end
end

pkg.post_import do
Rock.update_cmake_build_type_from_tags(pkg)

Expand Down