Skip to content

Commit

Permalink
Added CMake switch to disable usage of OpenMP
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesSommer committed Aug 1, 2016
1 parent 85525ed commit 7281236
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ if(MSVC AND (MSVC_VERSION LESS 1600))
endif(MSVC AND (MSVC_VERSION LESS 1600))

# openmp
find_package(OpenMP)
if (OPENMP_FOUND)
add_definitions(-fopenmp -DHAVE_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
if (CMAKE_COMPILER_IS_GNUCC)
set(EXTRA_LIBS ${EXTRA_LIBS} gomp)
endif(CMAKE_COMPILER_IS_GNUCC)
endif(OPENMP_FOUND)
set(USE_OPEN_MP "true" CACHE BOOL "Set to OFF to not use OpenMP")
if(USE_OPEN_MP)
..find_package(OpenMP)
..if (OPENMP_FOUND)
....add_definitions(-fopenmp -DHAVE_OPENMP)
....set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
....if (CMAKE_COMPILER_IS_GNUCC)
......set(EXTRA_LIBS ${EXTRA_LIBS} gomp)
....endif(CMAKE_COMPILER_IS_GNUCC)
..endif(OPENMP_FOUND)
endif(USE_OPEN_MP)

# eigen 2 or 3
find_path(EIGEN_INCLUDE_DIR Eigen/Core
Expand Down

0 comments on commit 7281236

Please sign in to comment.