Add Conan 2 package support#1
Open
RobbieG15 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
nmea::nmeatarget.Description
conanfile.pythat usescmake_layout(), supportsshared/fPICoptions, builds with CMake, runscmake.install(), and exposescmake_file_name/cmake_target_name(exportsnmea::nmea).CMakeLists.txtto a newer CMake policy: create an aliased targetnmea::nmea, setcxx_std_11, add installation rules for library, headers, license, and exportnmeaTargets.cmakeplus generatednmeaConfig.cmake/nmeaConfigVersion.cmake.cmake/nmeaConfig.cmake.into include the exported targets when installed.test_package(withtest_package/conanfile.py,test_package/CMakeLists.txt, andtest_package/src/test_package.cpp) that linksnmea::nmeaand validates/parses a sample GGA sentence.#include <stdint.h>to public headers that exposeuint8_t/uint16_ttypes so consumers compiling installed headers have the required definitions.Testing
python3 -m py_compile conanfile.py test_package/conanfile.pysucceeded to validate the Conan recipe syntax.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_packagesucceeded and printed the expected test output.cmake -S . -B build-shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && cmake --build build-sharedsucceeded.conan --versioncould not be run because Conan is not installed in the environment, and attemptingpython3 -m pip install --user 'conan>=2,<3'failed due to the environment network proxy (403 Forbidden).Codex Task