Skip to content

Commit

Permalink
Switch to Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
kleag committed Apr 19, 2024
1 parent 34cd1eb commit 0402dcd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ env:
jobs:

#========================================================================
debian11_qhttpserver:
name: "Build the package for Debian 11"
debian12_qhttpserver:
name: "Build the package for Debian 12"
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -33,12 +33,12 @@ jobs:
large-packages: false
swap-storage: true
- name: Build image
run: docker build -f ./Dockerfile-debian11 -t aymara/qhttpserver-debian11:build .
run: docker build -f ./Dockerfile-debian12 -t aymara/qhttpserver-debian12:build .
- name: Extract package and version number from docker image
id: extract
shell: bash
run: |
dockerImage="aymara/qhttpserver-debian11:build"
dockerImage="aymara/qhttpserver-debian12:build"
packageDir="/usr/share/apps/qhttpserver/packages/"
cicd/extract_package.sh $dockerImage $packageDir $GITHUB_OUTPUT
- name: Upload nightly build package
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ set(CMAKE_PREFIX_PATH

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -lpthread")

# It is necessary to define Qt5_INSTALL_DIR in your environment.
# It is necessary to define Qt6_INSTALL_DIR in your environment.
set(CMAKE_PREFIX_PATH
"$ENV{Qt5_INSTALL_DIR}"
"$ENV{Qt6_INSTALL_DIR}"
"${CMAKE_PREFIX_PATH}"
)

Expand All @@ -108,15 +108,15 @@ endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Network)
set(Qt5_LIBRARIES Qt5::Core Qt5::Network )
message("Found Qt5 ${Qt5Core_VERSION}")
find_package(Qt6 REQUIRED COMPONENTS Core Network)
set(Qt6_LIBRARIES Qt6::Core Qt6::Network )
message("Found Qt6 ${Qt6Core_VERSION}")

message("\n\n\n{Qt5_LIBRARIES}=${Qt5_LIBRARIES} ")
message("\n\n\n{Qt6_LIBRARIES}=${Qt6_LIBRARIES} ")

if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
get_target_property(QtCore_location Qt5::Core LOCATION)
get_target_property(QtNetwork_location Qt5::Network LOCATION)
get_target_property(QtCore_location Qt6::Core LOCATION)
get_target_property(QtNetwork_location Qt6::Network LOCATION)
install(FILES ${QtCore_location}
${QtNetwork_location}
DESTINATION ${LIB_INSTALL_DIR})
Expand Down
24 changes: 24 additions & 0 deletions Dockerfile-debian12
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM debian:12

ARG TRAVIS_JOB_NUMBER
ENV DEBIAN_FRONTEND=noninteractive

# Setup
RUN apt-get update -y -qq && apt-get install -y apt-utils wget bzip2 git gcc g++ cmake cmake-data ninja-build qt6-base-dev-tools qt6-declarative-dev packaging-dev -qq
RUN mkdir -p /src/
RUN git clone https://github.com/aymara/qhttpserver /src/qhttpserver

RUN mkdir -p /src/qhttpserver/build

# Build
WORKDIR /src/qhttpserver/build
RUN cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
RUN ninja all && ninja package
RUN echo "export packagefile=`find /src/qhttpserver/build/ -maxdepth 1 -name *.deb`" > /envfile
RUN echo "export fullname=\$(basename -- \$packagefile)" >> /envfile
RUN echo "export extension=\${fullname##*.}" >> /envfile
RUN echo "export filename=\${fullname%.*}" >> /envfile
RUN . /envfile && install -D ${packagefile} "/usr/share/apps/qhttpserver/packages/${filename}-debian11.deb"

## install github-release to be able to deploy packages
#RUN wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 && tar xjf linux-amd64-github-release.tar.bz2 && cp bin/linux/amd64/github-release /usr/bin
3 changes: 1 addition & 2 deletions Dockerfile-ubuntu22.04
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive

# Setup
RUN apt-get update -y -qq
RUN apt-get install -y apt-utils wget bzip2 git gcc g++ cmake cmake-data ninja-build qtbase5-dev-tools qtdeclarative5-dev packaging-dev -qq
RUN apt-get update -y -qq && apt-get install -y apt-utils wget bzip2 git gcc g++ cmake cmake-data ninja-build qt6-base-dev-tools qt6-declarative-dev packaging-dev -qq
RUN mkdir -p /src/
RUN git clone https://github.com/aymara/qhttpserver /src/qhttpserver

Expand Down

0 comments on commit 0402dcd

Please sign in to comment.