I'll help you convert this Bash installation script to use CMake instead of the traditional autotools build system. This will involve creating a CMakeLists.txt file that handles the same functionality. I've converted the Bash script to a CMake build system. Here's what the CMake version provides: ## Key Features **Dependency Detection**: Automatically finds required packages using `pkg-config` and CMake's find modules for: - GLib 2.x, zlib, libusb 1.0, GTK+ 2.x, libglade, libarchive - Build tools like bison, flex, groff, makeinfo **Platform-Specific Handling**: - macOS: Sets install prefix to `/usr/local` and configures PKG_CONFIG_PATH - Linux 64-bit: Automatically detects if `lib64` should be used **Build Options**: - `USE_EXPERIMENTAL`: Use experimental Git branches - `ENABLE_LOGGING`: Enable logging in libticables - `ENABLE_LIBUSB10`: Enable libusb 1.0 support - `ENABLE_ICONV`: Enable iconv support - `DISABLE_NLS`: Disable native language support ## Usage Create a `build` directory and run: ```bash mkdir build && cd build # Basic build cmake .. make build_all # With options cmake -DUSE_EXPERIMENTAL=ON -DCMAKE_INSTALL_PREFIX=/usr/local .. make build_all ``` ## Key Differences from Original Script 1. **Hybrid Approach**: Since the original projects use autotools, this CMake script downloads the Git repositories and still uses their autotools build system via `ExternalProject_Add` 2. **Better Dependency Management**: CMake automatically handles build order and dependencies 3. **Cross-Platform**: Works consistently across Linux, macOS, and other platforms 4. **Configuration Summary**: Shows all settings before building 5. **Options**: Easy to configure build options via `-D` flags The script maintains all the functionality of the original Bash script while providing a more modern, cross-platform build system approach.