Commit Graph

52 Commits (master)

Author SHA1 Message Date
مهدي شينون (Mehdi Chinoune) 7efcf4f935
Some fixes for MINGW (#828)
* Enable webpng on MINGW

* Detect GD version using cmake language

* Use _aligned_malloc instead of posix_memalign on Windows

* Include missing "errno.h"

* Fix finding WEBP on MINGW

* Fix finding XPM on MINGW

* Use PkgConfig to find packages on MINGW

* CI: Enable more options  for MINGW
2022-04-15 15:34:24 +07:00
Mike Frysinger dbc310fca7 cleanup Windows CRLF line endlings 2021-09-11 12:48:02 -04:00
Pierre Joye 45d561fd06 #744, add cmake clang module, it builds now, but it fails weidly. 2021-08-31 12:30:20 +07:00
Pierre Joye b61fc2dbad simplify HEIF_HDR_TO_8BIT detection 2021-08-24 15:45:55 +07:00
Martin Reboredo 1a22921e8c
Enforce minimum libheif to 1.7.0 2021-08-21 00:41:17 -03:00
Pierre Joye 060026c1f5 Let check for HEIF not fontconfig 2021-08-21 01:46:37 +07:00
Pierre Joye b384e7ee64 Add FindNaturalDocs 2021-08-20 14:40:14 +07:00
Mike Frysinger 16fab2f35a cmake: allow tests to skip by exiting 77
The autotools framework supports this already.
2021-03-06 11:57:14 -05:00
Martin Reboredo 39c4644fa0
HEIF support through libheif (#670)
With the adoption of AVIF by Firefox and Chromium based browsers (still
in experimental phase), the newer incorporation of HEIF by Canon and Sony 
in their cameras and the newer support of both of them in modern software 
like ImageMagick, GIMP and Krita, `gd` haven't seen any endorsement for
the formats up until this PR.

Reading and writing is done by `libheif`, with functionality for chroma 
subsampling (for now `4:2:0`, `4:2:2` and `4:4:4`), quality (with new
`200` for lossless) and compression (whether `HEVC` or `AV1`) selection. 

This was tested with `libheif` version `1.11.0` in my Solus machine.

Also, fixes both #395 and #557.
2021-03-02 12:32:03 -05:00
Ben Morss d6a061850d cmake: webp: remove implicit lib search relative to gd checkout
If the builder has packages in a diff location, they can specify them
globally.  The webp code shouldn't be searching for it specifically.
2021-02-26 12:48:15 -05:00
wilson chen 450fd2e843
Fixed #472: Adjusting CMakeLists.txt (#582)
Add REQUIRED to FIND_PACKAGE
2020-05-10 22:41:14 +08:00
willson-chen 4cb9825f32 Update cmake min version to 3.7 2019-11-06 13:23:03 -08:00
willson-chen e6159b206f Fix #533: Remove cmake modules
FindFreetype.cmake, FindPNG.cmake and FindJPEG, have been the cmake standard modules since cmake v2.6.
2019-11-04 23:50:57 -08:00
willson-chen fbc8833e99 FindLIQ.cmake: delete libimagequant source code download logic
* FindLIQ.cmake: add comment of LIQ_BUILD which is used in CMakeLists.txt

And fixed some indent error.

* FindLIQ.cmake: delete download libimagequant source code logic.

* And delete the LIQ_BUILD logic in CMakeLists.txt correspondingly.
* Fixed some indent errors.

* FindLIQ.cmake: Delete libimagequant download path
2019-11-04 23:48:27 -08:00
willson-chen ecea96be09 Fix some cmake modules typos 2019-11-03 18:27:07 -07:00
willson-chen ac7118680d Fix #539: Add RAQM support for cmake
* Add `ENABLE_RAQM` option to CMakeLists.txt
* Add cmake module FindRAQM.cmake
2019-11-02 00:59:43 -06:00
willson-chen d19cf8354c CMakeLists.txt: Exclude libm dependency under win
* CMakeLists.txt: Exclude libm dependency under win
* CMakeLists.txt: Move win32/m logic into cmake/modules/gd.cmake
2019-10-26 16:06:26 -07:00
Mike Frysinger e0cb1b76c3 cmake: update FindFreetype module
This pulls some fixes from upstream cmake.
2019-02-09 13:55:44 -05:00
Mike Frysinger eaa28204bd cmake: update FindPNG module #475
This pulls in a minor change from upstream cmake to support libpng
versions 1.6.  Fixes #475.
2019-02-09 13:32:39 -05:00
Peter Kokot 5dc2dd8b49 Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of
the standard headers [1] and on current systems it is always present
and the `HAVE_STDLIB_H` symbol can be removed.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-08 03:29:27 -04:00
Peter Kokot 5fa75ace15 Remove HAVE_STRING_H
The C89 and later standard defines the `<string.h>` header as part of
the standard headers [1] and on current systems it is always present
and the `HAVE_STRING_H` symbol can be removed.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-08 03:16:35 -04:00
Peter Kokot 486467fc8f Remove HAVE_STDDEF_H
The `<stddef.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need to manually check if header is
present anymore.

Since the libgd requires at least C89 or greater, the `HAVE_STDDEF_H`
symbol defined by Autoconf in configure.ac [2], and Cmake build system
files can be removed and simplifed.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-06 02:04:22 -04:00
Peter Kokot d81a1383d7 Remove HAVE_LIMITS_H
The `<limits.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need to manually check if header is
present anymore.

Since the libgd requires at least C89 or greater, the `HAVE_LIMITS_H`
symbol defined by Autoconf in configure.ac [2], and Cmake build system
files can be removed and simplifed.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-06 00:30:15 -04:00
Peter Kokot 1e7f93922f Remove HAVE_ERRNO_H
The `<errno.h>` header file is part of the standard C89 headers [1] and
on older systems there needed to be also a manual check if header is
present.

Since libgd requires at least C89 or greater, the `HAVE_ERRNO_H`
symbol defined by Autoconf in configure.ac [2], and Cmake build system
files can be removed and simplifed.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.3
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-05 01:39:49 -04:00
Peter Kokot 01c59d840b Remove Git ident attributes
Git ident attributes were in most cases utilized with SVN and keywords
substitutions, where $Id$ were replaced with certain revision from the
repository. In Git this functionality is different. Each $Id$ needs to
be defined in .gitattributes file to be effective. This patch removes
unused and outdated attributes.
2018-06-27 02:04:37 +02:00
Mike Frysinger fd06f7f83c clean up trailing whitespace/newlines
This is preparation for adding some linting checks for new commits from
people.  Shouldn't be any functional changes here (tests still pass!).
2018-06-21 22:47:42 -04:00
Mike Frysinger aac77143dd convert all files to native line encodings
A bunch of these files were committed with Windows line encodings.
Strip all those ^M gremlins out as people working on Windows can
use git's autocrlf setting to convert back and forth as needed.
2018-06-21 21:44:54 -04:00
Christoph M. Becker 251d325420 Fix CMake configuration for fontconfig
ftheader.h is unlikely to be found in include/freetype2/freetype/config/,
but rather in include/freetype2/config/. We also re-enable the
freetype/bug00132 test case for CMake, as it's also enabled for autotools.
2016-08-27 14:41:31 +02:00
Mike Frysinger c9a4a85f38 libimagequant: fix integration
The symbol was being set up in cmake but not on the autotools side.
Clean this up to be like other external libraries.

We need to pull in some openmp logic as it's not uncommon for the lib
to be built with openmp support.  When we test for it, we need to do
so with openmp flags.

Fixes #137.
2016-05-18 03:03:50 -04:00
Mike Frysinger 1239832a09 configure/cmake: unify header checks and config.h generation
Rather than hand maintain config.h.cmake (which is already out of date),
re-use the autogenerated config.h from autoheader.
2016-05-17 23:06:14 -04:00
Mike Frysinger b083ec17ad cmake: update build files to match autotools more
Clean up redundant header logic and focus on what we actually care about:
whether specific headers exist.

Update the program list to omit programs when required libs are not found.
2016-05-14 01:01:44 -04:00
Mike Frysinger adc8598dcb tests: unify cmake test code into a single macro
This makes the test code a lot easier to manage rather than copying &
pasting the same boiler plate multiple times.

Also take the opportunity to add a common prefix to each test name so
we don't get collisions between subdirs if a test happens to use the
same exact name.
2016-04-30 21:02:45 -04:00
Wangkun 917fa11bfb fix CMake error when ENABLE_WEBP 2015-05-07 17:48:37 +08:00
Nathanael Jones f82b371418 Add libiconv support to CMake files 2014-10-02 14:59:29 -04:00
Ondřej Surý ecc1e367df Update copyrights in cmake/modules/ 2013-05-13 12:48:13 +02:00
Ondřej Surý 0d7f125fd4 Make distcheck work (fixes #54) 2013-05-04 22:23:38 +02:00
Pierre Joye ad4461b260 improve/fix vpx detection 2013-04-24 07:49:26 +02:00
Pierre Joye f0de1e0087 add missing cmake module 2013-04-21 00:22:17 +02:00
Pierre Joye a600472e8f update local find* and add missing 2013-04-18 22:56:52 +02:00
Pierre Joye bdf7aa025b update local find* and add missing 2013-04-18 22:55:48 +02:00
Pierre Joye a235262834 init this var to avoid configure error if not found 2013-04-12 00:36:22 +02:00
Ondřej Surý ac6222f945 Merge outstanding autotools changes 2013-04-08 09:12:06 +02:00
Pierre Joye 0c21e2cfc1 backport php's gd webp support 2013-04-04 22:24:57 +02:00
pierrejoye e20413bf6b - apply same CS everywhere 2013-04-03 14:23:11 +02:00
Takeshi Abe 385566e4ba emit position-independent code for linking it to the shared library
Background: when linking libimagequant built in the source tree on my machine
(Debian wheezy amd64 / gcc 4.7.2), I got the following message.

> [ 36%] Building C object src/CMakeFiles/gd.dir/gdhelpers.c.o
> [ 37%] Building C object src/CMakeFiles/gd.dir/gdkanji.c.o
> [ 38%] Building C object src/CMakeFiles/gd.dir/gdtables.c.o
> [ 39%] Building C object src/CMakeFiles/gd.dir/gdxpm.c.o
> [ 40%] Building C object src/CMakeFiles/gd.dir/wbmp.c.o
> Linking CXX shared library libgd.so
> /usr/bin/ld: ../libimagequant/libimagequant.a(libimagequant.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
> ../libimagequant/libimagequant.a: could not read symbols: Bad value
> collect2: error: ld returned 1 exit status
> make[2]: *** [src/libgd.so] Error 1
> make[1]: *** [src/CMakeFiles/gd.dir/all] Error 2
> make: *** [all] Error 2
2013-03-29 11:10:58 +09:00
Kornel Lesiński 03a41b1ad2 Use cmake external project only if cmake version is new enough
--HG--
extra : rebase_source : 13014b78f6d6e58279ada75bd3d4ed009158b183
2013-03-27 19:41:21 +00:00
Takeshi Abe f26dffb68b fix out-of-source build 2013-03-27 21:12:10 +09:00
Kornel Lesiński cfa23367ad Download libimagequant in cmakefile if needed
--HG--
branch : liq
extra : source : de3e993342bc3d4eefe4b638143a7657e0aafe62
extra : histedit_source : 961d951975c5df5b9da5848ce2b04777a2156890%2C12013ded8ac6e49f8af6e757daa1aad8299d3e65
2013-03-25 23:46:54 +00:00
Takeshi Abe e204de524b import FindFontConfig.cmake
from <http://freetype-gl.googlecode.com/svn-history/r110/trunk/CMakeModules/FindFontConfig.cmake>

This replaces old FindFontconfig.cmake using obsolete UsePkgConfig.
2013-02-22 10:44:28 +09:00
pajoye e1303aa42c - add cmake's Makefile.am (dist) 2008-05-10 20:23:12 +00:00