Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #27484: Add shd_cmake helper for running cmake with the correct …
Browse files Browse the repository at this point in the history
…flags for

building Sage SPKGs.
  • Loading branch information
embray committed Mar 14, 2019
1 parent 1040752 commit b0fa3a0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/bin/sage-dist-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
# If $SAGE_DESTDIR is not set then the command is run with $SAGE_SUDO, if
# set.
#
# - sdh_cmake [...]
#
# Runs `cmake` in the current directory with the given arguments, as well as
# additional arguments passed to cmake (assuming packages are using the
# GNUInstallDirs module) so that `CMAKE_INSTALL_PREFIX` and
# `CMAKE_INSTALL_LIBDIR` are set correctly.
#
# - sdh_install [-T] SRC [SRC...] DEST
#
# Copies one or more files or directories given as SRC (recursively in the
Expand Down Expand Up @@ -194,6 +201,25 @@ sdh_pip_install() {
}


sdh_cmake() {
echo "Configuring $PKG_NAME with cmake"
cmake . -DCMAKE_INSTALL_PREFIX="${SAGE_LOCAL}" \
-DCMAKE_INSTALL_LIBDIR=lib \
"$@"
if [ $? -ne 0 ]; then
if [ -f "$(pwd)/CMakeFiles/CMakeOutput.log" ]; then
sdh_die <<_EOF_
Error configuring $PKG_NAME with cmake
See the file
$(pwd)/CMakeFiles/CMakeOutput.log
for details.
_EOF_
fi
sdh_die "Error configuring $PKG_NAME with cmake"
fi
}


sdh_install() {
local T=0
local src=()
Expand Down

0 comments on commit b0fa3a0

Please sign in to comment.