Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 2.17 KB

README.md

File metadata and controls

45 lines (27 loc) · 2.17 KB

premake patterns

For most of my c++ projects I use premake as the meta-build system to generate platform-specific build files. This project is a collection of repeated patterns extracted from various projects to speed up the initial build environment setup.

I could have used automake, cmake or QMake, but the eunoia of Lua, having only one small executable as your pocket knife is just too appealing.

This project includes premake binaries and is build around premake, but is otherwise not affiliated with premake development. Its primary goal is providing a number of patterns for build file locations and similar simplifications.

This repository should look somewhat different, as premake5 makes many things much easier.

a quick start

Assuming, you include this project as a submodule or just copy it into the folder premake, with one file test.cpp that you want to build, prepare a premake4.lua file with the following contents in the root folder:

include 'premake'

make_solution 'test'
make_console_app('test', { 'test.cpp' }) 
use_standard('c++11') 

calling premake/premake4 gmake in Linux will create makefiles in the folder Build/linux/gmake.

customizing

a global table config is available for customization. I.e.

config.location_pattern = [[CustomBuild/%o/%v/%t]]

before make_solution will customize the build file location to CustomBuild/[os name]/[os version]/[toolchain]. Check out config.lua for other customization options.

an example project

Here's a project using this component: selfdestructing.

premake

Check out premake for more info, license and copyrights.

Binaries for Windows, Linux and Mac OS X are included in this project. See the official premake website if you want to build it or install a different version of it yourself.