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()