A Code Monkey's Blog

Using OpenMP with CMake

Add the following lines into your CMakeLists.txt

# Even though -fopenmp won't appear in the GUI options, it does take effect
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")