Skip to content

Commit

Permalink
Merge pull request #198 from alexander-buerger-met-no/cmake-aec-openjpeg
Browse files Browse the repository at this point in the history
CMake for aec and openjpeg
  • Loading branch information
AlysonStahl-NOAA authored Jul 22, 2024
2 parents 9b019ee + 6e8f609 commit c799318
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ if(USE_PNG)
find_package(PNG REQUIRED)
endif()

# Find required packages to use OpenJPEG
message(STATUS "Checking of the user wants to use OpenJPEG...")
if(USE_OPENJPEG)
find_package(OpenJPEG REQUIRED)
endif()

# Find required packages to use AEC
message(STATUS "Checking of the user wants to use AEC...")
if(USE_AEC)
Expand Down
7 changes: 6 additions & 1 deletion wgrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,15 @@ target_link_libraries(obj_lib PUBLIC gctpc -lm)
# Link to gctpc directly because oobject libraries do not link transitively
target_link_libraries(wgrib2_exe PRIVATE gctpc)

if(${USE_AEC} STREQUAL ON)
if(USE_AEC)
target_link_libraries(wgrib2_exe PRIVATE aec)
endif()

if(USE_OPENJPEG)
include_directories(${OPENJPEG_INCLUDE_DIRS})
target_link_libraries(wgrib2_exe PRIVATE ${OPENJPEG_LIBRARIES})
endif()

target_link_libraries(wgrib2_exe PRIVATE obj_lib)

if(BUILD_LIB)
Expand Down

0 comments on commit c799318

Please sign in to comment.