cmake

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

package cmake provides tools to create, configure and build C & C++ projects using CMake

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LibraryExists

func LibraryExists(name string, includeFiles, includeDirs, linkDirs, predefines []string) error

LibraryExists tries to compile a simple program linking to the given library

Types

type Cmake

type Cmake struct {
	// Configs required for CMakeLists.txt
	Name        string // Executable name
	IsCpp       bool
	Standard    int // CMAKE_C/CXX_STANDARD
	Files       []string
	IncludeDirs []string
	LinkLibs    []string // Library names or full paths
	LinkDirs    []string // Where should the linker look for libraries
	Generator   string

	// Build configuration
	ConfDir  string
	BuildDir string
	// contains filtered or unexported fields
}

Cmake contains all configuration necessary to configure and build a CMake project

func (*Cmake) Build

func (cmake *Cmake) Build() ([]byte, []byte, error)

Build runs cmake build step.

func (*Cmake) Configure

func (cmake *Cmake) Configure() ([]byte, []byte, error)

Configure runs cmake configuration step.

func (*Cmake) CreateTempDirs

func (cmake *Cmake) CreateTempDirs() error

CreateTempDirs creates temporary directories for conf and build dir

func (*Cmake) GetCMakeListsTxt

func (cmake *Cmake) GetCMakeListsTxt() (string, error)

func (*Cmake) RemoveTempDirs

func (cmake *Cmake) RemoveTempDirs() error

func (*Cmake) WriteCMakeListsTxt

func (cmake *Cmake) WriteCMakeListsTxt() error

WriteCMakeListsTxt writes cmake specification to file and returns the file name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL