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

Peter Kümmel syntheticpp at gmx.net
Mon Aug 27 19:53:34 UTC 2012


SVN commit 1313624 by kuemmel:

cross-compile with Qt5

 M  +4 -4      .travis.yml  
 M  +1 -0      cmake/CMakeLists.txt  
 M  +11 -0     cmake/misc/CMakeLists.txt  
 M  +4 -1      cmake/modules/KstCrossCompile.cmake  
 M  +33 -3     cmake/travis.sh  


--- branches/work/kst/portto4/kst/.travis.yml #1313623:1313624
@@ -1,19 +1,19 @@
 # Travis-CI Build for kst2
 # see travis-ci.org for details
 
-language: cpp
+language: erlang
 
       
 install:
- - sudo apt-get remove mingw32-binutils mingw32-runtime mingw32 qt4-qmake
+ - sudo apt-get remove cmake mingw32-binutils mingw32-runtime mingw32 qt4-qmake
  - sudo apt-get autoremove
- - sudo apt-get install cmake mingw-w64
+ - sudo apt-get install mingw-w64
 
 script:
  - ./cmake/travis.sh w64
+# - ./cmake/travis.sh w64 qt5
 
 branches:
  only:
    - master
    
-
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1313623:1313624
@@ -144,6 +144,7 @@
         endif()
 	add_definitions(-DQT5=1)
 	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG")
+	set(QT_BINARY_DIR ${kst_qt5}/bin)
 else()
 	find_package(Qt4 REQUIRED)
 	include(${QT_USE_FILE})
--- branches/work/kst/portto4/kst/cmake/misc/CMakeLists.txt #1313623:1313624
@@ -1,7 +1,17 @@
 # install runtime files
 
 if(WIN32)
+	if (kst_qt5)
 	install(FILES
+			${QT_BINARY_DIR}/QtCore5.dll
+			${QT_BINARY_DIR}/QtGui5.dll
+			${QT_BINARY_DIR}/QtWidgets5.dll
+			${QT_BINARY_DIR}/QtXml5.dll
+			${QT_BINARY_DIR}/QtNetwork5.dll				
+			DESTINATION bin
+			CONFIGURATIONS Release)
+	else()
+		install(FILES
 		${QT_BINARY_DIR}/QtCore4.dll
 		${QT_BINARY_DIR}/QtGui4.dll
 		${QT_BINARY_DIR}/QtXml4.dll
@@ -20,6 +30,7 @@
 		DESTINATION bin
 		CONFIGURATIONS Debug)
 endif()
+endif()
 
 if(MINGW AND NOT kst_cross)
 	get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
--- branches/work/kst/portto4/kst/cmake/modules/KstCrossCompile.cmake #1313623:1313624
@@ -12,11 +12,14 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 
+if (NOT kst_qt5)
 # Cross-compiled Qt, branch cross-mingw from https://gitorious.org/~syntheticpp/qt/qt4
 set(QT_MINGW_DIR /usr/local/Trolltech/Qt-win32-g++-${TOOLNAME} CACHE PATH "Qt for Mingw" FORCE)
+	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)
 
-set(CMAKE_FIND_ROOT_PATH /usr/${TOOLNAME} ${QT_MINGW_DIR} CACHE PATH "Mingw find root path" FORCE)
 
 message(STATUS "Using qmake from ${QT_QMAKE_EXECUTABLE}")
--- branches/work/kst/portto4/kst/cmake/travis.sh #1313623:1313624
@@ -58,8 +58,32 @@
 
 
 #
+# get actual cmake 
+#
+cd ..
+wget http://www.cmake.org/files/v2.8/cmake-2.8.9-Linux-i386.tar.gz
+tar xf cmake-2.8.9-Linux-i386.tar.gz
+cmakebin=$PWD/cmake-2.8.9-Linux-i386/bin/cmake
+cd $builddir
+
+#
 # download and install Qt
 #
+if [ "$2" = "qt5" ]; then
+    if [ ! -d /usr/local/Qt-5.0.0-win32-g++-$mingw ]; then
+        qttar=Qt-5.0.0-win32-g++-$mingw-4.6.1-Ubuntu-11.10.tar
+        qt=$builddir/$qttar
+        wget https://github.com/downloads/syntheticpp/kst/$qttar.bz2
+        checkExitCode
+        bzip2 -d $qttar.bz2
+        cd /usr/local
+        sudo tar xf $qt
+        checkExitCode
+        echo Checking Qt installation ...
+        /usr/local/Qt-5.0.0-win32-g++-$mingw/bin/qmake -query
+        checkExitCode
+    fi
+else
 if [ ! -d /usr/local/Trolltech/Qt-win32-g++-$mingw ]; then
     #qttar=Qt-win32-g++-$mingw-4.6.3-dlls-Ubuntu-12.04.tar
     qttar=Qt-win32-g++-$mingw-4.6.1-Ubuntu-11.10.tar
@@ -74,16 +98,22 @@
     /usr/local/Trolltech/Qt-win32-g++-$mingw/bin/qmake -query
     checkExitCode
 fi
+fi
 
-
 #
 # build Kst
 #
 date=`date --utc '+%Y.%m.%d-%H.%M'`
 ver=2.0.6
+cd $builddir
+if [ "$2" = "qt5" ]; then
+    ver=$ver-Qt5
+    qt5opt="-Dkst_qt5=/usr/local/Qt-5.0.0-win32-g++-$mingw -Dkst_opengl=0"
+else
+	ver=$ver-Qt4
+fi
 installed=Kst-$ver-$date
-cd $builddir
-cmake ../kst/cmake/ -Dkst_release=1 -Dkst_version_string=$ver-$date -Dkst_cross=$mingw -Dkst_install_prefix=./$installed
+$cmakebin ../kst/cmake/ -Dkst_release=1 -Dkst_version_string=$ver-$date -Dkst_cross=$mingw -Dkst_install_prefix=./$installed $qt5opt
 checkExitCode
 
 make -j $processors


More information about the Kst mailing list