summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.in (renamed from CMakeLists.txt)8
-rwxr-xr-xconfigure11
3 files changed, 11 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index d2b3289..2342f72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ CMakeFiles/*
*/*/CMakeFiles/*
*/*/cmake_install.cmake
Makefile
+CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.in
index f5907f3..b4cffd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.in
@@ -43,15 +43,15 @@ IF(DEBUG)
ENDIF(SHOW_SECRETS)
ENDIF(DEBUG)
-SET(OPENVPN_SRC "$ENV{OPENVPN_SRC_DIR}")
+SET(OPENVPN_SRC "@@OPENVPN_SRC@@")
IF(NOT OPENVPN_SRC)
- message(FATAL_ERROR "Cannot build eurephia without OPENVPN_SRC_DIR environment variable set to point at OpenVPN source")
+ message(FATAL_ERROR "Missing path to OpenVPN source - try running ./configure again")
ENDIF(NOT OPENVPN_SRC)
INCLUDE_DIRECTORIES(BEFORE ${OPENVPN_SRC} .)
-SET(CHECK_INCL_FILE "${OPENVPN_SRC}/openvpn-plugin.h")
+SET(CHECK_INCL_FILE "@@OPENVPN_SRC@@/openvpn-plugin.h")
IF(NOT EXISTS ${CHECK_INCL_FILE})
- message(FATAL_ERROR "Missing openvpn-plugin.h ... Is $OPENVPN_SRC_DIR pointing to the real OpenVPN source code?")
+ message(FATAL_ERROR "Missing openvpn-plugin.h ... Is the OpenVPN source code really located here? @@OPENVPN_SRC@@")
ENDIF(NOT EXISTS ${CHECK_INCL_FILE})
INCLUDE(CheckIncludeFile)
diff --git a/configure b/configure
index 59d0ab8..51edf0f 100755
--- a/configure
+++ b/configure
@@ -18,7 +18,7 @@ EOF
PARAMS=""
DB=""
FW=""
-export OPENVPN_SRC_DIR=""
+OPENVPN_SRC_DIR=""
while [ ! -z "$1" ]; do
case $1 in
-h|--help)
@@ -26,7 +26,7 @@ while [ ! -z "$1" ]; do
exit 0
;;
-s|--openvpn-src)
- export OPENVPN_SRC_DIR="$2"
+ OPENVPN_SRC_DIR="$2"
shift
;;
-D|--debug)
@@ -53,12 +53,12 @@ while [ ! -z "$1" ]; do
shift
done
-if [ -z $(which cmake) ]; then
+if [ -z "$(which cmake)" ]; then
echo "To build eurephia, you need to install cmake (at least version 2.6)"
exit 1;
fi
-if [ -z ${OPENVPN_SRC_DIR} ]; then
+if [ -z "${OPENVPN_SRC_DIR}" ]; then
echo "You need to give the --openvpn-src <path> option"
exit 1;
fi
@@ -68,7 +68,8 @@ if [ ${DB} = 0 ]; then
exit 1;
fi
-rm -f CMakeCache.txt
+rm -f CMakeCache.txt CMakeList.txt
+cat CMakeLists.in | sed "s#\@\@OPENVPN_SRC\@\@#${OPENVPN_SRC_DIR}#" > CMakeLists.txt
cmake . ${PARAMS}
ec=$?
if [ $ec = 0 ]; then