openjpeg provides CMake targets: find_package(OpenJPEG CONFIG REQUIRED) target_link_libraries(main PRIVATE openjp2) openjpeg provides pkg-config modules: # JPEG2000 library libopenjp2