A usethis-style helper that configures a downstream R package to link against VTK via rvtk. It performs the following steps:
Adds
rvtkto theImportsfield ofDESCRIPTION.Writes
src/Makevarsthat queries compiler and linker flags at install time by callingtools/configure.R.Writes
src/Makevars.winwith the Windows-specific$(shell ...)syntax that does the same.Writes
tools/configure.Rthat callsCppFlags()andLdFlagsFile()with the requested VTK modules.Adds
src/vtk_libs.rspto.gitignore(it is generated at install time and must not be committed).Creates
R/rvtk_imports.Rwith a minimal@importFrom rvtkroxygen tag so thatR CMD checkdoes not complain about rvtk being listed inImportswithout any function import in the R code.
After running use_rvtk() the downstream package is fully configured: VTK
compiler and linker flags are resolved automatically at R CMD INSTALL time
on all platforms without any shell configure / configure.win scripts.
Usage
use_rvtk(
modules = c("vtkIOLegacy", "vtkIOXML", "vtkIOXMLParser", "vtkIOCore", "vtkCommonCore",
"vtkCommonDataModel", "vtkCommonExecutionModel", "vtkCommonMath", "vtkCommonMisc",
"vtkCommonSystem", "vtkCommonTransforms", "vtksys"),
path = "."
)Arguments
- modules
A character vector of VTK module names to link against. These are passed to
LdFlagsFile()in the generatedtools/configure.R, restricting linking to only the modules the downstream package needs. Defaults to a standard set covering common I/O and core modules (the same set used by the reference implementation in https://github.com/tractoverse/riot).- path
Path to the root of the downstream package. Defaults to the current working directory.
