How to download and install cmake (latest version) in ubuntu

1>Download cmake form https://cmake.org/download/

Download the (for example) this .sh file

Linux x86_64cmake-4.4.2-linux-x86_64.sh
cmake-4.4.2-linux-x86_64.tar.gz
Linux aarch64cmake-4.4.2-linux-aarch64.sh
cmake-4.4.2-linux-aarch64.tar.gz

Based on you PC 

2> make that file executable using 
chmod +x <your cmake downloaded file>

3> Run command (for example)
sudo ./cmake-4.4.2-linux-x86_64.sh --prefix=/usr/local

How to install libwebsocket form git? (discussion with gemenie)

Installing libwebsockets (LWS) directly from GitHub uses standard CMake.

Step-by-Step Installation (Linux / macOS)

1. Install System Dependencies

LWS requires cmake, gcc/g++ (or clang), and SSL headers (OpenSSL/WolfSSL).

  • Ubuntu / Debian:

    Bash
    sudo apt update
    sudo apt install -y git cmake build-essential libssl-dev zlib1g-dev
    
  • Fedora / RHEL / CentOS:

    Bash
    sudo dnf install -y git cmake gcc gcc-c++ openssl-devel zlib-devel
    
  • macOS (Homebrew):

    Bash
    brew install git cmake openssl zlib
    

2. Clone the Official Repository

Clone the repository and check out a stable release tag (recommended over main for production reliability):

Bash
# Clone the repository
git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets

# (Optional) Checkout a stable release tag
git checkout v4.3-stable

3. Build and Install via CMake

LWS requires an out-of-source build directory:

Bash
# Create and enter build directory
mkdir build && cd build

# Configure build files
cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=/usr/local \
  -DLWS_WITH_SSL=ON \
  -DLWS_WITH_HTTP2=ON

# Compile using all CPU cores
make -j$(nproc)

# Install system-wide
sudo make install

# Refresh shared library link cache (Linux)
sudo ldconfig

Key CMake Options (Customizing Your Build)

You can pass extra flags to cmake .. depending on your requirements:

FlagDefaultDescription
-DLWS_WITH_SSL=ONONEnables OpenSSL/TLS support.
-DLWS_WITH_HTTP2=ONONEnables HTTP/2 protocol support.
-DLWS_WITH_MINIMAL_EXAMPLES=ONOFFBuilds sample client/server code in the build folder.
-DLWS_MAX_SMP=81 / AutoSets maximum SMP thread count for multi-threaded service loops.
-DCMAKE_INSTALL_PREFIX=/usr/usr/localChanges the default installation target directory.

Verifying the Installation

To verify your installation, create a minimal C test file (test.c):

C
#include <libwebsockets.h>
#include <stdio.h>

int main() {
    printf("LWS Version: %s\n", lws_get_library_version());
    return 0;
}
Compile and run it:
Bash
gcc test.c -o test -lwebsockets
./test

Regarding site Free Browser Tool (https://free-browser-tools.mohitkrgupta.dev) (discussion with google search AI)

Various discussions with Google Search AI regarding site  Free Browser Tool are as below: site free-browser-tools.mohitkrgupta.dev what doe...