-
Notifications
You must be signed in to change notification settings - Fork 55
Adding CPP Terminal to your ptoject
CPP-Terminal is using CMake as it's build system and can therefore be integrated out of the box into projects that are using the same build system. On this page, you will find detailed steps on how to add CPP-Terminal into your project and keep it up to date.
CPP-Terminal switched in late 2021 from just two header files to a full CMake powered library. The library now consists of header files for specific purposes with separate source files. Using source files keeps the externally included code to a minimum and fixes clashes with other libraries (which happened a lot due to the windows header used for native windows functionality).
This method uses git to manage the version along with CMake to automatically download and setup CPP-Terminal. Optionally, we can also prefer the locally installed CPP-Terminal version and just dynamically link it and use the git provided version as fallback.
NOTE: This method requires your project to use git.
First we need to add the CPP-Terminal github repository to our project:
git submodule add https://github.com/jupyter-xeus/cpp-terminal
NOTE: More informations on working with git sub modules can be found in it's documentation.
The next step is to configure CMake to download and build CPP-Terminal. As This step is a bit complicated, we have prepared a simple cmake function to get you started immediately:
# TODO
Keeping your version of CPP-Terminal is highly recommended and can be easily automated with tools like dependabot and renovate.
This method uses only CMake to download and setup CPP-Terminal. It's highly universal and does not require your project to use git, but the update process can't be as easily automated as with the first method. To get you started more quickly, we have prepared a simple cmake function to get you started immediately:
# TODO
Setting up CPP-Terminal by yourself with all of it's header and source files is complicated and should generally be avoided. Also this method makes the update process of your dependencies a lot more time consuming. Copying the cpp-terminal folder in the root directory of this repository as well as adding the .cpp files to your compile target should do the work.
Your project is using another build system that is not yet covered in this documentation? feel free to add it to the list to help others that are facing the same task.
Feel free to ask for help or assistance. We are happy to help you out and assist on getting started with the library.