[Kst] branches/work/kst/portto4/kst

Peter Kümmel syntheticpp at gmx.net
Sun Oct 14 20:56:40 UTC 2012


SVN commit 1320522 by kuemmel:

use mingw 4.7.2 on build server

qmake must be in PATH

 M  +2 -2      .travis.yml  
 M  +7 -3      cmake/misc/CMakeLists.txt  
 M  +2 -7      cmake/modules/KstCrossCompile.cmake  
 M  +52 -11    cmake/travis.sh  


--- branches/work/kst/portto4/kst/.travis.yml #1320521:1320522
@@ -7,9 +7,9 @@
 
       
 install:
- - sudo apt-get remove cmake mingw32-binutils mingw32-runtime mingw32 qt4-qmake
+ - sudo apt-get remove cmake mingw32-binutils mingw32-runtime mingw32 libqt4-dev qt4-qmake mingw-w64 g++-mingw-w64 gcc-mingw-w64
+ - sudo apt-get install m4 bison flex
  - sudo apt-get autoremove
- - sudo apt-get install mingw-w64 g++-mingw-w64
 
 script:
 # - ./cmake/travis.sh qt4
--- branches/work/kst/portto4/kst/cmake/misc/CMakeLists.txt #1320521:1320522
@@ -39,10 +39,11 @@
 endif()
 
 if(MINGW)
+	get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
 	if(kst_cross)
-		set(MINGW_BIN_PATH /usr/lib/gcc/${kst_cross}/4.6)
-	else()
-		get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
+		# TODO hard coded paths
+		get_filename_component(mingw_name ${kst_cross} NAME)
+		set(MINGW_BIN_PATH ${MINGW_BIN_PATH}/../${mingw_name}/lib)
 	endif()
 	if(EXISTS ${MINGW_BIN_PATH}/libgcc_s_sjlj-1.dll)
 		list(APPEND runtime ${MINGW_BIN_PATH}/libgcc_s_sjlj-1.dll)
@@ -52,6 +53,9 @@
 	if(EXISTS ${MINGW_BIN_PATH}/libstdc++-6.dll)
 		list(APPEND runtime ${MINGW_BIN_PATH}/libstdc++-6.dll)
 	endif()
+	if(NOT runtime)
+		message(FATAL_ERROR "No mingw runtime found in ${MINGW_BIN_PATH}")
+	endif()
 	install(FILES ${runtime} DESTINATION bin)
 endif()
 
--- branches/work/kst/portto4/kst/cmake/modules/KstCrossCompile.cmake #1320521:1320522
@@ -3,10 +3,10 @@
 
 # MinGW on Ubuntu: i686-w64-mingw32/x86_64-w64-mingw32 or i586-mingw32msvc
 set(TOOLNAME ${kst_cross})
-set(TOOLCHAIN "/usr/bin/${TOOLNAME}-")
+set(TOOLCHAIN "${TOOLNAME}-")
 set(CMAKE_C_COMPILER   "${TOOLCHAIN}gcc"     CACHE PATH "Mingw C compiler" FORCE)
 set(CMAKE_CXX_COMPILER "${TOOLCHAIN}g++"     CACHE PATH "Mingw C++ compiler" FORCE)
-set(CMAKE_RC_COMPILER  "${TOOLCHAIN}windres" CACHE PATH "Mingw C++ compiler" FORCE)
+set(CMAKE_RC_COMPILER  "${TOOLCHAIN}windres" CACHE PATH "Mingw rc compiler" FORCE)
 
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
@@ -18,8 +18,3 @@
 	set(CMAKE_FIND_ROOT_PATH /usr/${TOOLNAME} ${QT_MINGW_DIR} CACHE PATH "Mingw find root path" FORCE)
 endif()
 
-set(QT_QMAKE_EXECUTABLE ${QT_MINGW_DIR}/bin/qmake CACHE PATH "Qt's qmake" FORCE)
-set(QT_BINARY_DIR       ${QT_MINGW_DIR}/bin       CACHE PATH "Qt's bin dir" FORCE)
-
-
-message(STATUS "Using qmake from ${QT_QMAKE_EXECUTABLE}")
--- branches/work/kst/portto4/kst/cmake/travis.sh #1320521:1320522
@@ -6,6 +6,10 @@
 startdir=$PWD
 
 
