Commit 3f7fdeef authored by Neverlord's avatar Neverlord

fixed config script for user-defined build dir

parent 7d07ea2f
...@@ -91,23 +91,31 @@ configure () ...@@ -91,23 +91,31 @@ configure ()
append_cache_entry CMAKE_CXX_COMPILER FILEPATH $1 append_cache_entry CMAKE_CXX_COMPILER FILEPATH $1
fi fi
if [[ "$builddir" = /* ]]; then
# absolute path given
absolute_builddir="$builddir"
else
# relative path given; convert to absolute path
absolute_builddir="$(pwd)/$builddir"
fi
if [ -n "$2" ]; then if [ -n "$2" ]; then
workdir="$builddir-$2" workdir="$absolute_builddir-$2"
else else
workdir="$builddir" workdir="$absolute_builddir"
fi fi
workdirs="$workdirs $workdir" workdirs="$workdirs $workdir"
if [ -n "$3" ]; then if [ -n "$3" ]; then
append_cache_entry EXECUTABLE_OUTPUT_PATH PATH "$3" append_cache_entry EXECUTABLE_OUTPUT_PATH PATH "$3"
else else
append_cache_entry EXECUTABLE_OUTPUT_PATH PATH "$workdir/bin" append_cache_entry EXECUTABLE_OUTPUT_PATH PATH "$absolute_builddir/bin"
fi fi
if [ -n "$4" ]; then if [ -n "$4" ]; then
append_cache_entry LIBRARY_OUTPUT_PATH PATH "$4" append_cache_entry LIBRARY_OUTPUT_PATH PATH "$4"
else else
append_cache_entry LIBRARY_OUTPUT_PATH PATH "$workdir/lib" append_cache_entry LIBRARY_OUTPUT_PATH PATH "$absolute_builddir/lib"
fi fi
if [ -d $workdir ]; then if [ -d $workdir ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment