Installation ============ Building from Source --------------------- Prerequisites ~~~~~~~~~~~~~ To build libserial from source, you'll need: * CMake (version 3.10 or higher) * A C++17 compatible compiler (GCC 5.4+ or Clang 3.4+) * Git (for cloning the repository) For documentation generation (optional): * Doxygen * Python 3.6+ * Sphinx * sphinx-rtd-theme * breathe Building the Library ~~~~~~~~~~~~~~~~~~~~ 1. Clone the repository: .. code-block:: bash git clone https://github.com/NestorDP/cppserial.git cd cppserial 2. Create a build directory: .. code-block:: bash mkdir build cd build 3. Configure the build: .. code-block:: bash cmake .. 4. Build the library: .. code-block:: bash make 5. Install the library (optional): .. code-block:: bash sudo make install Using CMake Options ~~~~~~~~~~~~~~~~~~~ You can customize the build with various CMake options: .. code-block:: bash # Build in Release mode (optimized) cmake -DCMAKE_BUILD_TYPE=Release .. # Install to a custom location cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. # Enable testing cmake -DBUILD_TESTING=ON .. # Enable coverage reports cmake -DENABLE_COVERAGE=ON .. # Enable documentation generation cmake -DBUILD_DOCUMENTATION=ON .. .. Package Installation .. -------------------- .. Ubuntu/Debian .. ~~~~~~~~~~~~~ .. .. code-block:: bash .. sudo apt update .. sudo apt install libserial-dev .. (Note: Package availability depends on your distribution) .. From Binary Releases .. ~~~~~~~~~~~~~~~~~~~~~ .. Download the latest release from the `GitHub releases page `_ and follow the installation instructions provided with the release. Verifying Installation ---------------------- To verify that cppserial is installed correctly, create a simple test program: .. code-block:: cpp #include #include int main() { std::cout << "libserial is installed!" << std::endl; return 0; } Compile and run: .. code-block:: bash g++ -std=c++17 test.cpp -lserial -o test ./test