aimotive-legacy / cmakex

lightweight package manager for CMake
4 stars 1 forks source link

priority issue between pkg cmake_args, preset cmake_args, command-line #28

Open tamaskenez opened 7 years ago

tamaskenez commented 7 years ago

currently package cmake_args are applied only on initial builds preset cmake args appended to command line and applied always (and after package cmake args on initial build). However it would be less surprising if package cmake args would be stronger than preset cmake args

Solutions:

  1. introduce explicit strong -D!A=B and weak -D?A=B args
  2. track all args that came from command line or package and don't let preset vars overwrite them
  3. apply preset args only on initial build (just like package args) and before package args
  4. track cumulative package args, cumulative preset args, and cumulative command line args and apply the cumulative args each time (in preset + package + command line order)
tamaskenez commented 7 years ago

A possible implementation of 4:

initial-build:

store and apply preset args store and apply pkg args store and apply cl args

later builds overwrite stored preset args with new ones (if specified) overwrite stored pkg args with new ones append stored cl args with new ones create the transition args from the accumulation of the above set to the current tracked set