<commit_before>CMakeCatchTemplate
------------------

[![Build Status](https://travis-ci.com/MattClarkson/CMakeCatchTemplate.svg?branch=master)](https://travis-ci.com/MattClarkson/CMakeCatchTemplate)
[![Build Status](https://ci.appveyor.com/api/projects/status/5pm89ej732c1ekf0/branch/master)](https://ci.appveyor.com/project/MattClarkson/cmakecatchtemplate)


Purpose
-------

This is a demo project to demonstrate a reasonable structure for [CMake](https://cmake.org/) based projects,
that use [CTest](https://cmake.org/) to run unit tests via [Catch](https://github.com/catchorg/Catch2).


Credits
-------

This project was developed as a teaching aid for UCL's ["Research Computing with C++"](http://rits.github-pages.ucl.ac.uk/research-computing-with-cpp/)
course developed by [Dr. <NAME>](http://www.ucl.ac.uk/research-it-services/people/james)
and [Dr. <NAME>](https://iris.ucl.ac.uk/iris/browse/profile?upi=MJCLA42).


Main Features
-------------

The main idea of this project is to try and help a C++ algorithm developer write their algorithm in a
C++ library and then deploy the C++ library in a variety of scenarios. 

The main features provided are:

 1. A Meta-Build, also known as a SuperBuild, to optionally download and build any of the following: Boost, Eigen, FLANN, OpenCV, glog, gflags, VTK and PCL. All of these can be left OFF and skipped. This results in a top-level build folder containing the compiled dependencies, and then a sub-folder containing the compiled code of this project.
 2. A single library into which you can provide your main algorithms.
 3. Unit tests, using Catch, and run with CTest, so you can ensure correctness and enable regression testing of your functionality.
 4. A single command line application, to give the end user a minimalist runnable program.
 5. KWStyle config, so you can check for consistent code style, when you have KWStyle installed on your system.
 6. CppCheck config, so you can check for some performance, style and correctness issues, when you have CppCheck installed on your system.
 7. Doxygen config, so you can generate documentation via a ```make docs``` or DOCS task in Visual Studio.
 8. If your code is open-source, you can register with a Continuous Integration service, so this project provides Travis and Appveyor examples.
 9. Basic examples of how to create a Qt+VTK, Qt+OpenGL or QML+VTK user interface, ensuring the VTK render engine works in Qt or QML framework, on Windows, Linux and Mac.
10. CPack setup to produce installers for the GUI apps.
11. An example of the CMake required to build python interfaces to your C++ code, using ```boost::python```.
12. An example of the CMake required to build python interfaces to your C++ code, using [pybind11](https://github.com/pybind/pybind11), with credit to [this example](https://github.com/pybind/cmake_example).
13. An example of the CMake required to export a C-style module into [Unity](https://unity3d.com/).
14. Support for OpenMP, which is passed through to FLANN, OpenCV and PCL.
15. Support for CUDA, which is passed through to FLANN, OpenCV and PCL.
16. Support for MPI, which by default sets up the C++ libraries.
17. If doing Boost.Python and OpenCV, an example of passing a numpy ndarray to OpenCV, computing something, and returning a cv::Mat as a numpy ndarray, thanks to <NAME>'s pyboostcvconverter.
18. Support for Python Wheels, using [Matthew Brett's multibuild](https://github.com/matthew-brett/multibuild).


Use Cases
---------

The feature list above is quite diverse, and in reality most developers won't want all of them.
So, while you could attempt all of these, within the same project, 
we envisage the following project types:

* A C++ library in C++ command line interfaces. 
* A C++ library in a C++ user interface, using Qt, or QML.
* A C++ library in a Python module, or perhaps a Python GUI, where the Python is developed separately, outside of this project.
* A C++ library in an environment such as Unity, developed outside of this project.

So, the aim for the C++ developer would be to write a small algorithm library, and get the code out there
into the hands of their users. This project can accommodate all of the above, and there are CMake
options to switch these options OFF/ON.

Furthermore, once you have a successful build for your use-case, you could 
delete the bits of code that you don't need.  We could have made a different repository 
for each of the use-cases, but then there would be a lot of code
duplication and overlap. So, for now, its all one repository. If you want to
streamline your project, you could:

* Take a look in the ```Code``` folder. Remove the directories you do not need,
and change ```Code/CMakeLists.txt``` accordingly.

* Search the top level CMakeLists.txt for code that looks like<commit_msg>Issue #45: Update README.md, tweak URLs and txt.<commit_after>CMakeCatchTemplate
------------------

[![Build Status](https://travis-ci.com/MattClarkson/CMakeCatchTemplate.svg?branch=master)](https://travis-ci.com/MattClarkson/CMakeCatchTemplate)
[![Build Status](https://ci.appveyor.com/api/projects/status/5pm89ej732c1ekf0/branch/master)](https://ci.appveyor.com/project/MattClarkson/cmakecatchtemplate)


Purpose
-------

This is a demo project to demonstrate a reasonable structure for [CMake](https://cmake.org/) based projects,
that use [CTest](https://cmake.org/) to run unit tests via [Catch](https://github.com/catchorg/Catch2).


Credits
-------

This project was developed as a teaching aid for UCL's ["Research Computing with C++"](http://rits.github-pages.ucl.ac.uk/research-computing-with-cpp/)
course developed by [Dr. <NAME>](http://www.ucl.ac.uk/research-it-services/people/james)
and [Dr. <NAME>](https://iris.ucl.ac.uk/iris/browse/profile?upi=MJCLA42).


Main Features
-------------

The main idea of this project is to try and help a C++ algorithm developer write their algorithm in a
C++ library and then deploy the C++ library in a variety of scenarios. 

The main features provided are:

 1. A Meta-Build, also known as a SuperBuild, to optionally download and build any of the following: Boost, Eigen, FLANN, OpenCV, glog, gflags, VTK and PCL. All of these can be left OFF and skipped. This results in a top-level build folder containing the compiled dependencies, and then a sub-folder containing the compiled code of this project.
 2. A single library into which you can provide your main algorithms.
 3. Unit tests, using Catch, and run with CTest, so you can ensure correctness and enable regression testing of your functionality.
 4. A single command line application, to give the end user a minimalist runnable program.
 5. KWStyle config, so you can check for consistent code style, when you have KWStyle installed on your system.
 6. CppCheck config, so you can check for some performance, style and correctness issues, when you have CppCheck installed on your system.
 7. Doxygen config, so you can generate documentation via a ```make docs``` or DOCS task in Visual Studio.
 8. If your code is open-source, you can register with a Continuous Integration service, so this project provides Travis and Appveyor examples.
 9. Basic examples of how to create a Qt+VTK, Qt+OpenGL or QML+VTK user interface, ensuring the VTK render engine works in Qt or QML framework, on Windows, Linux and Mac.
10. CPack setup to produce installers for the GUI apps.
11. An example of the CMake required to build python interfaces to your C++ code, using ```boost::python```.
12. An example of the CMake required to build python interfaces to your C++ code, using [pybind11](https://github.com/pybind/pybind11), with credit to [this example](https://github.com/pybind/cmake_example).
13. An example of the CMake required to export a C-style module into [Unity](https://unity3d.com/).
14. Support for OpenMP, which is passed through to FLANN, OpenCV and PCL.
15. Support for CUDA, which is passed through to FLANN, OpenCV and PCL.
16. Support for MPI, which by default sets up the C++ libraries.
17. If doing Boost.Python and OpenCV, an example of passing a numpy ndarray to OpenCV, computing something, and returning a cv::Mat as a numpy ndarray, thanks to [<NAME>'s pyboostcvconverter](https://github.com/Algomorph/pyboostcvconverter).
18. Support for Python Wheels, thanks to [<NAME>'s multibuild](https://github.com/matthew-brett/multibuild).


Use Cases
---------

The feature list above is quite diverse, and in reality most developers won't want all of them.
So, while you could attempt all of these, within the same project, 
we envisage the following project types:

* A C++ library in C++ command line interfaces. 
* A C++ library in a C++ user interface, using Qt, or QML.
* A C++ library in a Python module, or perhaps a Python GUI, where the Python is developed separately, outside of this project.
* A C++ library in an environment such as Unity, developed outside of this project.

So, the aim for the C++ developer would be to write a small algorithm library, and get the code out there
into the hands of their users. This project can accommodate all of the above, and there are CMake
options to switch these options OFF/ON.

Furthermore, once you have a successful build for your use-case, you could 
delete the bits of code that you don't need.  We could have made a different repository 
for each of the use-cases, but then there would be a lot of code
duplication and overlap. So, for now, its all one repository. If you want to
streamline your project, you could:

* Take a look in the ```Code``` folder. Remove the directories you do not need,
and change ```Code/CMakeLists.txt``` accordingly.

* Search the top level CMakeLists.txt for code that looks like
{'fraction_non_alphanumeric': 0.09126533979581314, 'fraction_numerical': 0.009074971640713622, 'mean_word_length': 4.155768208399787, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 25, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '33925', 'n_tokens_mistral': 2811, 'n_tokens_neox': 2642, 'n_words': 1354}