Skip to content
Snippets Groups Projects
Commit 4284a063 authored by Lars Bilke's avatar Lars Bilke
Browse files

Qt and VTK installing on Windows finished.

parent b75fbfc7
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash #!/usr/bin/env bash
# Parse options
while getopts ":a:d" opt; do
case $opt in
a)
if [ "$OPTARG" == "x32" ]; then
ARCHITECTURE="x32"
elif [ "$OPTARG" == "x64" ]; then
ARCHITECTURE="x64"
else
echo "$OPTARG is not a valid argument. Specify x32 or x64."
exit 1
fi
;;
\?)
echo "Invalid option: -$OPTARG"
exit 1
;;
:)
echo "Option -$OPTARG requires an argument."
exit 1
;;
d)
echo "Third party library debug builds enabled."
LIB_DEBUG=true
;;
esac
done
SOURCE_LOCATION=`pwd`
SOURCE_LOCATION="$SOURCE_LOCATION/../.."
source setup_prerequisites.sh source setup_prerequisites.sh
source setup_libraries.sh
\ No newline at end of file
#!/usr/bin/env bash
cd "$SOURCE_LOCATION/../"
mkdir -vp libs
cd libs
QMAKE_LOCATION=`which qmake`
## Windows specific
if [ "$OSTYPE" == 'msys' ]; then
if [ -z "$QMAKE_LOCATION" ]; then
# Install Qt
QT_VERSION="qt-everywhere-opensource-src-4.7.3"
if [ ! -d $QT_VERSION ]; then
# Download and extract
wget http://get.qt.nokia.com/qt/source/$QT_VERSION.zip -O ./$QT_VERSION.zip
7za x $QT_VERSION.zip
rm $QT_VERSION.zip
elif [ -f $QT_VERSION/bin/qmake.exe -a -f $QT_VERSION/bin/QtGui4.dll ]; then
# Already installed
QT_FOUND=true
fi
if [ $QT_FOUND ]; then
echo "Qt already installed in $SOURCE_LOCATION/../$QT_VERSION"
else
# Compile
# TODO: -mp flag for multiprocessor compiling?
if [ $LIB_DEBUG ]; then
QT_CONFIGURATION="-debug-and-release"
else
QT_CONFIGURATION="-release"
fi
cd $QT_VERSION
echo " \
\"$WIN_DEVENV_PATH\\..\\..\\VC\\vcvarsall.bat\" $WIN_ARCHITECTURE &&\
echo y | configure -opensource -nomake demos -nomake examples $QT_CONFIGURATION &&\
nmake && nmake clean &&\
exit\
" > build_qt.bat
$COMSPEC \/k build_qt.bat
fi
export PATH=$PATH:$SOURCE_LOCATION/../libs/$QT_VERSION/bin
else
echo "Qt already installed in $QMAKE_LOCATION"
fi
cd "$SOURCE_LOCATION/../libs"
# Install VTK
#http://www.vtk.org/files/release/5.6/vtk-5.6.1.tar.gz
VTK_VERSION="vtk-5.6.1"
if [ ! -d $VTK_VERSION ]; then
# Download, extract, rename
wget http://www.vtk.org/files/release/5.6/$VTK_VERSION.tar.gz -O ./$VTK_VERSION.tar.gz
tar -xf $VTK_VERSION.tar.gz
mv VTK/ $VTK_VERSION/
rm $VTK_VERSION.tar.gz
# Check for existing installation
elif [ -f $VTK_VERSION/build/bin/Release/QVTK.lib -a -f $VTK_VERSION/build/bin/Release/vtkRendering.lib ]; then
if [ $LIB_DEBUG ]; then
if [ -f $VTK_VERSION/build/bin/Debug/QVTK.lib -a -f $VTK_VERSION/build/bin/Debug/vtkRendering.lib ]; then
VTK_FOUND=true
fi
else
VTK_FOUND=true
fi
fi
if [ $VTK_FOUND ]; then
echo "VTK already installed in $SOURCE_LOCATION/../$VTK_VERSION"
else
# Compile
cd $VTK_VERSION
mkdir -vp build
cd build
cmake .. -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DVTK_USE_GUISUPPORT=ON -DVTK_USE_QT=ON -DVTK_USE_QVTK_QTOPENGL=ON -G "$CMAKE_GENERATOR"
cmake ..
echo "PATH: $PATH"
qmake -v
$COMSPEC \/c "devenv.com VTK.sln /Build Release"
$COMSPEC \/c "devenv VTK.sln /Build Release /Project QVTK"
if [ $LIB_DEBUG ]; then
$COMSPEC \/c "devenv VTK.sln /Build Debug"
$COMSPEC \/c "devenv VTK.sln /Build Debug /Project QVTK"
fi
fi
fi
\ No newline at end of file
...@@ -3,20 +3,46 @@ ...@@ -3,20 +3,46 @@
## Windows specific ## Windows specific
if [ "$OSTYPE" == 'msys' ]; then if [ "$OSTYPE" == 'msys' ]; then
# Check Visual Studio version # Check Visual Studio version and setup CMake generator
if [ -z "$VS80COMNTOOLS" ]; then if [ -z "$VS80COMNTOOLS" ]; then
if [ -z "$VS90COMNTOOLS" ]; then if [ -z "$VS90COMNTOOLS" ]; then
if [ -z "VS100COMNTOOLS" ]; then if [ -z "VS100COMNTOOLS" ]; then
echo "Error: Visual Studio not found" echo "Error: Visual Studio not found"
exit 1
else else
DEVENV="$VS100COMNTOOLS..\IDE\devenv" WIN_DEVENV_PATH="$VS100COMNTOOLS..\\IDE\\"
CMAKE_GENERATOR="Visual Studio 10"
fi fi
else else
DEVENV="$VS90COMNTOOLS..\IDE\devenv" WIN_DEVENV_PATH="$VS90COMNTOOLS..\\IDE"
CMAKE_GENERATOR="Visual Studio 9 2008"
fi fi
else else
DEVENV="$VS80COMNTOOLS..\IDE\devenv" WIN_DEVENV_PATH="$VS80COMNTOOLS..\\IDE"
CMAKE_GENERATOR="Visual Studio 8 2005"
fi
if [ "$ARCHITECTURE" == "x64" ]; then
CMAKE_GENERATOR="$CMAKE_GENERATOR Win64"
fi
# Replace backslashes in WIN_DEVENV_PATH
DEVENV_PATH=$(echo "$WIN_DEVENV_PATH" | awk '{ gsub(/\\/, "/"); print }')
DEVENV_PATH=$(echo "$DEVENV_PATH" | awk '{ gsub(/C:\//, "/c/"); print }')
echo "Visual Studio found: $DEVENV_PATH"
echo "CMake Generator: $CMAKE_GENERATOR"
export PATH=$PATH:$DEVENV_PATH
# 7-zip
SEVENZIP_LOCATION=`which 7za`
if [ ! -z "$SEVENZIP_LOCATION" ]; then
echo "7-zip found."
else
cd ~/bin
wget --no-check-certificate https://github.com/downloads/ufz/devguide/7za.exe
fi fi
echo "Visual Studio found: $DEVENV"
fi fi
cd "$SOURCE_LOCATION/scripts/setup"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment