cppm.toml
cppm package config file
package
[package]
name = "example" # user package name
version = "1.0.0" # user package version
description = "example" # package description
standard = "17" # c++ standard version, other value = [11,14,17(default),20]
cmake
ccache auto use
[cmake]
version = "..." # cmake minimum version, default => 3.6
include = ["cmake/cppm_install.cmake","..."] # include cmake files
option = "..." # cmake options, 'cppm build' use this option
hunter
hunter package can use
[hunter]
url = "..." # default url: https://github.com/ruslo/hunter/archive/v0.23.89.tar.gz
sha1 = "..." # default sha1: a370290a8b32987755a36d64807bf8c7f5b61730
compiler
base compiler option [compiler.debug] clang = {option = "-Wall -fPIC -O0 -g"} gcc = {option = "-Wall -fPIC -O0 -g"} msvc = {option = "/MP /MDd /Zi /Ob0 /Od /RT1"} [compiler.release] clang = {option = "-fPIC -O3 -DNDEBUG"} gcc = {option = "-fPIC -O3 -DNDEBUG"} msvc = {option = "/MP /MD /Zi /O2 /DNDEBUG"} If no compiler option is available, add the default option to the Base option. clang = {option = ""} gcc = {option = ""} msvc = {option = ""}
Add option by compiler
[compiler]
clang = {option = "..."} ## clang compiler options
gcc = {option = "..."} ## gcc compiler options
msvc = {option = "..."} ## visual studio compiler options
can add compiler options by Debug and Release mode.
[compiler.debug]
clang = {option = "..."} ## clang compiler options
gcc = {option = ".."} ## gcc compiler options
msvc = {option = "..."} ## visual studio compiler options
[compiler.release]
clang = {option = "..."} ## clang compiler options
gcc = {option = "..."} ## gcc compiler options
msvc = {option = "..."} ## visual studio compiler options
bin
binary target define
[[bin]]
name = "cppm" # bin name
source = ["src/.*"] # source files
# install = true # true and false (default => true) value is defulat can't install
[[bin]]
name = "tbin" # bin name
source = ["src/.*"] # source files
install = false #
lib
library target define
[[lib]]
name = "nlpo" # lib name
type = "static" # lib type , static or shared or header-only
source = ["src/.*"] # source files
# install = true # true and false (default => true) # target install option
[[lib]]
name = "exam" # lib name
type = "shared" # lib type , static or shared or header-only
source = ["src/.*"] # source files
install = false # this target make install not working
dependencies
May if you use cppkg only need version argument add thirdparty library dependencies (0) = {module = (1), version = (2), components = (3), hunter=(4), no_module=(5) lnk_type=(6)} (0): package name (1): library name in cmake, Need (2): library version, default(latest) latest version order: n.n.n.n > git (3): library components (4): dependency use hunter package (5): if module name is cmake variable(${Example_LIBRARIES}), use this option, default(false) (6): cmake library link type , public(default) or private or interface public: library include in header and .cpp private: libray include in .cpp interface: library include in header
[dependencies]
cpptoml = {module = "cpptoml"} # cmake option is library name in cmake
Boost = {module = " ${Boost_LIBRARIES}", components="system filesystem", no_module=true}
fmt = {module = "fmt::fmt" HUNTER} # search and install to use hunter package manager
nlpo = "git" # cppkg package auto load other arguments, only need version
fmt = "6.0.0" # cppkg package
Last updated
Was this helpful?