Skip to content

Commit

Permalink
Merge pull request #269 from norlab-ulaval/fix/openmp
Browse files Browse the repository at this point in the history
Add OpenMP support in CMake
  • Loading branch information
pomerlef committed Jul 31, 2018
2 parents de74460 + af2c0a0 commit 2c8d526
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ include_directories(${libnabo_INCLUDE_DIRS})
set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${libnabo_LIBRARIES})
message(STATUS "libnabo found, version ${libnabo_VERSION} (include=${libnabo_INCLUDE_DIRS} libs=${libnabo_LIBRARIES})")

#--------------------
# DEPENDENCY: OpenMP (optional)
#--------------------
set(USE_OPEN_MP FALSE CACHE BOOL "Set to TRUE to 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(EXTERNAL_LIBS ${EXTERNAL_LIBS} gomp)
message("-- OpenMP found, parallel computer enabled")
endif(CMAKE_COMPILER_IS_GNUCC)
endif(OPENMP_FOUND)
endif (USE_OPEN_MP)

#--------------------
# DEPENDENCY: OpenCL (optional)
Expand Down

0 comments on commit 2c8d526

Please sign in to comment.