Commit 5fffd3c3 authored by Leander Schulten's avatar Leander Schulten
Browse files

Use CMake in pipeline

parent e76bc2ae
Pipeline #444118 passed with stage
in 8 minutes and 30 seconds
image: registry.git.rwth-aachen.de/leander.schulten/lichtsteuerung/build_qt_5_15_0:latest
image: registry.git.rwth-aachen.de/leander.schulten/lichtsteuerung/build_qt_5.15.2:latest
stages:
- build
......@@ -8,23 +8,32 @@ stages:
build:
stage: build
script:
- git submodule update --init --recursive
- rm -rf vcpkg/packages vcpkg/buildtrees
- CC=/usr/bin/gcc
- CXX=/usr/bin/g++
- export VCPKG_BINARY_SOURCES="clear;files,$CI_PROJECT_DIR/vcpkg_cache,readwrite"
- ./vcpkg/bootstrap-vcpkg.sh
- cp x64-linux-windows-static.cmake ./vcpkg/triplets/community
#- ./vcpkg/vcpkg install --triplet=x64-linux-windows-static --feature-flags=manifests
- cd src/lib
- ./build_libs.sh
- cd ../..
- mkdir -p build
- cd build
- /usr/src/mxe/usr/x86_64-w64-mingw32.shared.posix/qt5/bin/qmake ../src/Lichtsteuerung.pro
- make -j$(nproc)
- cmake -G Ninja .. -DVCPKG_TARGET_TRIPLET=x64-linux-windows-static
- ninja
- cd ..
cache:
key: build_boost
key: vcpkg_cache
paths:
- src/lib/boost/
- vcpkg_cache/
artifacts:
# when: always
paths:
- build/release/Lichtsteuerung.exe
- src/lib/boost/lib/libboost_context-mt-x64.dll
- src/lib/boost/lib/libboost_coroutine-mt-x64.dll
- build/src/lichtsteuerung.exe
# - vcpkg/buildtrees/libbacktrace
# - build/vcpkg_installed/
# we use this version file to check if a new version exists
version:
......@@ -47,8 +56,6 @@ deploy:
- windows-release
script:
- cp build/release/Lichtsteuerung.exe windows-release
- cp src/lib/boost/lib/libboost_context-mt-x64.dll windows-release
- cp src/lib/boost/lib/libboost_coroutine-mt-x64.dll windows-release
- mkdir -p windows-release/modulesHeader
- cp -r src/modules windows-release/modulesHeader
- echo "includePath=modulesHeader" >> windows-release/settings.ini
......
......@@ -2,8 +2,14 @@ cmake_minimum_required(VERSION 3.12.0)
# vcpkg integration
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "./vcpkg/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
set(CMAKE_TOOLCHAIN_FILE "./vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
elseif(DEFINED CMAKE_TOOLCHAIN_FILE AND NOT CMAKE_TOOLCHAIN_FILE MATCHES ".+/vcpkg/scripts/buildsystems/vcpkg.cmake$")
message(STATUS "CMAKE_TOOLCHAIN_FILE is already set to '${CMAKE_TOOLCHAIN_FILE}', replace it with the vcpkg one and set VCPKG_CHAINLOAD_TOOLCHAIN_FILE to original CMAKE_TOOLCHAIN_FILE")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE})
set(CMAKE_TOOLCHAIN_FILE "./vcpkg/scripts/buildsystems/vcpkg.cmake")
else()
message(STATUS "CMAKE_TOOLCHAIN_FILE is already set to '${CMAKE_TOOLCHAIN_FILE}'")
message(STATUS "VCPKG_CHAINLOAD_TOOLCHAIN_FILE is already set to '${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}'")
endif()
project(lichtsteuerung VERSION 2.0.0 LANGUAGES CXX)
......
......@@ -136,10 +136,13 @@ elseif(WIN32)
endif()
# boost
if(APPLE) # don't use boost on mac. See https://github.com/microsoft/vcpkg/issues/16052
target_link_libraries(lichtsteuerung "-L/usr/local/lib -lboost_coroutine -lboost_context-mt")
if(DEFINED ENV{GITLAB_CI})
# use `message(STATUS "${Boost_LIBRARIES}")` to find out which libs are needed
# use this as a workaround until https://github.com/microsoft/vcpkg/issues/17163 is fixed
target_link_libraries(lichtsteuerung "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libboost_thread.a;${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libboost_context.a;${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libboost_coroutine.a;${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libboost_chrono.a;${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libboost_date_time.a;${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libboost_atomic.a")
target_include_directories(lichtsteuerung PRIVATE "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
else()
find_package(Boost REQUIRED COMPONENTS context coroutine thread)
find_package(Boost 1.75.0 REQUIRED COMPONENTS thread context coroutine)
target_link_libraries(lichtsteuerung ${Boost_LIBRARIES})
target_include_directories(lichtsteuerung PRIVATE ${Boost_INCLUDE_DIRS})
endif()
......@@ -195,7 +198,11 @@ target_link_libraries(lichtsteuerung segvcatch)
# Quazip
target_include_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/include)
#target_link_directories(lichtsteuerung PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/lib)
if(UNIX)
if(DEFINED ENV{GITLAB_CI})
# in the gitlab CI quazip and zlib is build by mxe
target_link_directories(lichtsteuerung PRIVATE /usr/src/mxe/usr/x86_64-w64-mingw32.shared.posix/bin)
target_link_libraries(lichtsteuerung quazip zlib1)
elseif(UNIX)
target_link_libraries(lichtsteuerung "-L${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/lib -lQt5Quazip")
target_link_libraries(lichtsteuerung "-lz")
elseif(WIN32)
......
......@@ -10,26 +10,6 @@ cd segvcatch
./build.sh
cd ..
echo $'\n\nBuild libbacktrace'
cd libbacktrace
./build.sh
cd ..
echo $'\n\nBuild boost'
cd boost
./installOrBuild.sh
cd ..
echo $'\n\nBuild Aubio'
cd aubio
./build_aubio.sh
cd ..
echo $'\n\nBuild RtAudio'
cd RtAudio
./build_rtAudio.sh
cd ..
echo $'\n\nUpdate Qt MQTT'
cd qtmqtt
./getAndUpdate.sh
......
Subproject commit 8203c4aa0bc60cda53edb7be3284115ca64c2e13
Subproject commit 4abcef27e03e7456d189ce9b4f8ac9aee4201e7d
......@@ -5,6 +5,7 @@
"boost-coroutine",
"boost-coroutine2",
"boost-stacktrace",
"libbacktrace",
"span-lite",
"rtaudio",
{
......
# from https://stackoverflow.com/questions/58777810/how-to-integrate-vcpkg-in-linux-with-cross-build-toolchain-as-well-as-sysroot
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME MinGW)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /usr/src/mxe/usr/x86_64-w64-mingw32.shared.posix/share/cmake/mxe-conf.cmake)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment