Skip to content
lqez edited this page Mar 27, 2013 · 3 revisions

This document describes how to build npk from scratch.

Prerequisite

  • cmake
  • Download from http://cmake.org
  • or install cmake by package distributions ( yum / apt / port / brew, etc. )
  • gcc / for Mac OS X, Linux build
  • Visual C++ / for Windows build

Get npk

  • Check out from source tree : http:/github.com/lqez/npk/

About "build mode"

  • npk support two types of build mode,
    • Read-only mode : minimal build
      • Build libnpk only.
      • For production.
      • Cannot manipulate packages.
      • Includes minimum features for reading npk formatted package.(smaller)
    • Development mode
      • Set DEV_MODE as ON in CMake configuration.
      • Build libnpk and npk cli tools together.
      • For development usages.
      • Include full features, but size of libnpk is bigger than read-only mode.
      • If you want to create or manipulate packages, you have to choose this.

Configuration

  • Create an empty directory for building.
  • Run cmake (in the directory that you created).
  • On Mac OS X / Linux, use ccmake to run cmake console.
  • On Windows, use cmake-gui to run cmake GUI console.
  • Configure makefile as your favor.
  • Exit from cmake.

Building

  • On Mac OS X / Linux,
  • Just type 'make && make test' to build and run unit tests sequentially.
  • You can find the libnpk library in ./libnpk directory.
  • If you choose npk as dev mode, you can find out the npk in ./npk/cli directory.
  • Copy npk to your own bin directory. ( like /usr/local/bin or wherever you want )
  • On Windows,
  • Type 'nmake' to build and type 'nmake test' to run unit tests.
  • If you choose npk as dev mode, you can find out the npk.exe in ./npk/cli directory.
  • Copy 'npk.exe' to your system directory ( like C:/Windows/system32 ) to use it conveniently.
Clone this wiki locally