Skip to content

Commit

Permalink
Initial commit to provide OpenMP support
Browse files Browse the repository at this point in the history
Added logic to top-level CMake config script to provide OpenMP support
via config variable OPENMP (default) with usage (-DOPENMP=ON|OFF).

This commit references #453
  • Loading branch information
EricEngle-NOAA committed Oct 24, 2023
1 parent 0218d13 commit 471f172
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

# Handle user options.
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
option(OPENMP "Use OpenMP threading." OFF)
option(USE_PNG "Use PNG library" ON)
option(USE_Jasper "Use Jasper library" ON)
option(USE_OpenJPEG "Use OpenJPEG library" OFF)
Expand Down Expand Up @@ -97,6 +98,11 @@ endif()
# Find libxml2.
find_package(LibXml2 2.9.0 REQUIRED)

# Handle OpenMP if desired
if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS C)
endif()

# Set the compiler flags.
if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_C_FLAGS "-g -traceback ${CMAKE_C_FLAGS}")
Expand Down

0 comments on commit 471f172

Please sign in to comment.