Comment #1 on issue 532 by
ygu...@google.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c1I can reproduce the issue, the steps are described below. I did not find a straightforward solution yet.
In a folder, with libwebp-1.2.0 sources downloaded from:
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.0.tar.gzand CMakeLists.txt:
cmake_minimum_required(VERSION 3.19)
project(DoNothing CXX)
add_subdirectory (libwebp-1.2.0)
add_executable (donothing donothing.cc)
target_link_libraries (donothing LINK_PUBLIC webp)
and donothing.cc:
#include <iostream>
#include "webp/decode.h"
int main(int argc, char** argv) {
std::cout << "Version: "
<< ((WebPGetDecoderVersion() & 0xFF0000) >> 16) << "."
<< ((WebPGetDecoderVersion() & 0x00FF00) >> 8) << "."
<< ((WebPGetDecoderVersion() & 0x0000FF) >> 0) << "." << std::endl;
return 0;
}
Running the following:
mkdir build
cd build
cmake ..
cmake --build .
./donothing
prints the following on Linux:
Version: 1.2.0.
and fails with the following error on Windows:
donothing.cc(2,10): fatal error C1083: Cannot open include file: 'webp/decode.h'