Make CMake less painful when trying to write Modern Flexible CMake

Overview

Izzy's eXtension Modules

Buy Me a Coffee at ko-fi.com


IXM is a CMake library for writing Modern flexible CMake. This means:

  • Reducing the amount of CMake written
  • Selecting reasonable defaults
  • Supporting hooks and customization points for overriding said defaults
  • Target and Generator Expression focused operations

Donations

Donations are extremely appreciated. If you have gotten some use out of IXM, please consider donating to my ko-fi by clicking the donate link above.

Navigation

See Getting Started to begin using IXM. When you're ready, feel free to read the documentation for detailed information on IXM's API and it's internals.

Visit the Roadmap to see upcoming and in-progress features for the 1.0 release.

Comments
  • Public API calls should be located inside of Modules/API

    Public API calls should be located inside of Modules/API

    To allow users to understand what the "core" API calls for IXM are, each one should be located directly within the Modules/API directory. Currently the following commands do not meet this requirement:

    • [x] dict
    • [x] inspect
    • [x] invoke
    • [x] var (This name is unhelpful, and should be replaced)
    • [x] upvar
    • [x] genexp
    • [x] glob (Perhaps this function should be removed altogether)
    • [x] import
    • [x] module
    • [x] blueprint
    • [x] log
    • [x] parse
    • [x] print
    • [x] success
    • [x] failure
    • [x] global
    • [x] internal
    • [x] cache
    ✨ enhancement ✨ modules 🔮 critical 🚨 
    opened by bruxisma 5
  • Automatic generation of CMake exports

    Automatic generation of CMake exports

    Feature Request


    Since I can't open an issue to ask a question, I had to classify it as an enhancement.

    It would be awesome to not have to write by hand an export file for CMake libraries. The information is already provided in the CMakeLists.txt and a common pattern is to then go repeat the dependencies in the exports file.

    What is the current behavior?

    Unsure if it exists.


    Why should this be changed or added?

    Because it removes useless repetition.


    How would you implement this?

    By introspecting the properties of the targets defined under a project.


    Additional Information

    Are you willing to work on this yourself? Yes How urgent is it to have this feature? Not urgent. Is this feature request possibly out of scope for IXM? Not sure.

    ✨ enhancement ✨ good first issue 🔰 critical 🚨 
    opened by akalsi87 4
  • Rust Language Support

    Rust Language Support

    As wonderful as Rust's cargo is, not all projects are mono-lingual. It would be extremely great if a C++ or C project could link to an existing Rust project. Even better, being able to build a rust program that is then used for an add_custom_command or add_custom_target would be fantastic!

    • [ ] Toolchain Detection
    • [ ] Compiling Native Libraries
    • [ ] Cross Compiling Support
    • [ ] C and C++ integration
    • [ ] Some form of dependency tracking
    ✨ enhancement ✨ languages 💬 packages 📦 
    opened by bruxisma 4
  • Support compiling tools via a separate host toolchain

    Support compiling tools via a separate host toolchain

    Currently, when CMake is cross compiling, it sets CMAKE_CROSS_COMPILING to TRUE. This also ends up meaning we can't compile any tools for code generation or otherwise when cross compiling. This is a huge limitation. However, there is a workaround and we can wrap it up into a special add_tool() command.

    This command will perform the following steps when CMAKE_CROSS_COMPILING is ON

    • Get the current list of enabled languages.
    • For each language we
      • unset() certain variables in the current function scope.
      • set() the current CMAKE_SYSTEM_NAME into a temporary variable
      • set() the CMAKE_HOST_SYSTEM_NAME to CMAKE_SYSTEM_NAME
      • set(CMAKE_PLATFORM_INFO_DIR) to some predetermined directory
      • include(CMakeDetermine<LANG>Compiler)
      • `include(${CMAKE_PLATFORM_INFO_DIR}/CMakeCompiler.cmake)
      • set() host versions of variables
      • Set variables onto a dict() and save to disk with some sort of hash
    • Call try_compile(PROJECT) with flags that are stored in said dict() (We cannot use generator expressions 😞). The project can either be the current one, or a separate one altogether.
    • Call add_executable(name IMPORTED) and set the path to the given target.

    The above is just the tip of the iceberg. There are many MANY things that need to be taken into account, such as, but not limited to:

    • FetchContent locations
    • System Dependencies
    • Variables set by toolchain files

    This is going to be a big feature, but it is EXTREMELY useful. That said, it's low priority until everything else is stable.

    ✨ enhancement ✨ modules 🔮 tools 🛠️ 
    opened by bruxisma 3
  • Add FindSDL2.cmake

    Add FindSDL2.cmake

    SDL2 is a lovely library, but the default FindSDL2.cmake files that are out there leave a lot to be desired. There's no reason we can't provide a file to help people along the way. It should also provide support for finding the various SDL2 components, such as TTF, image, net, mixer, etc.

    ✨ enhancement ✨ packages 📦 
    opened by bruxisma 3
  • Support AppImage where possible

    Support AppImage where possible

    AppImage is a pretty incredible tool and makes distribution of applications an absolute breeze compared to other forms of installation. However, CPack does not support generating an AppImage as a packaging format. It should! And it's doable.

    ✨ enhancement ✨ modules 🔮 tools 🛠️ 
    opened by bruxisma 3
  • New bootstrap script causes severe execution failure

    New bootstrap script causes severe execution failure

    This is now possible because we generate a bootstrap script that pulls IXM down via git behind the scenes so that it will automatically update as needed. This causes TONS of incorrect output and lots of failure. For example:

    1. Color output doesn't work (but does if IXM is manually set on the command line or is used instead of the bootstrap script)
    2. aspect() calls fail (due to how they are implemented)
    3. Just a full cascade of errors I wasn't expecting.

    This NEEDS to be resolved before launch.

    🐛 bug 🐛 critical 🚨 nani ⁉ 
    opened by bruxisma 2
  • Update minimum CMake version to 3.16

    Update minimum CMake version to 3.16

    Due to issues brought on by CMake 3.16's support for Unity builds and precompiled header support, we can't keep the IXM implementation of these around. They are, unfortunately, incompatible and will break when moving between CMake versions. Thus, sadly, 3.16 will have to be the minimum version for IXM's initial alpha release :(

    modules 🔮 critical 🚨 tools 🛠️ 
    opened by bruxisma 2
  • Introduce a Task/Shell API

    Introduce a Task/Shell API

    CMake currently has a bunch of executable/shell operations builtin available via execute_process(COMMAND ${CMAKE_COMMAND} -E <command>)

    If this were abstracted, we could do some cooler things like task(ECHO_APPEND args...). This wouldn't allow us to have "futures" as it were, but it would be nice so that we could at least take advantage of the cross platform commands builtin into CMake.

    Whether this command is called task(), shell(), or even just cmake() is still TBD and needs some investigation into what feels most ergonomic.

    If we could also somehow support pipelines, that would be killer :)

    ✨ enhancement ✨ modules 🔮 
    opened by bruxisma 2
  • Reserved properties and attributes should use emoji

    Reserved properties and attributes should use emoji

    Writing emoji in build files is usually a red flag (if only that were an actual emoji...)

    CMake does not provide a proper mechanism for read only properties, thus we need to discourage users overwriting them in their build files. CMake is also byte safe, so we should be able to use emoji without issue.

    Current list of properties to place under emoji:

    • [ ] attribute() subcommands (emoji TBD)
    • [ ] Anything where we need to manually call get_property internally. (🔍 into what this entails...)
    • [ ] All IXM commands should be placed into this so that they can easily be restored if necessary.
    • [ ] Properties we keep track of
    ✨ enhancement ✨ modules 🔮 
    opened by bruxisma 2
  • `define_property` override is still needed

    `define_property` override is still needed

    Due to the recent removal of the experimental property command (which wasn't even implemented), we are still in need of a custom define_property to

    1. Keep track of defined properties (for the target_copy_properties command)
    2. Make defining properties much easier
    3. Allowing us to write some documentation in the source code before it is added to the documentation repository.
    ✨ enhancement ✨ modules 🔮 critical 🚨 
    opened by bruxisma 2
Owner
IXM
Izzy's eXtension Modules
IXM
Tutorial/Example to deal with modern cmake.

modern_cmake Tutorial/Example to deal with modern cmake. This tutorial assume that you already know how to write a CMakeLists.txt Introduction This re

Marc Schweitzer 24 Nov 14, 2022
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

CPM.cmake 1.6k Jan 9, 2023
CMake checks cache helper modules – for fast CI CMake builds!

cmake-checks-cache Cross platform CMake projects do platform introspection by the means of "Check" macros. Have a look at CMake's How To Write Platfor

Cristian Adam 65 Dec 6, 2022
CMake scripts for painless usage of SuiteSparse+METIS from Visual Studio and the rest of Windows/Linux/OSX IDEs supported by CMake

CMake scripts for painless usage of Tim Davis' SuiteSparse (CHOLMOD,UMFPACK,AMD,LDL,SPQR,...) and METIS from Visual Studio and the rest of Windows/Lin

Jose Luis Blanco-Claraco 395 Dec 24, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 39 Oct 2, 2022
cmake-avr - a cmake toolchain for AVR projects

cmake-avr - a cmake toolchain for AVR projects Testing the example provided The toolchain was created and tested within the following environment: Lin

Matthias Kleemann 163 Dec 5, 2022
CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

HPC 82 Nov 30, 2022
unmaintained - CMake module to activate certain C++ standard, feature checks and appropriate automated workarounds - basically an improved version of cmake-compile-features

Compatibility This library provides an advanced target_compile_features() and write_compiler_detection_header(). The problem with those is that they a

Jonathan Müller 74 Dec 26, 2022
[CMake] [BSD-2] CMake module to find ICU

FindICU.cmake A CMake module to find International Components for Unicode (ICU) Library Note that CMake, since its version 3.7.0, includes a FindICU m

julp 29 Nov 2, 2022
Make Lua great again

LuaLibs Lua 模块合集 • 让 Lua 再次伟大 Lua module collection · Makes Lua great again 已收录项目 项目名称 简介 开发者 Lua API 版本 是否跨平台 LuaHttpLib 阻塞式 HTTP 库 Voidmatrix 5.4.0

Voidmatrix 12 Jul 14, 2022
CMake project for BL602 RISC-V processor

bl602_cmake_base CMake project for BL602 RISC-V processor How to build NOTE : This project uses a pre-compiled version of the Buffalo SDK (bl_iot_sdk)

null 9 Jan 6, 2022
A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

Alexander Widerberg 1.4k Jan 4, 2023
curl cmake module libcurl build with msvc x86

curl-msvc Infomation curl cmake module libcurl build with MSVC10.0 arch (x86 | i386) source from https://github.com/curl/curl tags: curl-7_79_1 Usage

Jason Payne 0 May 16, 2022
NeoWorld is a resampler using the CMake build system

NeoWorld is a resampler using the CMake build system. It's designed for utsu, OpenUTAU, and UTAU.

null 5 Dec 23, 2022
A CMake addon that avoids you writing boilerplate code for resource management.

SHader INJ(I)ector SHINJI (originally SHader INJector) is a CMake addon that avoids you writing boilerplate code for resource management and exposes s

Lorenzo Rutayisire 6 Dec 14, 2022
A CMake starter template using CPM

Cmake Starter About A lightweight Cmake project meant for a binary application (not a shared library), tests with catch2 are configured, CPM is the pa

Matt Williams 1 Jul 14, 2022
Non-intrusive CMake dependency management

cmodule Non-intrusive CMake dependency management. Normally CMake's find_package() looks for packages installed on host system (and compiled for host

scapix.com 14 Sep 29, 2022
Simple library for embedding static resources into C++ binaries using CMake

libromfs libromfs is an easy way to bundle resources directly into any C++ application and access them through a simple interface. The main advantage

WerWolv 28 Nov 30, 2022
Project to enable using CMake from a Maven build.

CMake-Maven-Project Introduction A Maven project for the CMake build system. It can be used by including it as a plugin within your Maven project's po

null 60 Nov 14, 2022