Skip to content

Commit

Permalink
DRY build script
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Nov 22, 2023
1 parent 6d345ed commit d8412e2
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright 2019 United Kingdom Research and Innovation
# Copyright 2019 The University of Manchester

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#!/usr/bin/env bash
set -euxo pipefail

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Authors:
# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt

if [ `python -c "from __future__ import print_function; import platform; print (platform.system())"` == "Darwin" ] ;
then
echo "Darwin";
cmake ${RECIPE_DIR}/../ -DCONDA_BUILD=ON \
-DCMAKE_BUILD_TYPE="Release"\
-DLIBRARY_LIB=$CONDA_PREFIX/lib \
-DLIBRARY_INC=$CONDA_PREFIX/include \
-DOPENMP_LIBRARIES=${CONDA_PREFIX}/lib \
-DOPENMP_INCLUDES=${CONDA_PREFIX}/include \
-DCMAKE_INSTALL_PREFIX=$PREFIX
if test $(python -c "from __future__ import print_function; import platform; print(platform.system())") = Darwin ; then
echo "Darwin"
extra_args="-DOPENMP_LIBRARIES=${CONDA_PREFIX}/lib -DOPENMP_INCLUDES=${CONDA_PREFIX}/include"
else
echo "something else";
echo "something else"
extra_args=""
fi

cmake ${RECIPE_DIR}/../ -DCONDA_BUILD=ON \
-DCMAKE_BUILD_TYPE="Release"\
cmake ${RECIPE_DIR}/../ $extra_args \
-DCONDA_BUILD=ON \
-DCMAKE_BUILD_TYPE="Release" \
-DLIBRARY_LIB=$CONDA_PREFIX/lib \
-DLIBRARY_INC=$CONDA_PREFIX/include \
-DCMAKE_INSTALL_PREFIX=$PREFIX

fi
-DCMAKE_INSTALL_PREFIX=$PREFIX \

cmake --build . --target install

# Authors: CIL Developers (https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt)
# Copyright 2019 United Kingdom Research and Innovation
# Copyright 2019 The University of Manchester
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0

0 comments on commit d8412e2

Please sign in to comment.