Add OpenMP support to cmake.

This commit is contained in:
Mark de Wever 2011-03-05 21:17:36 +00:00
parent a97e6899b4
commit a2c7ca056e

View file

@ -71,6 +71,7 @@ option(ENABLE_TESTS "Build unit tests")
option(ENABLE_NLS "Enable building of translations" ON)
option(ENABLE_POOL_ALLOC "Enable custom pool malloc" OFF)
option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF)
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
if(UNIX AND NOT APPLE AND NOT CYGWIN)
option(ENABLE_DESKTOP_ENTRY "enable installation of desktop entry files" ON)
@ -168,6 +169,12 @@ if(ENABLE_LOW_MEM)
add_definitions(-DLOW_MEM)
endif(ENABLE_LOW_MEM)
if(ENABLE_OMP)
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${OpenMP_C_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_C_FLAGS}")
endif(ENABLE_OMP)
if(ENABLE_DEBUG_WINDOW_LAYOUT)
add_definitions(-DDEBUG_WINDOW_LAYOUT_GRAPHS)
endif(ENABLE_DEBUG_WINDOW_LAYOUT)