Skip to content

Commit 68663f3

Browse files
csparker247claude
andauthored
(v10.0.0) jpeg-10 (#5)
* Update to libjpeg 10 * Tweak CMake version range * Modernize GitHub Actions workflow - Replace deprecated OS images (macos-11, macos-12, ubuntu-20.04) with current ones; add Windows 2022, macOS 13/14/15/26, Ubuntu 24.04 - Switch from apt/brew CMake installs to lukka/get-cmake for consistent version control across all platforms - Add cmake-compat job testing CMake 3.5.2 through latest on ubuntu-22.04, with version-conditional --parallel and cmake --install fallbacks - Replace deprecated cmake --find-package with inline temp-project find_package verification - Upgrade actions/checkout@v2 to @v4 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add CMake options for VOID_IS_CHAR and CONST_IS_EMPTY Complete CMake interface coverage for all jconfig.h symbols by implementing VOID_IS_CHAR and CONST_IS_EMPTY as cache options with proper #cmakedefine blocks in jconfig.h.in, replacing previous "NOT IMPLEMENTED" placeholders. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix cmake-compat CI failures for CMake 3.5.2 and 3.10.3 Install libidn11 so old CMake binaries can execute on ubuntu-22.04. Use old-style cmake invocation (cd + positional source arg) for versions < 3.13, which lack the -S/-B flags. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Only install libidn11 on CMake 3.5.x * gh: Fix startsWith syntax * gh: Try to get a non-broken CMake 3.5.x * gh: Restore libidn and manually link the so * gh: Try to add the correct LD path --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c3dc261 commit 68663f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8363
-4287
lines changed

.github/workflows/build-and-test.yml

Lines changed: 202 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,212 @@ env:
66
BUILD_TYPE: Release
77

88
jobs:
9+
910
build:
11+
name: Build / ${{ matrix.os }}
1012
runs-on: ${{ matrix.os }}
1113
strategy:
1214
fail-fast: false
1315
matrix:
14-
os: [macos-11, macos-12, ubuntu-20.04, ubuntu-22.04]
16+
os:
17+
- ubuntu-22.04
18+
- ubuntu-24.04
19+
- macos-14
20+
- macos-15
21+
- macos-26
22+
- windows-2022
1523

1624
steps:
17-
- uses: actions/checkout@v2
18-
19-
- name: Setup Ubuntu
20-
if: startsWith(matrix.os, 'ubuntu')
21-
run: |
22-
sudo apt-get update
23-
sudo apt-get install -y cmake
24-
25-
- name: Setup macOS
26-
if: startsWith(matrix.os, 'macos')
27-
run: |
28-
sudo xcode-select -s /Library/Developer/CommandLineTools/
29-
sudo rm -rf /Library/Frameworks/Mono.framework
30-
brew install cmake
31-
32-
- name: Configure CMake
33-
shell: bash
34-
run: |
35-
cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build \
36-
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
37-
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
38-
39-
- name: Build
40-
shell: bash
41-
# Execute the build. You can specify a specific target with "--target <NAME>"
42-
run: cmake --build ${{runner.workspace}}/build --config $BUILD_TYPE
43-
44-
- name: Test libjpeg
45-
working-directory: ${{runner.workspace}}/build
46-
shell: bash
47-
run: ctest -V -C $BUILD_TYPE
48-
49-
- name: Test install
50-
shell: bash
51-
run: |
52-
cmake --install ${{runner.workspace}}/build --config $BUILD_TYPE
53-
RESULT=$(cmake --find-package -DNAME=JPEG \
54-
-DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE \
55-
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/install | awk '{$1=$1};1')
56-
[[ "$RESULT" != "-I${{runner.workspace}}/install/include" ]] && { echo "libjpeg not found or found at unexpected location: ${RESULT}" ; exit 1; }
57-
exit 0
58-
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up CMake (latest)
29+
uses: lukka/get-cmake@latest
30+
with:
31+
cmakeVersion: latest
32+
33+
- name: Configure CMake (Unix)
34+
if: runner.os != 'Windows'
35+
shell: bash
36+
run: |
37+
cmake -S "$GITHUB_WORKSPACE" \
38+
-B "${{ runner.workspace }}/build" \
39+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
40+
-DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/install"
41+
42+
- name: Configure CMake (Windows)
43+
if: runner.os == 'Windows'
44+
shell: pwsh
45+
run: |
46+
cmake -S "$env:GITHUB_WORKSPACE" `
47+
-B "${{ runner.workspace }}\build" `
48+
-DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}\install" `
49+
-DBUILD_TESTS=OFF
50+
51+
- name: Build
52+
shell: bash
53+
run: |
54+
cmake --build "${{ runner.workspace }}/build" \
55+
--config ${{ env.BUILD_TYPE }} --parallel
56+
57+
- name: Test libjpeg (Unix only)
58+
if: runner.os != 'Windows'
59+
shell: bash
60+
working-directory: ${{ runner.workspace }}/build
61+
run: ctest -V -C ${{ env.BUILD_TYPE }}
62+
63+
- name: Install
64+
shell: bash
65+
run: |
66+
cmake --install "${{ runner.workspace }}/build" --config ${{ env.BUILD_TYPE }}
67+
68+
- name: Test install via find_package (Unix)
69+
if: runner.os != 'Windows'
70+
shell: bash
71+
run: |
72+
TESTDIR=$(mktemp -d)
73+
cat > "${TESTDIR}/CMakeLists.txt" <<'ENDCMAKE'
74+
cmake_minimum_required(VERSION 3.5)
75+
project(jpeg_find_test C)
76+
find_package(JPEG REQUIRED)
77+
if(NOT JPEG_FOUND)
78+
message(FATAL_ERROR "JPEG package not found at install prefix")
79+
endif()
80+
message(STATUS "JPEG_INCLUDE_DIRS: ${JPEG_INCLUDE_DIRS}")
81+
message(STATUS "JPEG_LIBRARIES: ${JPEG_LIBRARIES}")
82+
ENDCMAKE
83+
cmake -S "${TESTDIR}" \
84+
-B "${TESTDIR}/build" \
85+
-DCMAKE_PREFIX_PATH="${{ runner.workspace }}/install"
86+
87+
- name: Test install via find_package (Windows)
88+
if: runner.os == 'Windows'
89+
shell: pwsh
90+
run: |
91+
$testdir = Join-Path $env:RUNNER_TEMP "jpeg_find_test"
92+
New-Item -ItemType Directory -Force -Path $testdir | Out-Null
93+
Set-Content -Path "$testdir\CMakeLists.txt" -Value @'
94+
cmake_minimum_required(VERSION 3.5)
95+
project(jpeg_find_test C)
96+
find_package(JPEG REQUIRED)
97+
if(NOT JPEG_FOUND)
98+
message(FATAL_ERROR "JPEG package not found at install prefix")
99+
endif()
100+
message(STATUS "JPEG_INCLUDE_DIRS: ${JPEG_INCLUDE_DIRS}")
101+
message(STATUS "JPEG_LIBRARIES: ${JPEG_LIBRARIES}")
102+
'@
103+
cmake -S "$testdir" `
104+
-B "$testdir\build" `
105+
-DCMAKE_PREFIX_PATH="${{ runner.workspace }}\install"
106+
107+
cmake-compat:
108+
name: CMake ${{ matrix.cmake-version }}
109+
runs-on: ubuntu-22.04
110+
strategy:
111+
fail-fast: false
112+
matrix:
113+
cmake-version:
114+
- "3.5.2"
115+
- "3.10.3"
116+
- "3.15.7"
117+
- "3.21.7"
118+
- "3.28.6"
119+
- "latest"
120+
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@v4
124+
125+
- name: Set up CMake ${{ matrix.cmake-version }}
126+
uses: lukka/get-cmake@latest
127+
with:
128+
cmakeVersion: ${{ matrix.cmake-version }}
129+
130+
- name: Install libidn11 (required by old CMake binaries)
131+
if: ${{ startsWith( matrix.cmake-version, '3.5.' ) }}
132+
run: |
133+
sudo apt-get install -y libidn12
134+
sudo ln -sf /usr/lib/x86_64-linux-gnu/libidn.so.12 /usr/lib/x86_64-linux-gnu/libidn.so.11
135+
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
136+
137+
- name: Show CMake version
138+
run: cmake --version
139+
140+
- name: Configure CMake
141+
shell: bash
142+
run: |
143+
CMAKE_VER=$(cmake --version | awk 'NR==1{print $3}')
144+
MAJOR=$(echo "$CMAKE_VER" | cut -d. -f1)
145+
MINOR=$(echo "$CMAKE_VER" | cut -d. -f2)
146+
if [ "$MAJOR" -gt 3 ] || { [ "$MAJOR" -eq 3 ] && [ "$MINOR" -ge 13 ]; }; then
147+
cmake -S "$GITHUB_WORKSPACE" \
148+
-B "${{ runner.workspace }}/build" \
149+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
150+
-DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/install"
151+
else
152+
mkdir -p "${{ runner.workspace }}/build"
153+
cd "${{ runner.workspace }}/build"
154+
cmake "$GITHUB_WORKSPACE" \
155+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
156+
-DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/install"
157+
fi
158+
159+
- name: Build
160+
shell: bash
161+
run: |
162+
CMAKE_VER=$(cmake --version | awk 'NR==1{print $3}')
163+
MAJOR=$(echo "$CMAKE_VER" | cut -d. -f1)
164+
MINOR=$(echo "$CMAKE_VER" | cut -d. -f2)
165+
if [ "$MAJOR" -gt 3 ] || { [ "$MAJOR" -eq 3 ] && [ "$MINOR" -ge 12 ]; }; then
166+
cmake --build "${{ runner.workspace }}/build" \
167+
--config ${{ env.BUILD_TYPE }} --parallel
168+
else
169+
cmake --build "${{ runner.workspace }}/build" \
170+
--config ${{ env.BUILD_TYPE }}
171+
fi
172+
173+
- name: Test libjpeg
174+
shell: bash
175+
working-directory: ${{ runner.workspace }}/build
176+
run: ctest -V -C ${{ env.BUILD_TYPE }}
177+
178+
- name: Install
179+
shell: bash
180+
run: |
181+
CMAKE_VER=$(cmake --version | awk 'NR==1{print $3}')
182+
MAJOR=$(echo "$CMAKE_VER" | cut -d. -f1)
183+
MINOR=$(echo "$CMAKE_VER" | cut -d. -f2)
184+
if [ "$MAJOR" -gt 3 ] || { [ "$MAJOR" -eq 3 ] && [ "$MINOR" -ge 15 ]; }; then
185+
cmake --install "${{ runner.workspace }}/build" --config ${{ env.BUILD_TYPE }}
186+
else
187+
cmake --build "${{ runner.workspace }}/build" \
188+
--config ${{ env.BUILD_TYPE }} --target install
189+
fi
190+
191+
- name: Test install via find_package
192+
shell: bash
193+
run: |
194+
TESTDIR=$(mktemp -d)
195+
cat > "${TESTDIR}/CMakeLists.txt" <<'ENDCMAKE'
196+
cmake_minimum_required(VERSION 3.5)
197+
project(jpeg_find_test C)
198+
find_package(JPEG REQUIRED)
199+
if(NOT JPEG_FOUND)
200+
message(FATAL_ERROR "JPEG package not found at install prefix")
201+
endif()
202+
message(STATUS "JPEG_INCLUDE_DIRS: ${JPEG_INCLUDE_DIRS}")
203+
message(STATUS "JPEG_LIBRARIES: ${JPEG_LIBRARIES}")
204+
ENDCMAKE
205+
CMAKE_VER=$(cmake --version | awk 'NR==1{print $3}')
206+
MAJOR=$(echo "$CMAKE_VER" | cut -d. -f1)
207+
MINOR=$(echo "$CMAKE_VER" | cut -d. -f2)
208+
if [ "$MAJOR" -gt 3 ] || { [ "$MAJOR" -eq 3 ] && [ "$MINOR" -ge 13 ]; }; then
209+
cmake -S "${TESTDIR}" \
210+
-B "${TESTDIR}/build" \
211+
-DCMAKE_PREFIX_PATH="${{ runner.workspace }}/install"
212+
else
213+
mkdir -p "${TESTDIR}/build"
214+
cd "${TESTDIR}/build"
215+
cmake "${TESTDIR}" \
216+
-DCMAKE_PREFIX_PATH="${{ runner.workspace }}/install"
217+
fi

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
cmake_minimum_required(VERSION 3.5)
2-
project(jpeg-cmake VERSION 1.3.0)
1+
cmake_minimum_required(VERSION 3.5...4.2)
2+
project(jpeg-cmake VERSION 10.0.0)
33

