Skip to content

Instantly share code, notes, and snippets.

@meysampg
Created May 23, 2021 08:41
Show Gist options
  • Save meysampg/583b421b39bf324a6ec26f9b8af2a415 to your computer and use it in GitHub Desktop.
Save meysampg/583b421b39bf324a6ec26f9b8af2a415 to your computer and use it in GitHub Desktop.
CMakeLists file for using OpenMP inside of a C++ project
cmake_minimum_required(VERSION 3.19)
project(jacobi_method)
set(CMAKE_CXX_STANDARD 14)
find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif ()
add_executable(jacobi_method main.cpp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment