Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
gcc-version: [9, 10, 11, 12, 13]
gcc-version: [11, 12, 13, 14, 15]
cmake-version: ["3.25.0"]
cmake-type: ["binary"]
runs-on: ubuntu-latest
Expand All @@ -69,11 +69,12 @@ jobs:
run: |
apt-get update && apt-get install -y -q wget python3 python3-dev libpng-dev
wget https://bootstrap.pypa.io/pip/get-pip.py && PIP_BREAK_SYSTEM_PACKAGES=1 python3 get-pip.py
pip3 install --break-system-packages --upgrade "conan<2" urllib3
conan install . --build
pip3 install --break-system-packages --upgrade "conan>=2,<3" urllib3
conan profile detect --force
conan install . --build=missing
Comment on lines 70 to +74
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job installs libpng-dev while also using Conan + CMakeDeps. Combined with find_package(PNG) (module mode), this can cause CMake to resolve PNG from the system rather than Conan, undermining the Conan 2 migration and risking mismatched dependency versions. Consider removing libpng-dev here (and relying on Conan), or force config-mode find_package(... CONFIG ...) so Conan’s packages win.

Copilot uses AI. Check for mistakes.
- name: Build P(NG)Convert
run: |
cmake .
cmake . -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
make
- name: Test P(NG)Convert
run: |
Expand All @@ -87,13 +88,14 @@ jobs:
- uses: actions/checkout@v4
- name: Build & Install Dependencies
run: |
pip3 install --upgrade "conan<2" urllib3
conan install . --build
pip3 install --upgrade "conan>=2,<3" urllib3
conan profile detect --force
conan install . --build=missing
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1.1
- name: Build P(NG)Convert
run: |
cmake . -DCMAKE_CL_64=1 -DCMAKE_GENERATOR_PLATFORM=x64 -Ax64
cmake . "-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" -DCMAKE_CL_64=1 -DCMAKE_GENERATOR_PLATFORM=x64 -Ax64
msbuild ALL_BUILD.vcxproj /P:Configuration=Release
- name: Test P(NG)Convert
run: |
Expand All @@ -102,17 +104,17 @@ jobs:
build-macos-cmake:
name: Build macOS CMake
timeout-minutes: 30
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build & Install Dependencies
run: |
export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin
pip3 install --break-system-packages --upgrade "conan>1.50.0, <2" "urllib3<1.27"
conan install . --build
pip3 install --break-system-packages --upgrade "conan>=2,<3" "urllib3<1.27"
conan profile detect --force
conan install . --build=missing
- name: Build P(NG)Convert
run: |
cmake . -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake . -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
make
- name: Test P(NG)Convert
run: |
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

*
* Migrated from Conan 1 to Conan 2 - updated generators, CMake integration, and CI workflow

### Fixed

Expand Down
20 changes: 15 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 3.0.0)
cmake_minimum_required(VERSION 3.15.0)
project(pconvert)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)

find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
Comment on lines +11 to +12
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_package(PNG)/find_package(ZLIB) without CONFIG will prefer CMake’s built-in Find modules when available, which can cause the build to link against system libraries instead of the Conan-resolved ones. To ensure Conan’s CMakeDeps packages are used consistently, use find_package(PNG CONFIG REQUIRED) and find_package(ZLIB CONFIG REQUIRED) (or set CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON).

Suggested change
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PNG CONFIG REQUIRED)
find_package(ZLIB CONFIG REQUIRED)

Copilot uses AI. Check for mistakes.
find_package(PythonLibs)

add_definitions(-DNO_PRAGMA_LIB)
Expand All @@ -12,5 +18,9 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
aux_source_directory(src/pconvert SOURCES)
add_executable(pconvert ${SOURCES})

target_include_directories(pconvert PUBLIC ${PYTHON_INCLUDE_PATH})
target_link_libraries(pconvert ${CONAN_LIBS} ${PYTHON_LIBRARY})
target_link_libraries(pconvert PNG::PNG ZLIB::ZLIB)

if(PythonLibs_FOUND)
target_include_directories(pconvert PUBLIC ${PYTHON_INCLUDE_PATH})
target_link_libraries(pconvert ${PYTHON_LIBRARY})
endif()
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-include conanbuildinfo.mak
-include conandeps.mak
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Makefile now includes conandeps.mak, but the rest of the Makefile still consumes legacy Conan 1 CONAN_* variables (CONAN_CFLAGS, CONAN_INCLUDE_DIRS, CONAN_LIBS, etc.). Conan 2’s MakeDeps generator emits a different set of variables, so simply swapping the included filename is unlikely to make Conan-based make builds pick up the right flags/paths. Update the Makefile to use the variables produced by MakeDeps (or switch generators to match the existing CONAN_* usage).

Copilot uses AI. Check for mistakes.

CC=gcc
CPP=g++
Expand Down
5 changes: 3 additions & 2 deletions conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ libpng/[>1.0]
zlib/[>1.2.0]

[generators]
make
cmake
CMakeToolchain
CMakeDeps
MakeDeps