mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-11-09 20:57:26 +01:00
build-and-install-cmake.sh: Improve script to speedup build time
* faster source checkout specifying tag and depth * remove obsolete comments * disable testing
This commit is contained in:
parent
f1a8f69f4d
commit
71759485f9
@ -1,11 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
|
||||||
# * build directory is /usr/src/CMake
|
|
||||||
#
|
|
||||||
# * install directory is /usr
|
|
||||||
#
|
|
||||||
# * after installation, archive, source and build directories are removed
|
|
||||||
#
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
WRAPPER=""
|
WRAPPER=""
|
||||||
@ -35,9 +29,7 @@ fi
|
|||||||
|
|
||||||
cd /usr/src
|
cd /usr/src
|
||||||
|
|
||||||
git clone git://cmake.org/cmake.git CMake
|
git clone git://cmake.org/cmake.git CMake -b v$CMAKE_VERSION --depth 1
|
||||||
|
|
||||||
(cd CMake && git checkout v$CMAKE_VERSION)
|
|
||||||
|
|
||||||
mkdir /usr/src/CMake-build
|
mkdir /usr/src/CMake-build
|
||||||
cd /usr/src/CMake-build
|
cd /usr/src/CMake-build
|
||||||
@ -48,21 +40,22 @@ ${WRAPPER} make -j$(grep -c processor /proc/cpuinfo)
|
|||||||
|
|
||||||
mkdir /usr/src/CMake-ssl-build
|
mkdir /usr/src/CMake-ssl-build
|
||||||
cd /usr/src/CMake-ssl-build
|
cd /usr/src/CMake-ssl-build
|
||||||
|
|
||||||
${WRAPPER} /usr/src/CMake-build/bin/cmake \
|
${WRAPPER} /usr/src/CMake-build/bin/cmake \
|
||||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||||
-DBUILD_TESTING:BOOL=ON \
|
-DBUILD_TESTING:BOOL=OFF \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=/usr/src/cmake-$CMAKE_VERSION \
|
-DCMAKE_INSTALL_PREFIX:PATH=/usr/src/cmake-$CMAKE_VERSION \
|
||||||
-DCMAKE_USE_OPENSSL:BOOL=ON \
|
-DCMAKE_USE_OPENSSL:BOOL=ON \
|
||||||
-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \
|
-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \
|
||||||
../CMake
|
../CMake
|
||||||
${WRAPPER} make -j$(grep -c processor /proc/cpuinfo) install
|
${WRAPPER} make -j$(grep -c processor /proc/cpuinfo) install
|
||||||
|
|
||||||
|
# Cleanup install tree
|
||||||
cd /usr/src/cmake-$CMAKE_VERSION
|
cd /usr/src/cmake-$CMAKE_VERSION
|
||||||
rm -rf doc man
|
rm -rf doc man
|
||||||
find . -type f -exec install -D "{}" "/usr/{}" \;
|
|
||||||
|
|
||||||
# Test
|
# Install files
|
||||||
ctest -R CMake.FileDownload
|
find . -type f -exec install -D "{}" "/usr/{}" \;
|
||||||
|
|
||||||
# Write test script
|
# Write test script
|
||||||
cat <<EOF > cmake-test-https-download.cmake
|
cat <<EOF > cmake-test-https-download.cmake
|
||||||
@ -86,4 +79,5 @@ EOF
|
|||||||
# Execute test script
|
# Execute test script
|
||||||
cmake -P cmake-test-https-download.cmake
|
cmake -P cmake-test-https-download.cmake
|
||||||
|
|
||||||
|
# Remove source and build trees
|
||||||
rm -rf /usr/src/CMake*
|
rm -rf /usr/src/CMake*
|
||||||
|
Loading…
Reference in New Issue
Block a user