diff --git a/CMakeLists.txt b/CMakeLists.txt index dd149c287..d8d0393f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,11 @@ if(WITH_APP_BUNDLE) endif() add_gcc_compiler_flags("-fno-common") -check_add_gcc_compiler_flag("-fopenmp") +find_package(OpenMP) +if(OpenMP_FOUND) + add_gcc_compiler_cflags(${OpenMP_C_FLAGS}) + add_gcc_compiler_cxxflags(${OpenMP_CXX_FLAGS}) +endif() add_gcc_compiler_flags("-Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long") add_gcc_compiler_flags("-Wformat=2 -Wmissing-format-attribute") add_gcc_compiler_flags("-fvisibility=hidden")