How to use OpenMP with CMake

Hi! Some days have passed since I wrote something on the blog but I've been a little busy. Anyway, here I am again, this time to write about CMake and OpenMP. If you don't know CMake, and don't know how to use it, you may check my previous  tutorial on How to use CMake with OpenCV where I describe the basic steps to get started with CMake.
OpenMP is an API that supports multi-platform shared-memory parallel programming in C/C++ and Fortran. The OpenMP API defines a portable, scalable model with a simple and flexible interface for developing parallel appications on platforms from the desktop to the supercomputer.
After following the steps I described in the post that I previously referred, you'll have to add the following lines to tour CMakeLists.txt file:
After inserting these lines you'll be ready to use the OpenMP libraries in your project. That's just it.

Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)