aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-08-01 08:20:23 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-08-01 08:20:23 +0200
commitbfeeac6e4889d1e9a1083b3c7efc59652981b168 (patch)
treea937d844a59da7c509685dcd1ddd9933772e526f /configure
parentc307e9f234e544386fa3ae53083c7510668e1716 (diff)
downloadkicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.gz
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.bz2
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.xz
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.zip
o Moving the generation logic to Python, embedding a Python interpreter with the help of pybind11.
o Adding install configuration to CMake to make it easier to reuse the project later on. o Splitting out the examples into its own project to make it easier to test the whole installation setup and python/template loading. o Trying to reorganize the code a bit, not very much better yet.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure51
1 files changed, 51 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..4aaae1c
--- /dev/null
+++ b/configure
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+PROJECT=kicad-utils
+
+set -e
+
+CMAKE=`which cmake 2>/dev/null`
+PREFIX=$HOME/opt/$PROJECT
+# TODO: find basedir from the current binary
+BASEDIR=`pwd`
+
+if [ ! -x "$CMAKE" ]
+then
+ echo "cmake is not installed"
+ exit 1
+fi
+
+cd $BASEDIR
+
+NEW=`test -d build && echo 1 || true`
+
+mkdir -p build
+
+CMAKE_OPTS=()
+CMAKE_OPTS+=(-DCMAKE_INSTALL_PREFIX=$PREFIX)
+#CMAKE_OPTS+=(-DCMAKE_SKIP_RPATH=NO)
+#CMAKE_OPTS+=(-DCMAKE_SKIP_INSTALL_RPATH=NO)
+# These are required until Antlr C++ is installed by the system
+CMAKE_OPTS+=(-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE)
+CMAKE_OPTS+=(-DAntlr4_DIR=$HOME/opt/antlr4-cpp/lib/cmake/Antlr4)
+
+cd build
+echo ""
+echo "Generating build.."
+echo ""
+cmake "${CMAKE_OPTS[@]}" ..
+
+
+echo ""
+echo ""
+echo ""
+
+if [[ $NEW == 1 ]]
+then
+ echo "Reusing existing build/ directory. You should probably run cd build && make clean"
+else
+ echo "The build files are generated in build/. To build run: cd build && make install"
+ echo "The binaries will be installed under $PREFIX"
+fi
+
+echo ""