[CMake] Adds function clava_enable_openmp
@@ -27,3 +27,15 @@ function(clava_weave_autopar ORIG_TARGET)
endfunction(clava_weave_autopar)
+
+# Enables OpenMP
+function(clava_enable_openmp)
+
+ # OpenMP Support
+ find_package(OpenMP REQUIRED)
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" PARENT_SCOPE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" PARENT_SCOPE)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" PARENT_SCOPE)
+
+endfunction(clava_enable_openmp)
\ No newline at end of file
