Commit Graph

128 Commits

Author SHA1 Message Date
Yannis Guyon
42592af875 webp,cmake: Remove unnecessary include dirs
Following crrev.com/c/webm/libwebp/+/3038647

Change-Id: Id43ed9b1cc02a7333bc64e82523122f483c9350a
2021-08-30 09:35:31 +02:00
Yannis Guyon
edea64442c libwebp/CMake: Add <BUILD_INTERFACE> to webp incl
This way target_link_libraries(my_target PUBLIC webp) is enough,
no need to add include directories explicitly for the public headers
such as src/webp/decode.h. This matches the /usr/include/webp/decode.h
installation folder path prefix (#include "webp/decode.h").
See https://bugs.chromium.org/p/webp/issues/detail?id=532

The target_include_directories() calls for cwebp, dwebp etc. may be
unnecessary now and may be removed in another patch.

Change-Id: I2c85218920ffc35ebec23e0dd239f71e29add23b
2021-07-19 18:46:03 +02:00
Christopher Degawa
6f445b3e3d
CMake: set CMP0072 to NEW
Silences CMake's warning and uses GLVND, which still works for linux

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Change-Id: Iadd173b41c4fbcdff9fe512f9a7dbf70a6d95bcd
2021-06-21 21:25:28 -05:00
Christopher Degawa
de3b4ba813 CMake: add WEBP_BUILD_LIBWEBPMUX
Adds an additional option similar to configure's --enable-libwebpmux
to toggle building libwebpmux separate from the binaries

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Change-Id: I0443b84eea36d86791e2e421a6fc0070879a7bef
2021-06-16 16:55:45 +00:00
James Zern
7f09d3d132 CMakeLists.txt: rm libwebpmux dep from anim_{diff,dump}
Change-Id: Ic293affca5a3e17afbfcda5e96eb101d005621b8
2021-06-16 04:40:21 +00:00
James Zern
3320416b2e CMakeLists,emscripten: use EXPORTED_RUNTIME_METHODS
rather than EXTRA_EXPORTED_RUNTIME_METHODS. this was deprecated in
2.0.18.

quiets a warning:
emcc: warning: EXTRA_EXPORTED_RUNTIME_METHODS is deprecated, please use
EXPORTED_RUNTIME_METHODS instead [-Wdeprecated]

https://emscripten.org/docs/introducing_emscripten/release_notes.html?highlight=exported_runtime_methods

Change-Id: I3acf22339a64f39a342051841a147744f6af954a
2021-05-21 15:09:04 -07:00
James Zern
7e58a1a260 *.cmake: add license header
this syncs the files with CMakeLists.txt

Change-Id: I94d45ef61d33ee9e43973b5d4e85fab007941f67
2021-04-12 17:28:15 -07:00
James Zern
5651a6b2ed cmake: fix .so versioning
libtool uses -version-info current:revision:age, but the library created
is [c-a].a.r.

Change-Id: Icf081e156a818a3cd7579ad5ffe3b518d8532bdb
2021-04-07 13:51:22 -07:00
James Zern
759b9d5a06 cmake: add WEBP_USE_THREAD option
this controls the config.h define of the same name and matches the
behavior of configure's --disable-threading

Bug: webp:502
Change-Id: Id135bbf4e6b3c9900e2b4f4f7ab744b3457ce41c
2021-02-05 15:32:41 -08:00
James Zern
926ce921f3 cmake: don't install binaries from extras/
this matches the behavior of configure

Bug: webp:502
Change-Id: I99e597971636bdc2b9a9465ba13bb24c70ce87c0
2021-02-05 15:30:06 -08:00
Skal
9eb2638119 CMake: remove duplicate "include(GNUInstallDirs)"
+ add missing copyright header

Change-Id: I2b61ab56a14d38360ac5beaebab4d2acf165dd46
2020-12-17 08:00:06 +01:00
James Zern
d2e245ea9e cmake: disable webp.js if WEBP_ENABLE_SIMD=1
wasm2js doesn't support SIMD, fixes link error

Change-Id: I3d9d3cb5f29434bf6c0c0029c07540a9768f9b95
2020-11-23 18:53:20 -08:00
James Zern
5abb55823b Merge "cmake: fix compilation w/Xcode generator" 2020-11-24 01:31:26 +00:00
James Zern
8484a1204c cmake: fix compilation w/Xcode generator
Add a stub file to object only library targets.

https://cmake.org/cmake/help/v3.18/command/add_library.html#object-libraries
Some native build systems (such as Xcode) may not like targets that have
only object files, so consider adding at least one real source file to
any target that references $<TARGET_OBJECTS:objlib>.

Bug: webp:477
Change-Id: I5d404c921d84433c7a0b22e0736ab0dbe699d264
2020-11-20 13:21:17 -08:00
Ingvar Stepanyan
52273943c6 Couple of fixes to allow SIMD on Emscripten
- Add `-msimd128` to flags to actually enable WebAssembly SIMD
   when performing SIMD detection. It's currently required in
   addition to `-msse*` / `-mfpu=neon` flags which only perform
   translation of corresponding intrinsics to Wasm SIMD ones.
   See a discussion at emscripten-core/emscripten#12714 for
   automating this and making easier in the future.
 - Remove compilation branch that prevented definitions of
   `WEBP_USE_SSE` and `WEBP_USE_NEON` on Emscripten even when
   SIMD support was detected at compile-time.
 - Add an implementation of `VP8GetCPUInfo` for Emscripten which
   uses static `WEBP_USE_*` flags to determine if a corresponding
   SIMD instruction is supported. This is because Wasm doesn't
   have proper feature detection (yet) and requires making separate
   build for SIMD version anyway.

Change-Id: I77592081b91fd0e4cbc9242f5600ce905184f506
2020-11-18 21:51:41 +00:00
Vincent Rabaud
133ff0e374 webp_js: force WASM=0 option explicitly
It's apparently no longer the default.

BUG=webp:470

Change-Id: Ic3219f2df2f19783ccea116e87bbefee29fe5edc
2020-05-29 14:56:34 +02:00
James Zern
22e404ccbd CMakeLists.txt: fix set(CACHE) argument order
<type> comes before <docstring>

Change-Id: Iad8cfbbab452381969a7b36aaf244b6abc4fc974
2020-02-06 20:27:01 -08:00
Skal
47178dbd45 extras: add WebPUnmultiplyARGB() convenience function
This is useful for converting associated to unassociated.

Change-Id: I0e6d16ec63cb5514a0f945c14a54e0d01e1fab0a
2019-12-17 17:36:37 -08:00
Pascal Massimino
78881b769c CMake: fix GLUT library link
use GLUT_LIBRARIES instead of GLUT::GLUT

Change-Id: I92af90e09e00b01bd050ebeb8e9003b14c7dc144
2019-10-23 16:25:39 +02:00
James Zern
9f750f7a06 cmake: fix BUILD_SHARED_LIBS build on mac
add some missing dependencies and convert utility libraries to
static only libraries to avoid creating unnecessary shared object
libraries which may fail to link due to missing symbols.

Change-Id: Iaa91a3d97fa5af6ada4b2a851cc7fc2879d871da
2019-10-22 14:42:30 -07:00
Vincent Rabaud
804540f183 Fix cpufeatures in CMake.
cpufeatures was not installed even though WebP depends on it on Android.

BUG=webp:415

Change-Id: Iba00001534ceedbf65fbb42244a6c1341eb65134
2019-07-01 10:48:54 +02:00
Vincent Rabaud
bf00c15b23 Add CMake option for bittrace.
Change-Id: I9f09eb2c0afdac41e94bc10dfedd1fd004c45731
2019-07-01 10:48:54 +02:00
Vincent Rabaud
6bcf876980 Remove BINARYEN_METHOD in wasm settings.
This was removed according to https://kripken.github.io/emscripten-site/docs/compiling/WebAssembly.html#debugging

BUG=webp:413

Change-Id: If8f1a3f1260d34cdd2b937b286e4c57fb48ed828
2019-01-23 11:12:26 +01:00
skal
4cd0582d50 CMake: fix webp_js compilation
Stick to the strict necessary for running webp_js,
and avoid building sub-lib or examples with heavy dependencies.

Change-Id: Ife4170a7839fb3201b2cf158d98d17bebe10008f
2018-11-06 16:07:05 +01:00
Yannis Guyon
9cf9841b5e libwebp: Unicode command tools on Windows
Define macros in examples/unicode.h to use Unicode argv
on Windows. Keep char everywhere on Unix since it handles
UTF-8 without any change.

Impact:
 - All fopen () and SHCreateStreamOnFile(),
 - All fprintf() printing file paths,
 - All strcmp() used with "-",
 - File path parsing,
 - Gif reading.

Concerned executables from examples/ and extras/:
  anim_diff, anim_dump, vwebp, vwebp_sdl,
  cwebp, dwebp, gif2webp, img2webp,
  webpmux, webpinfo, webp_quality, get_disto

When compiled on Windows with Unicode enabled, webpmux and
img2webp will not work when used with an argument file and
will print "Reading arguments from a file is a feature
unavailable with Unicode binaries."

BUG=webp:398

Change-Id: Ic55d222a3ce1a715f9c4cce57ecbe2705d5ce317
2018-10-17 13:19:40 +02:00
Konstantin Ivlev
eee00b6627 - install pkg-config files during the CMake build
Signed-off-by: Konstantin Ivlev <tomskside@gmail.com>
Change-Id: I88b1a22b19dd9ecdb2ae38082fa9580dbc66d98c
2018-10-08 16:02:12 -07:00
Yannis Guyon
5c395f1d71 libwebp: cmake-format all
https://github.com/cheshirekow/cmake_format
A complete row of # is replaced by only one,
so add a space after the first one to keep it.

Change-Id: I367749353a555c89c717f1939220699e43ecab2c
2018-10-05 14:23:06 +02:00
Yannis Guyon
e7a697297b libwebp: Add extras targets in CMakeLists.txt
To be compiled with Visual Studio on Windows through CMake.
Targets are get_disto, vwebp_sdl, webp_quality.

Change-Id: Idec1e19b61b6a661011effee42f7440264afd3ed
2018-10-04 18:58:43 +02:00
Yannis Guyon
da26ee49a6 CMake: Set WEBP_BUILD_GIF2WEBP to off
Instead of unsetting WEBP_BUILD_GIF2WEBP,
disable it to keep it displayed in ccmake.
Disable WEBP_BUILD_GIF2WEBP before it's tested.
Do the same for WEBP_BUILD_ANIM_UTILS.

Change-Id: I91920814fbda4825ced9a801bb005f8d44bfe09c
2018-10-01 13:48:22 +02:00
Vincent Rabaud
423f257930 Fix up CMake to create targets.
Change-Id: I4b0b71d0ab7e49e237bd928de690915cc3b86be2
2018-07-25 14:04:18 +02:00
James Zern
1579559662 CMakeLists.txt,cosmetics: normalize if() formatting
+ break a long line

Change-Id: Ia508d517e89dd2109b655c220b66d8aa834a3b52
2018-06-05 09:27:08 -07:00
James Zern
35c7de6fc4 cmake: add support for webpmux
Change-Id: Ia694ba49549c43956f6552e6981a46df0fe7e686
2018-06-04 15:44:04 -07:00
Alan Browning
2a9de5b9d3 Add build rules for anim_diff & anim_dump utils.
Change-Id: I2697a6dc3c419a19909262003a6d6a263d3c2747
2018-06-01 19:23:47 -07:00
James Zern
094b3b285b cmake: quiet glut deprecation warnings on OS X
BUG=webp:187

Change-Id: I652b474dc8389b2219a424d43dec80c3bf9ba62c
2018-04-20 19:57:16 -07:00
Vincent Rabaud
b0c966fb66 Build vwebp from CMake.
Change-Id: I428fd563964a72d58bee75e651c581fbbdb0eb26
2018-04-20 11:13:09 +02:00
Vincent Rabaud
1c8f358df4 Fix CMake with WASM.
Change-Id: I21c78999484815c58b5b2c9795310da9d04888e9
2018-04-05 16:25:15 +02:00
Pascal Massimino
a0215fb7dc webp_js: fix webp_js demo html
We need to export 'Module.cwrap' method.

Change-Id: I2986c5a4c06630ae3f95086a114e727a86c99a2b
2018-04-05 16:25:15 +02:00
Vincent Rabaud
e155dda0cc Use proper targets for CMake.
Also fix the bug where near lossless was not used
and allow examples to be built by default.

Change-Id: Ieb5ef77fafe83f3776ff4fd27a6d26534c7a51f3
2018-04-03 17:49:08 -07:00
Pascal Massimino
641cedccd3 imagedec: support metadata reading for WebP image decoding
Needs to link imagedec.a to demux/libwebpdemux.a

Change-Id: Id8f4068718b0e4a1e84607bccd5af5419120c231
2018-03-28 16:36:37 -07:00
James Zern
f4dd92565e remove WEBP_EXPERIMENTAL_FEATURES
the webp bitstream is considered stable at this point

Change-Id: I4b13f9ed4c45f63785474b097e96cb7bf651be7b
2018-02-09 10:25:11 -08:00
James Zern
80285d97ad cmake: avoid security warnings under msvc
fopen, sscanf are error checked and only used in the examples. this
matches Makefile.vc.

Change-Id: I411c3ace6b5db092656d6b03dc5b438bd70616fc
2017-11-15 18:41:41 -08:00
James Zern
650eac5542 cmake: don't set -Wall with MSVC
take the generator default (/W3); /Wall produces too many warnings that
can't be acted on.

Change-Id: I112d0f46456af2758ddfee6becc098447ca50b6f
2017-11-15 18:29:15 -08:00
James Zern
a439972175 WIP: list includes as descendants of the project dir
#include "(.|..)/..." -> #include "src/..."

Change-Id: I772880aa097a770722043c8a4393552ba38a89b6
2017-10-10 23:04:05 -07:00
Vincent Rabaud
35f736e1ec Fix CMake redefinition for HAVE_CPU_FEATURES_H
It is still redefined, but to the same constant,
hence no more warning as mentioned on BUG=webp:358

Change-Id: I80a834c139d5d60cd693d468b0e2ea399729ab3e
2017-09-25 14:43:20 +02:00
Vincent Rabaud
a80fcc4ae1 ifdef code not used by Chrome/Android.
Change-Id: Id086f6fd602b1fe3dc9034764b6a920a696ff1d2
2017-08-31 14:02:05 +02:00
Vincent Rabaud
869eb36983 CMake cleanups.
Change-Id: I177c856eb06e8fb2847a0d483114198a2a0a5dae
2017-08-25 14:01:56 +02:00
James Zern
6473d20b3e Merge "fix Android standalone toolchain build" 2017-08-04 18:25:21 +00:00
James Zern
c6d1db4b36 fix Android standalone toolchain build
add a check for cpu-features.h and rework some of the ifdef's around
android + neon. for android builds with cpu-features enabled the
*_neon.c files will still need to be flagged correctly (with e.g.,
.c.neon in Android.mk) to properly build them.

BUG=webp:353

Change-Id: I905ce305af0a204e560b915d8665093a3edaceb9
2017-08-01 22:59:03 -07:00
skal
663a6d9d2e unify the ALTERNATE_CODE flag usage
Pattern is now:
 #if !defined(FLAG)
 #define FLAG 0   // ALTERNATE_CODE
 #endif
...
 #if (FLAG == 1)
 ...
 #else
  ...
 #endif    // FLAG
...

Removed some unused code / flags:
  WEBP_YUV_USE_TABLE, WEBP_REFERENCE_IMPLEMENTATION,
  experimental code,  VP8YUVInit(), ...

BUG=webp:355

Change-Id: I98deb9189446a4cfd665c13ea8aa1ce6a308c63f
2017-08-01 20:49:29 -07:00
James Zern
c793417a3c cmake: disable gif2webp if gif lib isn't found
Change-Id: I218d5c0e3f4a82905c743705382cf02d26b29e6d
2017-07-06 15:33:01 -07:00
James Zern
dcbc1c881a cmake: split gif detection from IMG deps
gifdec isn't part of imageio lib, it's only used by gif2webp.

Change-Id: I70bff378a32f8fb2ebb8a5a7701049ffff7f7992
2017-07-06 15:32:55 -07:00
hui su
d63e6f4b23 Add a man page for webpinfo
BUG=webp:330

Change-Id: I7b02274401c935affa173a49a883a39272b6dcc3
2017-05-09 16:14:44 -07:00
Vincent Rabaud
b4d576fa9c Install man pages with CMake.
Change-Id: I58a91ea00d45e1ce95250bd73613cf53e3af8401
2017-05-09 11:41:48 +02:00
James Zern
285748be78 cmake: build/install webpinfo
Change-Id: Ia3dd24aec0c985855865f32280de1799d4bb8e9e
2017-03-23 20:37:52 -07:00
Pascal Massimino
d0b7404e00 Merge "WASM support" 2017-03-21 13:27:55 +00:00
Pascal Massimino
134e314fd8 WASM support
demo page: webp_js/index_wasm.html

Change-Id: I9e6bde205c2730f96c5f30ec01f4bfacf1f5d128
2017-03-21 14:07:22 +01:00
Pascal Massimino
274daf5415 Add webpinfo tool.
A command line tool to print out the chunk level structure of
WebP files along with basic integrity checks.

BUG=webp:330

Change-Id: Ic69f646f649abb655b1854621d99afedeed158d7
2017-03-14 11:41:17 +01:00
Vincent Rabaud
5f62487189 Install binaries, libraries and headers in CMake.
Change-Id: Iaf32c716e0252f9a0e9f5d663f02b8fad98096e2
2017-03-03 09:35:02 +01:00
Pascal Massimino
ca9f7b7dd6 WebP-JS: emscripten-based Javascript decoder
The build is based on CMake.

There is a demo HTML page under webp_js/index.html

See README.webp_js file.

BUG=webp:261

Change-Id: I6612378b89907efd7b863720c6becf98385fc406
2017-02-07 11:02:42 +00:00
Pascal Massimino
e0012bea23 CMake: only use libwebpdecoder for building dwebp
Change-Id: Ia972c063711529d1e9a7fa79cf250d0764840e6f
2017-02-04 00:04:23 -08:00
Vincent Rabaud
3226325016 Add a flag to disable SIMD optimizations.
Change-Id: I83c33076e8afd1b20de1e9b191bdad6669998a0b
2017-02-03 16:56:37 +01:00
Vincent Rabaud
03cda0e494 Add a decoder only library for WebP in CMake.
Other libraries are also cleaned to automatically read the Makefile.am.
Dependencies also got cleaned.

Change-Id: I5d1ff0a4010d59e8c929ed0c9c30c05d83c271f8
2017-02-01 13:32:15 +01:00
Pascal Massimino
dcf9d82a95 imageio: add limited PNM support for reading
see: http://netpbm.sourceforge.net/

Only reads P5 and P6 pnm files for now.

Change-Id: I2332a623f803df67455047f570f1cff9f464480a
2017-02-01 07:41:56 +00:00
Pascal Massimino
03f40955a3 img2webp: convert a sequence of images to an animated webp
Usage:

  img2webp [file-level options] [image files...] [per-frame options...]

File-level options (only used at the start of compression):
 -min_size ............ minimize size
 -loop <int> .......... loop count (default: 0, = infinite loop)
 -kmax <int> .......... maximum number of frame between key-frames
                        (0=only keyframes)
 -kmin <int> .......... minimum number of frame between key-frames
                        (0=disable key-frames altogether)
 -mixed ............... use mixed lossy/lossless automatic mode
 -v ................... verbose mode
 -h ................... this help

Per-frame options (only used for subsequent images input):
 -d <int> ............. frame duration in ms (default: 100)
 -lossless  ........... use lossless mode (default)
 -lossy ... ........... use lossy mode
 -q <float> ........... quality
 -m <int> ............. method to use

example: img2webp -loop 2 in0.png -lossy in1.jpg
                  -d 80 in2.tiff -o out.webp

Change-Id: I23771b90eaf0660f420d7ffd304e704155386286
2016-12-02 11:44:17 +01:00
James Zern
82c91c708e Merge "libimageenc.a: extract image-saving code from dwebp" 2016-09-09 03:00:20 +00:00
Pascal Massimino
af1ad3e2dd libimageenc.a: extract image-saving code from dwebp
BUG=webp:277
Change-Id: I2c0e1df7b13b1f77474b5478048fef022e90f77a
2016-09-08 19:11:26 -07:00
Vincent Rabaud
4bda0cfba4 add gif2webp to CMake
Change-Id: I9eec1e590ae5b523e0dd65a2ed9d094696346f5a
2016-09-05 18:12:24 +02:00
Pascal Massimino
3884972e3f remove WEBP_FORCE_ALIGNED and use memcpy() instead.
BUG=webp:297

Change-Id: I89a08debec7bb1b3f411c897260ab1bb63f77df2
2016-08-17 20:16:03 -07:00
Vincent Rabaud
7b54e26bac Add a CMake option for WEBP_SWAP_16BIT_CSP.
Change-Id: I79ed6cbce9563bf7ca97fc2e10ec3e75b6b8ab5b
2016-08-05 09:45:34 +02:00
Vincent Rabaud
d2223d8d6c Fix missing cpu-features for Android.
Change-Id: Ief13b7c63b96194970b00a5732aa080f794e7ae6
2016-08-05 09:26:32 +02:00
James Zern
ebee57f4d1 move imageio/example_util.[hc] (back to) examples/
decoding and file i/o have been split to imageio, all that remains is
some string routines used for parameter parsing in the examples

Change-Id: I77386cd8aa39124b9e14c95fdbaa17ea4ab5bb24
2016-07-21 20:41:03 -07:00
James Zern
bdda5bd4bf split example_util.h
move ExUtil*File to imageio_util.h
ExUtil*WebP* to webpdec.h

string parsing routines remain

Change-Id: I0560c4a74e86710d83bc4b5b234f1b5ef9a86f9d
2016-07-21 19:14:58 -07:00
James Zern
c379b55a93 move examples/{example_util,image_dec} to imageio/
Change-Id: I2508c786a095a2a75bebf766210c64e2af88f9b6
2016-07-19 19:06:29 -07:00
Vincent Rabaud
6c62841076 Split the main CMake file.
This will well isolate contributions for original code,
generated code and SIMD (especially for Android).

Change-Id: Ie47664decc7f43c2f57260a72cab951c347281a7
2016-07-07 21:25:01 +02:00
Pascal Massimino
ae2a7222ce collect all decoding utilities from examples/ in libexampledec.a
adds a generic examples/image_dec.[ch] entry point too.

WebPGuessImageType() can be used to infer image type.

Change-Id: I8337e7b6ad91863c9cf118e4791668d2d175079b
2016-06-01 05:39:55 +00:00
Vincent Rabaud
696eb2b03a fix C and SIMD flags completion.
CMAKE_C_FLAGS is handled as a string and not a list by CMake.

Change-Id: Ia0cfb38817edef2f212a04b26601f6aea76a5684
2016-02-17 09:10:04 +01:00
James Zern
4a7b85a967 cmake: fix builtin detection w/-Werror
and other warnings enabled (-Wunused-value)

Change-Id: Ie3605628b4cbfb5bfd1e847cc504cb96f2825388
2016-01-28 23:47:11 -08:00
Vincent Rabaud
3661b98069 Add a CMakeLists.txt
The goal is not to replace our autotools configuration, but to
provide a minimal CMake file that can build the lib, cwebp and
dwebp.

Change-Id: I3be343bd698d118c5f00172449d232d87e868f23
2016-01-28 01:30:59 +01:00