Initial implementation, without dynamic permit or parameterized trigger support.
Start using cmake so I can easily switch platform.