From fb4f31750372e51b96d2a690d2fdabf41bb0aa38 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sat, 5 Mar 2011 16:12:06 +0000 Subject: [PATCH] Make OpenMP optional on linux. For now it is on by default, but you can disable it by adding -DOPENMP=OFF to the cmake command line. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7301 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c88d3aa75..35877d5d56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,18 +139,23 @@ endif() include(CheckLib) -include(FindOpenGL REQUIRED) +include(FindOpenGL) include_directories(${OPENGL_INCLUDE_DIR}) if(NOT OPENGL_GLU_FOUND) message(FATAL_ERROR "GLU is required but not found") endif() -include(FindOpenMP) -if(OPENMP_FOUND) - add_definitions("${OpenMP_CXX_FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") -else() - message(FATAL_ERROR "OpenMP is required but not found") +option(OPENMP "Enable OpenMP parallelization" ON) +if(OPENMP) + include(FindOpenMP OPTIONAL) + if(OPENMP_FOUND) + message("OpenMP parallelization enabled") + add_definitions("${OpenMP_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + endif() +endif() +if(NOT OPENMP_FOUND) + message("OpenMP parallelization disabled") endif() include(FindALSA OPTIONAL) @@ -381,7 +386,7 @@ if(NOT DISABLE_WX) VERSION_EQUAL 2.8.2) check_lib(GTK2 gtk+-2.0 gtk.h REQUIRED) else() - include(FindGTK2 REQUIRED) + include(FindGTK2) if(GTK2_FOUND) include_directories(${GTK2_INCLUDE_DIRS}) endif()