+# ---------------------------------------------------------
+# 
+# helper function to check return code
+#
 checkExitCode() {
     exitcode=$?
     if [ $exitcode -ne 0 ]; then
@@ -15,10 +19,14 @@
 }
 
 
+# ---------------------------------------------------------
 #
 # print some info about the system
 #
-echo ------ System
+echo
+echo ----------------------------------- 
+echo Build system:
+echo
 uname -a
 lsb_release -a
 processors=`grep -c processor /proc/cpuinfo`
@@ -30,9 +38,11 @@
     sudo rm -rf /usr/lib/jvm
     df -h
 fi
-echo ------ 
+echo ----------------------------------- 
+echo
 
 
+# ---------------------------------------------------------
 #
 # make build directory
 #
@@ -47,15 +57,18 @@
 cd $builddir
 
 
+# ---------------------------------------------------------
 #
 # select mingw version
 #
 mingw=i686-w64-mingw32
 
 
+# ---------------------------------------------------------
 #
 # get actual cmake 
 #
+# TODO check for cmake
 if [ "$iam" = "$travis" ]; then
     cd ..
     if [ ! -d $PWD/cmake-2.8.9-Linux-i386 ]; then
@@ -68,52 +81,80 @@
     cmakebin=cmake
 fi
 
+
+# ---------------------------------------------------------
 #
+# download and install mingw
+#
+if [ ! -d /opt/mingw32 ]; then
+    mingwtar=i686-w64-mingw32-gcc-4.7.2-release-linux32_rubenvb-Ubuntu32-12.04-1.tar
+    wget https://github.com/downloads/syntheticpp/kst/$mingwtar.xz
+    checkExitCode
+    xz -d $mingwtar.xz
+    cd /opt
+    sudo tar xf $builddir/$mingwtar
+    checkExitCode
+    cd $builddir
+fi
+# when cross-compiler is in path cmake assumes it is a native compiler and passes "-rdynamic" which mingw doesn't support
+#export PATH=/opt/mingw32/bin:$PATH
+echo Checking mingw installation ...
+/opt/mingw32/bin/i686-w64-mingw32-gcc -dumpversion
+checkExitCode
+
+
+# ---------------------------------------------------------
+#
 # download and install Qt
 #
 if [ "$1" = "qt5" ]; then
     qtver=5.0.0
+    gccver=-4.7.2
 else
     qtver=4.8.3
 fi
-qtver=Qt-$qtver-win32-g++-$mingw
+qtver=Qt-$qtver-win32-g++-$mingw$gccver
     
 if [ ! -d /opt/$qtver ]; then
     qttar=$qtver-Ubuntu32-12.04-1.tar
     wget https://github.com/downloads/syntheticpp/kst/$qttar.xz
     checkExitCode
     xz -d $qttar.xz
-    cd /
+    cd /opt
     sudo tar xf $builddir/$qttar
     checkExitCode
+    cd $builddir
+fi
+export PATH=/opt/$qtver/bin:$PATH
     echo Checking Qt installation ...
-    readelf -h  /opt/$qtver/bin/qmake
-    /opt/$qtver/bin/qmake -query
+which qmake
     checkExitCode
-    export PATH=/opt/$qtver/bin:$PATH
-fi
 
+
+# ---------------------------------------------------------
 #
 # build Kst
 #
 date=`date --utc '+%Y.%m.%d-%H.%M'`
-ver=2.0.6
+ver=2.0.x
 cd $builddir
 if [ "$1" = "qt5" ]; then
     ver=$ver-Qt5
-    qtopt="-Dkst_qt5=/opt/$qtver -Dkst_opengl=0"
+    qtopt="-Dkst_qt5=1 -Dkst_opengl=0"
 else
     ver=$ver-Qt4
     qtopt="-Dkst_qt4=/opt/$qtver -Dkst_opengl=0"
 fi
+
 installed=Kst-$ver-$date
-$cmakebin ../kst/cmake/ -Dkst_release=1 -Dkst_version_string=$ver-$date -Dkst_cross=$mingw -Dkst_install_prefix=./$installed $qtopt
+$cmakebin ../kst/cmake/ -Dkst_release=1 -Dkst_version_string=$ver-$date -Dkst_cross=/opt/mingw32/bin/$mingw -Dkst_install_prefix=./$installed $qtopt
 checkExitCode
 
 make -j $processors
 checkExitCode
 
 
+# ---------------------------------------------------------
 #
 # deploy
 #


More information about the Kst mailing list