View Source mix cmake (mix_cmake v0.1.5)

Generate CMake buiid scripts and then build/install the application.

$ mix cmake [opt] [build_dir] [source_dir]

Command line options

  • --config - generate build script
  • --generator - specify generator
  • --parallel - parallel jobs level
  • --target - build target
  • --clean-first - clean before build target
  • --strip - remove debug info from executable
  • --verbose - print process detail

Configuration

Add following configurations at project/1 in your mix.exs if you need.

def project do
  [
    cmake: [...]
  ]
end
  • :build_dir - working directory {:local, :global, any_directory}
  • :source_dir - source directory
  • :generator - specify generator
  • :build_parallel_level - parallel jobs level

Summary

Functions

Add an environment variable for child process.

Get application name.

Returns true if the build directory exists.

Invoke cmake command with args.

Return a map of default environment variables.

Get :cmake configuration from Mix.exs.

Get build/source directory.

parse command line arguments. (custom)

Remove cmake build directory. (interpret pseudo-path)

Callback implementation for Mix.Task.run/1.

Functions

add_env(env, name, i)

Add an environment variable for child process.

app_name()

Get application name.

build_dir_exists?(build_dir)

Returns true if the build directory exists.

cmake(build_dir, args, env)

Invoke cmake command with args.

default_env()

Return a map of default environment variables.

get_config()

Get :cmake configuration from Mix.exs.

get_dirs(dirs, config)

Get build/source directory.

next(argv, opts \\ [])

See OptionParser.next/2.

parse_argv(argv, config \\ [])

parse command line arguments. (custom)

remove_build(build_dir)

Remove cmake build directory. (interpret pseudo-path)

remove_cache(build_dir)

run(argv)

Callback implementation for Mix.Task.run/1.