The configuration file Project.meta

Example

Project.meta of Main Project.meta of Sub
Project {
  ExecutableConfig Debug {
    Dependency Sub, config: Debug
    Files "**/*.cpp"
    IncludeDir "include"
    DefaultToolchain GCC {
      Compiler CPP {
        Flags "-Wall"
      }
    }
    PostSteps {
      CommandLine "echo $(ArtifactName) built."
    }
  }
}
Project {
  LibraryConfig Debug {
    Files "**/*.cpp"
    IncludeDir "include"
    IncludeDir "Main/include"
    ExternalLibrarySearchPath "lib"
    ExternalLibrary "a"
    ExternalLibrary "b"
    Toolchain {
      Compiler CPP {
        Flags add: "-g3"
      }
    }
  }
}

Let's assume that Main and Sub are located in the same workspace root. To build the executable, bake can be called from the Main directory:
bake -b Debug
What happens now?
  1. Reading Project.meta of Main
  2. Reading Project.meta of dependencies (Sub)
  3. Compiling sources of Sub, e.g.:
    g++ -c -Wall -g3 -Iinclude -I../Main/include -o Debug_Main/src/xy.o src/xy.cpp
  4. Archiving the library, e.g.:
    ar -rc Debug_Main/libSub.a Debug_Main/src/xy.o
  5. Compiling sources of Main, e.g.:
    g++ -c -Wall -Iinclude -o Debug/src/main.o src/main.cpp
  6. Linking executable, e.g.:
    g++ -o Debug/Main.exe Debug/src/main.o ../Sub/Debug_Main/libSub.a -L../Sub/lib -la -lb
    The library search paths and libraries are added in the specified order.
  7. Executing the post step
    echo Main.exe built.
    The variable was automatically substituted.