Issue 532 in webp: Include libraries doesn't propagate

13 views
Skip to first unread message

marro… via monorail

unread,
Jul 13, 2021, 8:17:47 AMJul 13
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 532 by marro...@gmail.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532

What steps will reproduce the problem?
1.Download Webp1.2.0, add to project's sources
2.add_subdirectory() accordingly to build using CMake files

What is the expected output? What do you see instead?
I expect to be able to include headers in my project. An error is thrown "webp/mux.h : No such file or directory". I have to include all the path from where the compiled file is located

What version of the product are you using? On what operating system?
1.2.0 on Windows 10

Please provide any additional information below.
I have a solution which consist of adding myself the directory as include, which should have been done implicitly when declaring dependency.

Am I missing something ?

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

ygu… via monorail

unread,
Jul 19, 2021, 11:13:50 AMJul 19
to webp-d...@webmproject.org

Comment #1 on issue 532 by ygu...@google.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c1

I 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.gz
and 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'

ygu… via monorail

unread,
Jul 19, 2021, 12:08:01 PMJul 19
to webp-d...@webmproject.org

Comment #2 on issue 532 by ygu...@google.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c2

Adding PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> as an argument to target_include_directories(webp) in libwebp's CMakeLists.txt (https://chromium.googlesource.com/webm/libwebp/+/refs/tags/v1.2.0/CMakeLists.txt#283) seems to work.

In the meantime I suggest explicitly specifying the relative include path in your CMakeLists.txt:
target_include_directories (donothing PRIVATE ${WebP_SOURCE_DIR}/src)

ygu… via monorail

unread,
Jul 20, 2021, 4:24:54 AMJul 20
to webp-d...@webmproject.org
Updates:
Status: Fixed

Comment #4 on issue 532 by ygu...@google.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c4

https://chromium.googlesource.com/webm/libwebp/+/edea64442c76124802e6ae4e1e048f05367e9938

This should be included in the next release.

marro… via monorail

unread,
Jul 20, 2021, 4:27:44 AMJul 20
to webp-d...@webmproject.org

Comment #5 on issue 532 by marro...@gmail.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c5

Thank you, I had fixed it temporarily with the explicit include path as @yguyon suggested. Glad to know it will be fixed.

marro… via monorail

unread,
Jul 21, 2021, 3:45:44 AMJul 21
to webp-d...@webmproject.org

Comment #7 on issue 532 by marro...@gmail.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c7

Hi,

Your fix works like a charm, include path is properly propagated.

I'm glad to have had an answer so quick.

Have a good week.

jz… via monorail

unread,
Jul 21, 2021, 2:18:20 PMJul 21
to webp-d...@webmproject.org

Comment #8 on issue 532 by jz...@google.com: Include libraries doesn't propagate
https://bugs.chromium.org/p/webp/issues/detail?id=532#c8

Thanks for the report and verifying the fix. This will be available in the upcoming v1.2.1 release: https://crbug.com/webp/521.
Reply all
Reply to author
Forward
0 new messages