add Macports support with cmake and coverity analyzer
This commit is contained in:
parent
124388905c
commit
d4e05d61c1
@ -8,11 +8,11 @@
|
||||
# We will work on command line using GNU Make
|
||||
export MAKEFILES_TYPE='Unix Makefiles'
|
||||
|
||||
if [ ! -d "build" ]; then
|
||||
mkdir build
|
||||
if [ ! -d "build.cmake" ]; then
|
||||
mkdir build.cmake
|
||||
fi
|
||||
|
||||
cd build
|
||||
cd build.cmake
|
||||
|
||||
cmake -G "$MAKEFILES_TYPE" . \
|
||||
-DCMAKE_BUILD_TYPE=debugfull \
|
||||
|
||||
83
bootstrap.macports
Executable file
83
bootstrap.macports
Executable file
@ -0,0 +1,83 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2008-2015, Gilles Caulier, <caulier dot gilles at gmail dot com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# Arguments : $1 : install path '/opt/local' (default).
|
||||
# $2 : build type 'debugfull' to hack (default), 'release' for production.
|
||||
# $3 : target type 'x86_64' for OSX Lion and later (default), 'i386' for Snow Leopard.
|
||||
# $4 : extra CXX flags (empty by default)
|
||||
#
|
||||
|
||||
INSTALL_PREFIX=$1
|
||||
if [ "$INSTALL_PREFIX" = "" ]; then
|
||||
# Standard Macports install
|
||||
INSTALL_PREFIX=/opt/local
|
||||
BUNDLE_INSTALL_DIR=/Applications/
|
||||
else
|
||||
# Specific install path as /opt/exiv2 to build bundle PKG for example
|
||||
BUNDLE_INSTALL_DIR=${INSTALL_PREFIX}/Applications/
|
||||
fi
|
||||
|
||||
BUILD_TYPE=$2
|
||||
if [ "$BUILD_TYPE" = "" ]; then
|
||||
BUILD_TYPE=debugfull
|
||||
fi
|
||||
|
||||
TARGET_TYPE=$3
|
||||
if [ "$TARGET_TYPE" = "" ]; then
|
||||
TARGET_TYPE=x86_64
|
||||
fi
|
||||
|
||||
EXTRA_CXX_FLAGS=$4
|
||||
|
||||
# Set devel env from MacOS-X through MacPorts
|
||||
export QTDIR=${INSTALL_PREFIX}/lib
|
||||
export QT_INCLUDE_DIR=${INSTALL_PREFIX}/include
|
||||
export PATH=$QTDIR/bin:$PATH
|
||||
export PKG_CONFIG_PATH=${INSTALL_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||
|
||||
# We will work on command line using GNU make
|
||||
export MAKEFILES_TYPE='Unix Makefiles'
|
||||
|
||||
echo "Installing to $INSTALL_PREFIX for target $TARGET_TYPE with build mode $BUILD_TYPE and extra CXX flags $EXTRA_CXX_FLAGS"
|
||||
|
||||
if [ ! -d "build.cmake" ]; then
|
||||
mkdir build.cmake
|
||||
fi
|
||||
|
||||
cd build.cmake
|
||||
|
||||
cmake -G "$MAKEFILES_TYPE" . \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
|
||||
-DCMAKE_OSX_ARCHITECTURES=${TARGET_TYPE} \
|
||||
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}" \
|
||||
-DEXIV2_ENABLE_SHARED=ON \
|
||||
-DEXIV2_ENABLE_XMP=ON \
|
||||
-DEXIV2_ENABLE_LIBXMP=ON \
|
||||
-DEXIV2_ENABLE_VIDEO=ON \
|
||||
-DEXIV2_ENABLE_PNG=ON \
|
||||
-DEXIV2_ENABLE_NLS=ON \
|
||||
-DEXIV2_ENABLE_PRINTUCS2=ON \
|
||||
-DEXIV2_ENABLE_LENSDATA=ON \
|
||||
-DEXIV2_ENABLE_COMMERCIAL=OFF \
|
||||
-DEXIV2_ENABLE_BUILD_SAMPLES=ON \
|
||||
-DEXIV2_ENABLE_BUILD_PO=ON \
|
||||
-DEXIV2_ENABLE_VIDEO=ON \
|
||||
-DEXIV2_ENABLE_WEBREADY=ON \
|
||||
-DEXIV2_ENABLE_CURL=ON \
|
||||
-DEXIV2_ENABLE_SSH=ON \
|
||||
-Wno-dev \
|
||||
-DCMAKE_COLOR_MAKEFILE=ON \
|
||||
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
|
||||
-DCMAKE_INSTALL_NAME_DIR=${INSTALL_PREFIX}/lib \
|
||||
-DCMAKE_SYSTEM_PREFIX_PATH="${INSTALL_PREFIX};/usr" \
|
||||
-DCMAKE_MODULE_PATH="${INSTALL_PREFIX}/share/cmake/modules" \
|
||||
-DBUNDLE_INSTALL_DIR=${BUNDLE_INSTALL_DIR} \
|
||||
-DQT_QT_INCLUDE_DIR=${INSTALL_PREFIX}/include \
|
||||
-DQT_LIBRARY_DIR=${INSTALL_PREFIX}/lib \
|
||||
-DQT_QMAKE_EXECUTABLE=${INSTALL_PREFIX}/bin/qmake \
|
||||
..
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2013, Gilles Caulier, <caulier dot gilles at gmail dot com>
|
||||
# Copyright (c) 2013-2015, Gilles Caulier, <caulier dot gilles at gmail dot com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
@ -17,19 +17,26 @@
|
||||
cd ..
|
||||
|
||||
# Manage build sub-dir
|
||||
if [ -d "build" ]; then
|
||||
rm -rfv ./build
|
||||
if [ -d "build.cmake" ]; then
|
||||
rm -rfv ./build.cmake
|
||||
fi
|
||||
|
||||
./bootstrap.linux
|
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
./bootstrap.linux
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
./bootstrap.macports
|
||||
else
|
||||
echo "Unsupported platform..."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Get active svn branch path to create SCAN import description string
|
||||
svn info | grep "URL" | sed '/svn/{s/.*\(svn.*\)/\1/};' > ./build/svn_branch.txt
|
||||
desc=$(<build/svn_branch.txt)
|
||||
svn info | grep "URL" | sed '/svn/{s/.*\(svn.*\)/\1/};' > ./build.cmake/svn_branch.txt
|
||||
desc=$(<build.cmake/svn_branch.txt)
|
||||
|
||||
cd ./build
|
||||
cd ./build.cmake
|
||||
|
||||
cov-build --dir cov-int --tmpdir ~/tmp make
|
||||
cov-build --dir cov-int --tmpdir ~/tmp make -j8
|
||||
tar czvf myproject.tgz cov-int
|
||||
|
||||
echo "-- SCAN Import description --"
|
||||
@ -42,13 +49,12 @@ nslookup scan5.coverity.com
|
||||
SECONDS=0
|
||||
|
||||
curl -# \
|
||||
--form project=Exiv2 \
|
||||
--form token=$EXIVCoverityToken \
|
||||
--form email=$EXIVCoverityEmail \
|
||||
--form file=@myproject.tgz \
|
||||
--form version=svn-trunk \
|
||||
--form description="$desc" \
|
||||
http://scan5.coverity.com/cgi-bin/upload.py \
|
||||
https://scan.coverity.com/builds?project=Exiv2 \
|
||||
> /dev/null
|
||||
|
||||
echo "Done. Coverity Scan tarball 'myproject.tgz' is uploaded and ready for analyse."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user