/cmakeopts

A set of overly reused options for CMake-based projects

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

CMakeOpts

A set of overly reused options for CMake-based projects

Usage

To set up a CMake project to use these options, follow these steps:

  1. Add this project as a submodule dependency in git:
git submodule init
git submodule add https://github.com/gabrieleara/cmakeopts.git
  1. Add the options to your main CMakeLists.txt like in the following example:
cmake_minimum_required(VERSION 3.16)

project(
    proj-name
    VERSION 0.1
    DESCRIPTION ""
    LANGUAGES CXX
)

# ...

# Include main options for CMake
include(cmakeopts/CMakeLists.txt)

# Add targets from here, using either add_executable,
# add_directory, add_library, etc.
  1. Make a symbolic link to the builder script (optional):
ln -s cmakeopts/builder.py builder.py

You can now build your project using:

./builder.py build

Note that the builder script expects to be run in a direct subdirectory of the project main directory (as set up in step 1).