Use Travis Windows image for Windows CI
MODIFY
.travis.yml
.travis.yml
-
-
matrix:
include:
@@ -12,15 +10,20 @@ matrix:
packages:
- tree
- - env: RIPES_PLATFORM='windows'
- os: linux
- dist: trusty
- sudo: required
- language: c++
- addons:
- apt:
- packages:
- - tree
+ #- env: RIPES_PLATFORM='windows'
+ # os: linux
+ # dist: trusty
+ # sudo: required
+ # language: c++
+ # addons:
+ # apt:
+ # packages:
+ # - tree
+
+ - os: windows
+ language: cpp
+ env:
+ - RIPES_PLATFORM: 'windows'
- env: RIPES_PLATFORM='linux'
os: linux

MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -25,8 +25,8 @@ include_directories(${Qt5Core_INCLUDE_DIRS})
######################################################################
## Resources setup
######################################################################
-qt5_add_resources(ICONS_SRC "resources/icons/icons.qrc")
-qt5_add_resources(EXAMPLES_SRC "examples/examples.qrc")
+qt5_add_resources(ICONS_SRC ${CMAKE_SOURCE_DIR}/resources/icons/icons.qrc)
+qt5_add_resources(EXAMPLES_SRC ${CMAKE_SOURCE_DIR}/examples/examples.qrc)
######################################################################
## Library setup
@@ -39,7 +39,11 @@ endif()
add_subdirectory(external)
add_subdirectory(src)
+
+option(RIPES_BUILD_TESTS "Build Ripes tests" OFF)
+if(RIPES_BUILD_TESTS)
add_subdirectory(test)
+endif()
set(APP_NAME Ripes)
add_executable(${APP_NAME} ${SYSTEM_FLAGS} ${ICONS_SRC} ${EXAMPLES_SRC} main.cpp)

MODIFY
scripts/windows/after_success.sh
scripts/windows/after_success.sh
@@ -5,5 +5,5 @@ set -e
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_EVENT_TYPE" = "push" ]; then
echo "Uploading to git"
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh Ripes*.exe
+ bash upload.sh ${APPNAME}
fi

MODIFY
scripts/windows/before_install.sh
scripts/windows/before_install.sh
set -e
-sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9
-sudo add-apt-repository 'deb [arch=amd64] http://mirror.mxe.cc/repos/apt trusty main'
+export QT_VERSION=5.13.1
+export QT_PREFIX=msvc2017_64
+export QT_TOOLCHAIN=win64_${QT_PREFIX}
+export CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
-sudo apt-get update
+# Fetch and install Qt using the qbs non-interactive qt installer script
+curl -vLO https://code.qt.io/cgit/qbs/qbs.git/plain/scripts/install-qt.sh
+bash install-qt.sh \
+ --version ${QT_VERSION} \
+ --toolchain ${QT_TOOLCHAIN}\
+ qtbase qttools svg
-export MXE_TARGET=i686-w64-mingw32.static #x86-64-w64-mingw32.static
-
-MXE2_TARGET=$(echo "$MXE_TARGET" | sed 's/_/-/g')
-sudo apt-get --yes install \
- mxe-${MXE2_TARGET} || true
+choco install zip

MODIFY
scripts/windows/travisbuild.sh
scripts/windows/travisbuild.sh
set -e
-echo $MXE_TARGET
-MXE_DIR=/usr/lib/mxe
+export CMAKE_PREFIX_PATH=/c/Qt/${QT_VERSION}/${QT_PREFIX}:${CMAKE_PREFIX_PATH}
+export PATH=/c/Qt/${QT_VERSION}/${QT_PREFIX}/bin:${PATH}
-export PATH=$MXE_DIR/usr/bin:$PATH
-export CMAKE_PREFIX_PATH=${MXE_DIR}/usr/${MXE_TARGET}/qt5/:$CMAKE_PREFIX_PATH
+cmake . -G "${CMAKE_GENERATOR}"
-export RIPES_CFG="release"
+find /c/Qt/${QT_VERSION}/${QT_PREFIX}/bin
-$MXE_TARGET-cmake .
-make -j $(nproc)
+cmake --build . \
+ -j$(nproc) \
+ --config Release
-echo "Post build folder contents:"
-ls -lh
+# Copy dependencies using windeployqt
+pushd Release
+APPNAME=Ripes-continuous-win-x86_64.zip
+windeployqt.exe -svg --release Ripes.exe
-APPNAME=Ripes-continuous-win-x86_64
-sudo mv Ripes.exe $APPNAME.exe
\ No newline at end of file
+# Clean up some unused stuff
+rm -rf translations
+
+# Bundle
+zip -r ${APPNAME} .
+popd
+mv Release/${APPNAME} .
\ No newline at end of file

MODIFY
test/CMakeLists.txt
test/CMakeLists.txt
@@ -5,12 +5,11 @@ file(GLOB TST_SOURCES *.cpp)
find_package(Qt5Test REQUIRED)
macro(create_qtest name)
- add_executable(${name} ${name}.cpp)
+ add_executable(${name} ${ICONS_SRC} ${EXAMPLES_SRC} ${name}.cpp)
add_test(${name} ${name})
target_include_directories (${name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${name} Qt5::Core Qt5::Widgets Qt5::Test)
target_link_libraries(${name} ripes_lib)
- target_link_libraries(${name} ${ICONS_SRC} ${EXAMPLES_SRC})
endmacro()
create_qtest(testall)

Use Travis Windows image for Windows CI