palmerc / jpeg-cmake

IJG's libjpeg with CMake support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IJG's libjpeg (with CMake)

Current Version: libjpeg 9d (9.4.0)

Usage

This project provides drop-in CMake support for the IJG's JPEG library. Simply run CMake as normal:

mkdir build/
cd build/
cmake ..
make

Alternatively, the important CMake files can be copied to any libjpeg source directory:

cp resources/* ~/jpeg-9d/
cd ~/jpeg-9d/
mkdir build/
cd build/
cmake ..
make

Updating libjpeg

# Delete the contents of the libjpeg subdirectory
cd libjpeg/
rm -rf *

# Copy the source files for libjpeg into the libjpeg subdirectory
cp -a ~/jpeg-9d/ .

# Rerun the CMake build process
cd ../build/
cmake .
make

Advanced Configuration

Shared and Static Libraries

jpeg-cmake emulates the behavior of libjpeg and compiles both static and shared libraries by default. Selective compilation of shared and static libraries can be controlled with the BUILD_<SHARED|STATIC>_LIBS CMake flags:

cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON ..

Utilities

The libjpeg utility programs are built by default. To disable compilation of these tools, set the BUILD_EXECUTABLES flag:

cmake -DBUILD_EXECUTABLES=OFF ..

By default, executables are linked against the shared libraries. If static libraries are enabled, executables can optionally be linked statically by using the LINK_STATIC flag:

cmake -DLINK_STATIC=ON ..

Tests

The libjpeg test targets are generated by default whenever BUILD_EXECUTABLES is enabled. They can be run using the test target:

cmake ..
make
make test

To disable test generation, set the BUILD_TESTS flag:

cmake -DBUILD_TESTS=OFF ..

Customize jconfig.h

libjpeg provides extensive build customization through modification of jconfig.h. To ease this process, jpeg-cmake provides many of these customization options as CMake flags. For example:

cmake -DGIF_SUPPORTED=OFF -DPROGRESS_REPORT=ON ..

See resources/ConfigureJConfig.cmake for a complete list of flags and their descriptions.

About

IJG's libjpeg with CMake support


Languages

Language:C 75.2%Language:Shell 17.1%Language:Makefile 2.3%Language:Roff 1.7%Language:SAS 0.6%Language:WebAssembly 0.6%Language:Module Management System 0.6%Language:CMake 0.6%Language:M4 0.5%Language:Assembly 0.4%Language:Smalltalk 0.3%Language:StringTemplate 0.2%