Skip to content

Add Conan 2 package support#1

Open
RobbieG15 wants to merge 1 commit into
mainfrom
codex/add-conan2-package-support-and-test
Open

Add Conan 2 package support#1
RobbieG15 wants to merge 1 commit into
mainfrom
codex/add-conan2-package-support-and-test

Conversation

@RobbieG15
Copy link
Copy Markdown
Owner

Motivation

  • Provide a Conan 2 recipe and CMake packaging so the library can be consumed as a Conan package and by CMake consumers via an exported nmea::nmea target.
  • Modernize the build to install headers, targets, config/version files, and license metadata so downstream packaging and integration are straightforward.
  • Ensure public headers include fixed-width integer headers so installed consumers do not get compilation errors.

Description

  • Add conanfile.py that uses cmake_layout(), supports shared/fPIC options, builds with CMake, runs cmake.install(), and exposes cmake_file_name/cmake_target_name (exports nmea::nmea).
  • Modernize CMakeLists.txt to a newer CMake policy: create an aliased target nmea::nmea, set cxx_std_11, add installation rules for library, headers, license, and export nmeaTargets.cmake plus generated nmeaConfig.cmake/nmeaConfigVersion.cmake.
  • Add cmake/nmeaConfig.cmake.in to include the exported targets when installed.
  • Add a Conan-style test_package (with test_package/conanfile.py, test_package/CMakeLists.txt, and test_package/src/test_package.cpp) that links nmea::nmea and validates/parses a sample GGA sentence.
  • Add explicit #include <stdint.h> to public headers that expose uint8_t/uint16_t types so consumers compiling installed headers have the required definitions.

Testing

  • python3 -m py_compile conanfile.py test_package/conanfile.py succeeded to validate the Conan recipe syntax.
  • Full CMake build/install and consumer test sequence cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build && cmake --install build --prefix /tmp/nmea-install && cmake -S test_package -B build-test -DCMAKE_PREFIX_PATH=/tmp/nmea-install && cmake --build build-test && ./build-test/test_package succeeded and printed the expected test output.
  • Shared-library build cmake -S . -B build-shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && cmake --build build-shared succeeded.
  • conan --version could not be run because Conan is not installed in the environment, and attempting python3 -m pip install --user 'conan>=2,<3' failed due to the environment network proxy (403 Forbidden).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant