All Projects → TheLartians → PackageProject.cmake

TheLartians / PackageProject.cmake

Licence: MIT license
🏛️ Help other developers use your project. A CMake script for packaging C/C++ projects for simple project installation while employing best-practices for maximum compatibility.

Programming Languages

CMake
9771 projects
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to PackageProject.cmake

menu button
Flutter plugin to display a popup menu button widget with handsome design and easy to use.
Stars: ✭ 64 (+33.33%)
Mutual labels:  package, dependency
Projeny
A project and package manager for Unity
Stars: ✭ 656 (+1266.67%)
Mutual labels:  package, dependency
Npm Consider
Check package dependencies before installing it
Stars: ✭ 386 (+704.17%)
Mutual labels:  package, install
Mac Setup
Installing Development environment on macOS
Stars: ✭ 6,510 (+13462.5%)
Mutual labels:  install, installation
Sailboat
🐍 A quick and easy way to distribute your Python projects!
Stars: ✭ 137 (+185.42%)
Mutual labels:  package, packaging
Archfi
Arch Linux Fast Installer : tutorial installer
Stars: ✭ 2,156 (+4391.67%)
Mutual labels:  install, installation
Try
Dead simple CLI tool to try Python packages - It's never been easier! 📦
Stars: ✭ 588 (+1125%)
Mutual labels:  package, install
Nupdate
A comfortable update solution for .NET-applications.
Stars: ✭ 394 (+720.83%)
Mutual labels:  package, install
Gitdependencyresolverforunity
This plugin resolves git url dependencies in the package for Unity Package Manager. You can use a git url as a package dependency!
Stars: ✭ 126 (+162.5%)
Mutual labels:  package, dependency
Debreate
A utility for creating Debian packages.
Stars: ✭ 70 (+45.83%)
Mutual labels:  package, packaging
Fedora-KDE-Minimal-Install-Guide
Guide to install KDE Plasma desktop environment on a minimal Fedora installation
Stars: ✭ 125 (+160.42%)
Mutual labels:  install, installation
Elm Package
Command line tool to share Elm libraries
Stars: ✭ 214 (+345.83%)
Mutual labels:  package, install
Imposter Plugin
Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.
Stars: ✭ 90 (+87.5%)
Mutual labels:  namespace, dependency
get-installed-path
Get locally or globally installation path of given package name.
Stars: ✭ 39 (-18.75%)
Mutual labels:  package, install
Compinstall
Delphi utility app to auto-install component packages into IDE
Stars: ✭ 19 (-60.42%)
Mutual labels:  package, install
Boss
Dependency Manager for Delphi
Stars: ✭ 188 (+291.67%)
Mutual labels:  package, dependency
archdi-pkg
Arch Linux Desktop Installer Packages
Stars: ✭ 46 (-4.17%)
Mutual labels:  install, installation
phaser-super-storage
A cross platform storage plugin for Phaser
Stars: ✭ 49 (+2.08%)
Mutual labels:  namespace
MGM-Ability
No description or website provided.
Stars: ✭ 64 (+33.33%)
Mutual labels:  package
gitpack
Git-based package manager written in POSIX shell
Stars: ✭ 72 (+50%)
Mutual labels:  install

Test

PackageProject.cmake

Creating installable CMake scripts always requires a large amount of boilerplate code to get things working. This small script should simplify the CMake packaging process into a single, easy-to-use command.

Usage

To create an installable target for your current project, add the following to your CMakeLists.txt. This example assumes the project to be versioned and the name to be identical to the library to export. Also the CPM.cmake script should be included. See here for an example usage.

CPMAddPackage("gh:TheLartians/[email protected]")

packageProject(
  # the name of the target to export
  NAME ${PROJECT_NAME}
  # the version of the target to export
  VERSION ${PROJECT_VERSION}
  # a temporary directory to create the config files
  BINARY_DIR ${PROJECT_BINARY_DIR}
  # location of the target's public headers
  INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
  # should match the target's INSTALL_INTERFACE include directory
  INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
  # (optional) option to install only header files with matching pattern
  INCLUDE_HEADER_PATTERN "*.h"
  # semicolon separated list of the project's dependencies
  DEPENDENCIES "fmt 7.1.3;cxxopts 2.2.0"
  # (optional) create a header containing the version info
  # Note: that the path to headers should be lowercase
  VERSION_HEADER "${PROJECT_NAME}/version.h"
  # (optional) create a export header using GenerateExportHeader module
  EXPORT_HEADER "${PROJECT_NAME}/export.h"
  # (optional) install your library with a namespace (Note: do NOT add extra '::')
  NAMESPACE ${PROJECT_NAMESPACE}
  # (optional) define the project's version compatibility, defaults to `AnyNewerVersion`
  # supported values: `AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion`
  COMPATIBILITY AnyNewerVersion
  # (optional) option to disable the versioning of install destinations
  DISABLE_VERSION_SUFFIX YES
  # (optional) option to ignore target architecture for package resolution
  # defaults to YES for header only (i.e. INTERFACE) libraries
  ARCH_INDEPENDENT YES
)

If you need extra functionality feel free to open an issue or a PR.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].