Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
cmake: Add wrapper Makefile and README.
Browse files Browse the repository at this point in the history
  • Loading branch information
thughes committed Nov 24, 2010
1 parent b57c1f5 commit a530c23
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Makefile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BUILD?=build
VERBOSE?=0
PARALLEL_JOBS?=1
CMAKE?=cmake

all: doc package

$(BUILD)/Makefile:
mkdir $(BUILD) || exit 0
cd $(BUILD) && $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE=$(VERBOSE) ..

build: $(BUILD)/Makefile
cd $(BUILD) && make -j $(PARALLEL_JOBS)

install: build
cd $(BUILD) && sudo make install

clean:
rm -rf $(BUILD)

doc: $(BUILD)/Makefile
cd $(BUILD) && make doc

package: $(BUILD)/Makefile
cd $(BUILD) && make package

test: $(BUILD)/Makefile
cd $(BUILD) && make test

.PHONY: build install clean doc package test
47 changes: 47 additions & 0 deletions README.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Instructions for building with cmake

Make sure you have cmake:
Ubuntu/Debian: sudo apt-get install cmake
Mac: http://www.cmake.org/files/v2.8/cmake-2.8.3-Darwin-universal.dmg
Other platforms: http://www.cmake.org/cmake/resources/software.html

To build:

make -f Makefile.cmake
make -f Makefile.cmake install

To run the tests:

make -f Makefile.cmake test

To build the documentation:

make -f Makefile.cmake doc

To read the documentation:

man doc/node.1

To build distro packages (tgz, deb, rpm, PackageMaker):

make -f Makefile.cmake package

Using cmake directly:
cd ~/your-node-source-dir
mkdir name-of-build-dir (can be anything)
cd name-of-build-dir
cmake ..

At this point you have generated a set of Makefiles and can use the standard
make commands (make, make install, etc.). The Makefile.cmake file is just a
wrapper around these commands; take a look at it for more details.

Additional options:
In the CMakeLists.txt, you'll see things like
option(SHARED_V8, ...). If you want to enable any of those options you can
pass "-DOPTION=True" when running cmake (e.g., cmake -DSHARED_V8=True).

See http://nodejs.org/ for more information. For help and discussion
subscribe to the mailing list by visiting
http://groups.google.com/group/nodejs or by sending an email to
nodejs+subscribe@googlegroups.com.

0 comments on commit a530c23

Please sign in to comment.