How to provide a plugin which requires CMB2 (plugin dependencies)?

On your plugin activation hook method you can check if CMB plugin is installed and/or activated.

You can check this using the following methods:

  1. is_plugin_active(): only available from within the admin pages
  2. function_exists() or class_exists(): available anywhere once they are PHP core methods

If CMB is not installed, you can throw an error message in the panel with instructions to the user on how to install it.

This article has a great explanation on how to check WordPress Plugin Dependencies.