Skip to main content

Automate setup of CMake projects

Project description

Auto CMake

Automate setup of CMake projects for large C & C++ projects on all platforms: Windows, MacOS, Linux, Android, iOS and Bare-Metal

  • Automatically indexes .c, .h, .cpp, .hpp files and creates entries in CMakeLists.txt
  • Automatically generates CMakeLists.txt for subdirectories and create library entries in CMakeLists.txt
  • Automatically configures XCode projects with header, source and library paths
  • Automatically configures Android projects with header, source and library paths

Contents

1) auto_cmake......................Source
   1.1) resources..................CMake Toolchain Files
2) scripts ........................Deployment Scripts
3) tests...........................Unit Tests for Windows, MacOS, Linux, Android, iOS and Bare-Metal
   3.1) resources .................Sample
      3.1.1) sample_c_proj.........Generic Project to Validate Compilation on PC via Unit Tests
      3.1.2) sample_android_proj...Project to Validate Compilation on Android via Unit Tests
      3.1.3) sample_xcode_proj.....Project to Validate Compilation on iOS via Unit Tests

Sample Usage

Steps:

  1. Download auto-cmake from: https://pypi.org/project/auto-cmake/
  2. In your project define a auto cmake script (sample below)
  3. This file defines (among other things):
    1. The project name and version
    2. Directories and paths to include and exclude
    3. Compiler flags
    4. Build directory
  4. Run the script to generate the CMake project
import os
import unittest

from auto_cmake.auto_cmake_exe import AutoCMakeExe

# Source paths
proj_dir = os.path.abspath(os.path.join(os.getcwd(), "resources", "sample_c_proj"))
build_dir = os.path.abspath(os.path.join(proj_dir, "build"))

# Configuration
cmake_config = dict()
cmake_config['proj_name'] = 'sample_c_proj'
cmake_config['proj_dir'] = proj_dir
cmake_config['version'] = "2024.03.08"
cmake_config['cmake_version'] = '3.15'
cmake_config['include_dirs'] = [proj_dir]
cmake_config['libs'] = []
cmake_config['flags'] = ["FLAG_DEMO"]
cmake_config['exclude_dirs'] = []
cmake_config['exclude_paths'] = []
cmake_config['build_dir'] = build_dir

ac = AutoCMakeExe(**cmake_config)
ac.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_cmake-2024.5.1.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file auto_cmake-2024.5.1.tar.gz.

File metadata

  • Download URL: auto_cmake-2024.5.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for auto_cmake-2024.5.1.tar.gz
Algorithm Hash digest
SHA256 f24b74690e9dfdf3282b2e7a22c46064da5849aa828a9e33c6cc20cb8623db65
MD5 1c8b66ea1f41e30f5a569e1d471ba2d9
BLAKE2b-256 56e91cbe6edda0c91a99ab5316db70b1829baf86f079ba20acb360c32785da2d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page