Ah thanks, let me try this. Also, I think it is a pretty common use case to pass custom args to the cmake command. Probably worth doing a CMAKE_COMMAND_ARGS (or some such) environment variable that users can override?
On Sat, Jun 20, 2020 at 2:39 PM Allen Wittenauer <[email protected]> wrote: > > > > On Jun 19, 2020, at 4:35 PM, Bharath Vissapragada <[email protected]> > wrote: > > > > Hi, > > > > I'm trying to use yetus with a cmake project (v0.12.0). What's the right > > way to pass a variable like > > "cmake -Dfoo=bar" ? Briefly looked at the code and looks like it isn't > > possible. Please correct me if I'm wrong. Appreciate any pointers. > > > It's possible, but it's not particularly easy or well documented. > Probably something we should work, since this question comes up > every-so-often. This also reflects some of the earliest work on the engine > and there are a lot of things we probably should have done different. > Hindsight 20/20! :) > > Anyway, it basically requires setting up a personality file and > providing a custom personality_modules function in it. Off the top of my > head, I think a minimal version would be something like: > > ===snip=== > function personality_modules > { > declare repostatus=$1 > declare testtype=$2 > declare module > > yetus_debug "Using custom personality_modules" > yetus_debug "Personality: ${repostatus} ${testtype}" > > clear_personality_queue > > for module in "${CHANGED_MODULES[@]}"; do > personality_enqueue_module "${module}" [your extra params here] > done > } > ===snip=== > > repostatus will generally be one of branch or patch. > testtype will generally be the plugin executing. > > This setup allows one to customize what extra params are passed based upon > the state of the source tree. It's extremely powerful but very unfriendly > to people unfamiliar with the internals. :( This feature is used > extensively by some of the bigger projects that ship personalities with > Apache Yetus itself. > > BTW: I don't know how well tested this is with make and related build > tools. If you have any issues, definitely file JIRAs. > > >