44
# Use configure_file insted of file(COPY)
55
# to ensure files are updated in src directory

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# IJG's libjpeg (with CMake)
2-
Current Version: `libjpeg 9f (9.6.0)`
2+
Current Version: `libjpeg 10 (10.0.0)`
33

44
## Usage
55
This project provides drop-in CMake support for the IJG's JPEG library.
@@ -13,9 +13,9 @@ cmake --build build/
1313
Alternatively, the important CMake files can be copied to any `libjpeg`
1414
source directory:
1515
```Shell
16-
cp resources/* ~/jpeg-9f/
17-
cmake -S ~/jpeg-9f/ -B ~/jpeg-9f/build/
18-
cmake --build ~/jpeg-9f/build/
16+
cp resources/* ~/jpeg-10/
17+
cmake -S ~/jpeg-10/ -B ~/jpeg-10/build/
18+
cmake --build ~/jpeg-10/build/
1919
```
2020

2121
## Updating libjpeg
@@ -24,7 +24,7 @@ cmake --build ~/jpeg-9f/build/
2424
rm -rf libjpeg/*
2525

2626
# Copy the source files for libjpeg into the libjpeg subdirectory
27-
cp -a ~/jpeg-9f/ libjpeg/
27+
cp -a ~/jpeg-10/ libjpeg/
2828

2929
# Rerun the CMake build process
3030
cmake --build build/
@@ -103,3 +103,9 @@ cmake -DGIF_SUPPORTED=OFF -DPROGRESS_REPORT=ON ..
103103

104104
See [`resources/ConfigureJConfig.cmake`](resources/ConfigureJConfig.cmake) for
105105
a complete list of flags and their descriptions.
106+
107+
## Project Versioning Scheme
108+
Prior to `libjpeg 10`, this CMake project used an independent versioning scheme based
109+
only on changes to the CMake configuration. Going forward, this project's `major.minor`
110+
versions will be taken from the `libjpeg` release. The `patch` version will
111+
indicate bug fixes and feature additions in the CMake project.

libjpeg/Makefile.am

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
3535
# Makefiles for various systems
3636
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.xc \
3737
makefile.bcc makefile.b32 makefile.c32 makefile.d32 makefile.x32 \
38-
makefile.b64 makefile.mc6 makefile.dj makefile.wat makefile.vc \
39-
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
40-
makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
41-
makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
42-
makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
43-
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
44-
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
45-
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
46-
makajpeg.bcb makcjpeg.bcb makdjpeg.bcb makljpeg.bcb makrjpeg.bcb \
47-
maktjpeg.bcb makwjpeg.bcb makcjpeg.st makdjpeg.st makljpeg.st \
48-
maktjpeg.st makeproj.mac makefile.manx makefile.sas makefile.mms \
49-
makefile.vms makvms.opt
38+
makefile.b64 makefile.x64 makefile.mc6 makefile.dj makefile.wat \
39+
makefile.vc makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 \
40+
makejdsp.vc6 makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 \
41+
makeddep.vc6 makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 \
42+
maketmak.vc6 makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 \
43+
makewdsp.vc6 makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 \
44+
makejfil.v16 makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 \
45+
maketvcx.v16 maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 \
46+
makewfil.v16 makajpeg.bcb makcjpeg.bcb makdjpeg.bcb makljpeg.bcb \
47+
makrjpeg.bcb maktjpeg.bcb makwjpeg.bcb makcjpeg.st makdjpeg.st \
48+
makljpeg.st maktjpeg.st makeproj.mac makefile.manx makefile.sas \
49+
makefile.mms makefile.vms makvms.opt
5050

5151
# Configuration files
5252
CONFIGFILES= jconfig.cfg jconfig.xc jconfig.bcc jconfig.mc6 jconfig.dj \

0 commit comments

Comments
 (0)