Skip to content

Commit

Permalink
Update for src/CMakeLists.txt
Browse files Browse the repository at this point in the history
Added logic to link to OpenMP library.

This commit references #453
  • Loading branch information
EricEngle-NOAA committed Oct 24, 2023
1 parent cdfc9cc commit a7a7acd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ if(BUILD_STATIC_LIBS)
target_include_directories(${lib_name}_static PRIVATE "${LIBXML2_INCLUDE_DIR}")
endif()

# Link to OpenMP.
if(OPENMP)
target_link_libraries(${lib_name}_objlib PUBLIC OpenMP::OpenMP_C)
if(BUILD_SHARED_LIBS)
target_link_libraries(${lib_name}_shared PUBLIC OpenMP::OpenMP_C)
endif()
if(BUILD_STATIC_LIBS)
target_link_libraries(${lib_name}_static PUBLIC OpenMP::OpenMP_C)
endif()
endif()

# Build with PNG.
if(PNG_FOUND)
message(STATUS "PNG include directories ${PNG_INCLUDE_DIR}")
Expand Down

0 comments on commit a7a7acd

Please sign in to comment.