diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.in (renamed from CMakeLists.txt) | 8 | ||||
-rwxr-xr-x | configure | 11 |
3 files changed, 11 insertions, 9 deletions
@@ -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) @@ -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 |