12 Commits

Author SHA1 Message Date
Cosmin Truta
acfd50ae0b cmake: Clean up functions, string operations, regular expressions, etc.
Remove the inclusion of the external module `CMakeParseArguments`.
Function argument parsing became a first-class feature in CMake 3.5.

Delete the function `find_symbol_prefix`. It is no longer used.

Use variables instead of strings in string operations where possible.
Prevent CMake from getting confused by string values that might be
accidentally identical to unrelated keywords.

Clean up spurious `.*` sequences in regex matching operations.

Rephrase a comment.
2023-12-11 20:51:06 +02:00
Jon Creighton
cd0ea2a7f5 Fix for universal binaries on macOS
Fix the issue of a
    clang: error: no such file or directory: 'x86_64'
error on building universal binaries on macOS.

It is also necessary to specify:
    -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"

Example CMake command:
    cmake -S libpng \
          -B build_libpng \
          -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
          -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-01-09 19:55:04 +02:00
Felix Hanau
04c016d79f scripts: Fix the remaining instance of ZLIB_INCLUDE_DIR 2022-10-23 23:10:07 +03:00
David Capello
319a7b842b Fix genout compilation when CMAKE_OSX_ARCHITECTURES isn't specified 2016-05-04 11:30:43 -03:00
Glenn Randers-Pehrson
f962ee9dc6 Merge branch 'fix-pnglibconf-on-osx' of git://github.com/aseprite/libpng into libpng16 2016-05-01 19:04:25 -05:00
Glenn Randers-Pehrson
a271625928 Merge branch 'fix-genout-with-multiple-zlib-inc-dirs' of git://github.com/aseprite/libpng into libpng16 2016-05-01 19:03:46 -05:00
David Capello
d960ced6e1 Fix pnglibconf.c compilation on OS X including the sysroot path
Without these flags pnglibconf.c compilation fails because it
includes zlib.h -> zconf.h -> sys/types.h which is not found until we
give a correct SDK path with -isysroot flag.
2016-03-31 17:41:16 -03:00
David Capello
7cf9a34ade Fix CMAKE_C_FLAGS with multiple values when genout is compiled on MSVC
Without this patch, CMAKE_C_FLAGS will be processed as a
string/filename on MSVC (e.g. when CMAKE_C_FLAGS is equal
to " /D_WIN32 /D_WINDOWS /W3") and the whole compilation fails.
2016-03-31 14:28:45 -03:00
David Capello
5ef8d1bfbf Add support to use multiple directories in ZLIBINCDIR variable
For example, ZLIB_INCLUDE_DIR might include the directory where zlib.h
is located (source dir) and the zconf.h file is located (binary dir).
2016-03-31 14:18:27 -03:00
Glenn Randers-Pehrson
0348a407e5 [libpng16] Add ${INCLUDES} in scripts/genout.cmake.in (Bug report by Nixon Kwok). 2016-02-16 14:38:28 -06:00
Glenn Randers-Pehrson
2a28a4320a [libpng16] Update copyright information in cmake scripts. 2016-01-29 09:14:41 -06:00
Roger Leigh
74e481c743 [libpng16] Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in
and test.cmake.in
2016-01-28 15:58:45 -06:00