Conversation
Build and install static or shared libserialport targets on the supported platforms, mirror the autotools feature checks, generate baudrates without a shell, and provide examples, CTest, package exports, and Linux/macOS/Windows CI. Signed-off-by: Chris Parker <chris.parker@polarissensor.com>
Signed-off-by: Chris Parker <chris.parker@polarissensor.com>
|
Fork CI completed successfully for all six CMake configurations (Linux, macOS, and Windows; static and shared): https://github.com/csp256/libserialport/actions/runs/33573598516 |
|
I'm going to hold off on this just a little bit, not because I think it's wrong (on the contrary), it just will conflict with some local pending work I have. |
|
Hi, I have refactored and forward-ported your changes to the best of my ability (I'm not very familiar with cmake yet.) Would you be willing to see if the current master branch works as expected for you? |
|
I should have said: it is on the branch cmake-support at the moment. |
|
I'm finally back in the office after a long weekend. Will investigate today. |
|
It works on Mac, Ubuntu, and Windows. Made a few changes on https://github.com/csp256/libserialport/tree/cmake-support-followups CI was only testing in Release, so the asserts were compiled out. I added that back in. This revealed that in test_timing.c:45–46 the timing bounds are too tight, because the thread still has to be scheduled after a 1 second sleep. I didn't change this. I made it omit CMAKE_BUILD_TYPE on Windows to suppress an expected warning. Mac's handling of version metadata is different, so I changed it. This resulted in bumping CMake minimum to 3.17 I also install relocatable |
|
Looks like this got pushed into main, so I'll close. |
Summary
FreeBSD, and generic POSIX systems
config.handbaudrates.hwithout requiring a shelladd_subdirectory(), and an installedlibserialport::libserialportpackage targetsemantics for MSVC consumers
tests, examples, installation, and an installed-package consumer
Fixes #5.
Local validation
On Windows x64 with Visual Studio 2022/MSVC, both static and shared
configurations built the library and all six examples, passed the timing CTest,
installed successfully, and built an external consumer through
find_package(libserialport CONFIG).The GitHub Actions matrix provides the corresponding Linux, macOS, and Windows
validation for this branch.
AI assistance disclosure
I used an AI coding assistant to adapt the existing build requirements and help
prepare the CI/package tests. I reviewed the changes and performed the Windows
validation described above.