summaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
authorJan Darmochwal2010-07-13 17:55:06 +0200
committerJan Darmochwal2010-07-13 17:55:06 +0200
commitf29300c556e541f2bf1b63ed8c6399a6c2044c8d (patch)
tree4a549ef967177e82e6b20536f9484e8461893c7b /build.sh
parentinitial qt4 version (diff)
downloadvmchooser-f29300c556e541f2bf1b63ed8c6399a6c2044c8d.tar.gz
vmchooser-f29300c556e541f2bf1b63ed8c6399a6c2044c8d.tar.xz
vmchooser-f29300c556e541f2bf1b63ed8c6399a6c2044c8d.zip
qmake -> cmake; (mostly) cosmetic changes
Switched to cmake: CMakeLists.txt in base directory use ./build.sh to build vmchooser (or mkdir -p build; cd build cmake .. && make) updated README removed fltk/ removed libxml2/ removed mesgdisp/ renamed vmchooser/ to src/ moved all header files (.h) from vmchooser/inc/ to src/ added files to repository that must have slipped the last time
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..f1983a7
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# relative path to the cmake source tree directory (contains "CMakeLists.txt")
+SRCDIR="."
+
+# relative path to the cmake build tree directory
+BUILDDIR="build"
+
+DIR=$(pwd)
+
+if [[ ! -f "$DIR"/"$SRCDIR"/CMakeLists.txt ]]
+then
+ echo "$SRCDIR/CMakeLists.txt not found" >&2
+ SCRIPTNAME=$(basename "$0" 2>/dev/null || echo "$0")
+ echo "please run '$SCRIPTNAME' from its containing directory" >&2
+ exit 1
+fi
+
+# note: NCORES may be too large on systems with hyperthreading
+NCORES=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
+if [[ ! $NCORES -ge 1 ]]
+then
+ NCORES=1
+fi
+
+mkdir -p "$BUILDDIR"
+cd "$BUILDDIR"
+
+cmake "$DIR"/"$SRCDIR"/ && make -j $NCORES
+
+cd "$DIR"