Skip to content

Commit ff96179

Browse files
authored
add install prefix (#19)
* add install prefix * add instructions to readme
1 parent 6244d91 commit ff96179

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ Can be installed ob Ubuntu using `sudo apt install pybind11-dev libconcurrentque
5858
```
5959
3. Install `sudo cmake --install build`
6060
3. Uninstall `sudo xargs rm < build/install_manifest.txt`
61+
62+
The configure script also supports custom install prefix. You can either use the `-p | --prefix` flag, or specify the `PYTHON_UDL_INTERFACE_PREFIX` environment variable.

configure.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ BUILD_TYPE="Debug"
77
BUILD_DIR="build"
88
BUILD_EXAMPLES=OFF
99
BUILD_TESTS=OFF
10+
PYTHON_UDL_INTERFACE_PREFIX="${PYTHON_UDL_INTERFACE_PREFIX:-/usr/local}"
1011

1112
# Parse arguments
1213
while [[ "$#" -gt 0 ]]; do
@@ -25,12 +26,17 @@ while [[ "$#" -gt 0 ]]; do
2526
-t | --tests)
2627
BUILD_TESTS=ON
2728
;;
29+
-p | --prefix)
30+
PYTHON_UDL_INTERFACE_PREFIX="$2"
31+
shift
32+
;;
2833
-h | --help)
29-
echo "Usage: ./configure.sh [-t Debug|Release|RelWithDebInfo|MinSizeRel] [-d build_dir] [-e]"
34+
echo "Usage: ./configure.sh [options]"
3035
echo " -m | --mode : Build type (default: Debug)"
3136
echo " -d | --dir : Build directory (default: build)"
3237
echo " -e | --examples : Enable building examples (default: OFF)"
3338
echo " -t | --tests : Enable building tests (default: OFF)"
39+
echo " -p | --prefix : Install prefix (default: /usr/local or \$PYTHON_UDL_INTERFACE_PREFIX)"
3440
exit 0
3541
;;
3642
*)
@@ -46,13 +52,15 @@ echo " Build type : $BUILD_TYPE"
4652
echo " Build dir : $BUILD_DIR"
4753
echo " Build examples : $BUILD_EXAMPLES"
4854
echo " Build tests : $BUILD_TESTS"
55+
echo " Install prefix : $PYTHON_UDL_INTERFACE_PREFIX"
4956

5057
# Create build directory
5158
mkdir -p "$BUILD_DIR"
5259

5360
# Run CMake configuration
5461
cmake -B "$BUILD_DIR" \
5562
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
63+
-DCMAKE_INSTALL_PREFIX="$PYTHON_UDL_INTERFACE_PREFIX" \
5664
-DBUILD_EXAMPLES="$BUILD_EXAMPLES" \
5765
-DBUILD_TESTS="$BUILD_TESTS" \
5866
-S .

0 commit comments

Comments
 (0)