Skip to content

Commit 3ecff2a

Browse files
committed
Merge branch 'develop'
2 parents 144d320 + 9f1cdd3 commit 3ecff2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1425
-326
lines changed

.github/workflows/deploy-linux-appimage.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
container:
12+
image: ghcr.io/${{ github.repository }}/ubuntu:feature-docker_build_appimage
13+
options: --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined
1114
steps:
1215
- name: Checkout code
1316
uses: actions/checkout@v2
1417
with:
1518
submodules: true
16-
- name: Install package
17-
run: |
18-
sudo apt-get update
19-
sudo apt-get -y install qtbase5-dev qt3d5-dev libqt5svg5-dev freeglut3-dev libfuse2
19+
fetch-depth: 0
2020
- name: Build and test
2121
run: ci/buildappimage.sh
22+
env:
23+
LD_LIBRARY_PATH: /opt/lib
2224
- name: Create Release
2325
uses: softprops/action-gh-release@v1
2426
with:

.github/workflows/deploy-windows.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,48 @@ on:
44
# Sequence of patterns matched against refs/tags
55
tags:
66
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
env:
9+
Qt_ROOT: ../Qt/6.8.2/msvc2022_64/
710

811
jobs:
912
build:
1013
runs-on: windows-latest
1114
steps:
1215
- name: Cache Qt
1316
id: cache-qt
14-
uses: actions/cache@v1 # not v2!
17+
uses: actions/cache@v4
1518
with:
1619
path: ../Qt
17-
key: ${{ runner.os }}-QtCache
18-
20+
key: ${{ runner.os }}-QtCache
21+
- name: Install python packages
22+
shell: bash
23+
run: python -m pip install jinja2 aqtinstall
1924
- name: Install Qt
20-
uses: jurplel/install-qt-action@v2
21-
with:
22-
cached: ${{ steps.cache-qt.outputs.cache-hit }}
23-
- uses: lukka/get-cmake@latest
24-
- name: Add msbuild to PATH
25-
uses: microsoft/[email protected]
26-
- name: Install jinja2
2725
shell: bash
28-
run: python -m pip install jinja2
26+
run: aqt install-qt -O ../Qt windows desktop 6.8.2 win64_msvc2022_64 -m qt3d qtshadertools
2927
- name: Install zip
3028
shell: bash
3129
run: choco install -y zip
30+
- name: Install ortools
31+
shell: bash
32+
run: |
33+
C:/msys64/usr/bin/wget.exe https://github.com/google/or-tools/releases/download/v9.10/or-tools_x64_VisualStudio2022_cpp_v9.10.4067.zip
34+
unzip or-tools_x64_VisualStudio2022_cpp_v9.10.4067.zip -d ../
3235
- name: Checkout
3336
uses: actions/checkout@v2
3437
with:
3538
submodules: true
39+
fetch-depth: 0
3640
- name: CMake
3741
shell: bash
3842
run: |
39-
mkdir build
40-
cd build
41-
cmake -DBUILD_TESTING=OFF ..
43+
cmake -B build -DBUILD_TESTING=OFF -DQt6_DIR=${Qt_ROOT}/lib/cmake/Qt6 -DCMAKE_PREFIX_PATH=../or-tools_x64_VisualStudio2022_cpp_v9.10.4067
4244
- name: Build
43-
run: msbuild build\dxfplotter.sln /property:Configuration=Release
45+
run: cmake --build build --config Release
4446
- name: Deploy Qt
4547
shell: bash
46-
run: ci/deploywindows.sh
48+
run: PATH=$PATH:${Qt_ROOT}/bin ci/deploywindows.sh
4749
- name: Create Release
4850
uses: softprops/action-gh-release@v1
4951
with:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
paths:
5+
- "ci/docker/ubuntu/**"
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}/ubuntu
10+
11+
jobs:
12+
build-ubuntu-docker:
13+
permissions:
14+
contents: read
15+
packages: write
16+
# This is used to complete the identity challenge
17+
# with sigstore/fulcio when running outside of PRs.
18+
id-token: write
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
- name: Log into registry ${{ env.REGISTRY }}
24+
if: github.event_name != 'pull_request'
25+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Extract Docker metadata
31+
id: meta
32+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
- name: Build and push Docker image
36+
uses: docker/build-push-action@v4
37+
with:
38+
context: ci/docker/ubuntu/
39+
file: ci/docker/ubuntu/Dockerfile
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/sonarcloud.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,13 @@ on:
77
jobs:
88
static_analysis:
99
runs-on: ubuntu-latest
10+
container:
11+
image: ghcr.io/${{ github.repository }}/ubuntu:develop
1012
steps:
1113
- name: Checkout
1214
uses: actions/checkout@v2
1315
with:
1416
submodules: true
15-
- name: Install package
16-
run: |
17-
sudo apt-get update
18-
sudo apt-get -y install qtbase5-dev qt3d5-dev libqt5svg5-dev freeglut3-dev lcov
19-
- name: Install build wrapper
20-
run: |
21-
wget http://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
22-
unzip build-wrapper-linux-x86.zip
23-
- name: Install sonar scanner
24-
run: |
25-
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
26-
unzip sonar-scanner-cli-4.6.2.2472-linux.zip
2717
- name: Build and scan
2818
run: ci/buildsonarcloud.sh
2919
env:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "thirdparty/fmt"]
1414
path = thirdparty/fmt
1515
url = https://github.com/fmtlib/fmt.git
16+
[submodule "thirdparty/or-tools"]
17+
path = thirdparty/or-tools
18+
url = https://github.com/google/or-tools.git

CMakeLists.txt

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cmake_minimum_required(VERSION 3.15)
2+
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
3+
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
24

35
project(dxfplotter)
46

@@ -15,30 +17,36 @@ set(CMAKE_AUTORCC ON)
1517
set(CMAKE_AUTOUIC OFF)
1618
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1719

18-
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
1920

2021
set(BUILD_TESTS OFF)
22+
set(BUILD_SAMPLES OFF)
23+
set(BUILD_EXAMPLES OFF)
24+
set(USE_SCIP OFF)
25+
set(USE_COINOR OFF)
26+
set(BUILD_FLATZINC OFF)
27+
set(USE_HIGHS OFF)
2128
set(JUST_INSTALL_CEREAL ON)
2229

23-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
30+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
2431

2532
# Compilation flag with all warnings.
2633
if(MSVC)
27-
add_compile_options(/W4)
34+
add_compile_options(/W4 /Zc:__cplusplus)
2835
else()
29-
add_compile_options(-fPIC -Wall -Wextra)
36+
add_compile_options(-fPIC -Wall -Wextra -DNDEBUG)
3037
endif()
3138

32-
set(CMAKE_CXX_STANDARD 17)
39+
set(CMAKE_CXX_STANDARD 20)
3340
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3441

3542
set(TEMPLATE_DIR ${PROJECT_SOURCE_DIR}/template)
3643

3744
find_package(codecov)
3845

3946
find_package(PythonInterp REQUIRED)
47+
find_package(ortools CONFIG REQUIRED)
4048

41-
find_package(Qt5 COMPONENTS REQUIRED
49+
find_package(Qt6 COMPONENTS REQUIRED
4250
Core
4351
Widgets
4452
Gui
@@ -47,7 +55,9 @@ find_package(Qt5 COMPONENTS REQUIRED
4755
3DExtras
4856
)
4957

50-
#qt_standard_project_setup()
58+
qt_standard_project_setup()
59+
60+
add_definitions(${Qt6Core_DEFINITIONS})
5161

5262
set(INCLUDE_DIRS
5363
src
@@ -57,14 +67,14 @@ set(INCLUDE_DIRS
5767
thirdparty/fmt/include
5868
thirdparty/nanoflann/include
5969
thirdparty/units/include
60-
thirdparty/yaml-cpp/include
70+
thirdparty/or-tools
6171
template
6272
${CMAKE_BINARY_DIR}/src
6373
${CMAKE_BINARY_DIR}/template
64-
${Qt5Widgets_INCLUDE_DIRS}
65-
${Qt5Gui_INCLUDE_DIRS}
66-
${Qt53DCore_INCLUDE_DIRS}
67-
${Qt53DExtras_INCLUDE_DIRS}
74+
${Qt6Widgets_INCLUDE_DIRS}
75+
${Qt6Gui_INCLUDE_DIRS}
76+
${Qt63DCore_INCLUDE_DIRS}
77+
${Qt63DExtras_INCLUDE_DIRS}
6878
)
6979

7080
set(LINK_LIBRARIES
@@ -87,11 +97,10 @@ set(LINK_LIBRARIES
8797
geometry-filter
8898
libdxfrw
8999
fmt::fmt
90-
Qt5::Widgets
91-
Qt5::Svg
92-
Qt5::3DCore
93-
Qt5::3DExtras
94-
yaml-cpp
100+
Qt6::Widgets
101+
Qt6::Svg
102+
Qt6::3DCore
103+
Qt6::3DExtras
95104
)
96105

97106
include_directories(${INCLUDE_DIRS})

ci/buildappimage.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ trap cleanup EXIT
2525
REPO_ROOT=$(readlink -f $(dirname $(dirname $0)))
2626
OLD_CWD=$(readlink -f .)
2727

28+
git config --global --add safe.directory $REPO_ROOT
29+
2830
# generate release name
2931
COMMIT=$(git rev-parse --short HEAD)
3032
TAG=$(git describe --tags)
@@ -35,7 +37,7 @@ pushd "$BUILD_DIR"
3537

3638
# configure build files with CMake
3739
# we need to explicitly set the install prefix, as CMake's default is /usr/local for some reason...
38-
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=OFF
40+
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=OFF -DQt6_DIR=/opt/qt/6.8.2/gcc_64/lib/cmake/Qt6
3941

4042
# build project and install files into AppDir
4143
make -j$(nproc)

ci/buildsonarcloud.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ pushd "$BUILD_DIR"
3030

3131
# configure build files with CMake
3232
# we need to explicitly set the install prefix, as CMake's default is /usr/local for some reason...
33-
cmake "$REPO_ROOT" -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
33+
cmake "$REPO_ROOT" -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON -DQt6_DIR=/opt/qt/6.8.2/gcc_64/lib/cmake/Qt6
3434

3535
# Wraps the compilation with the Build Wrapper to generate configuration (used
3636
# later by the SonarQube Scanner) into the "bw-output" folder
37-
"$REPO_ROOT"/build-wrapper-linux-x86/build-wrapper-linux-x86-64 \
37+
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 \
3838
--out-dir bw-output cmake \
3939
--build .
4040
# Test project
@@ -44,6 +44,6 @@ ctest -VV
4444
make gcov
4545

4646
# Scan project
47-
"$REPO_ROOT"/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dproject.settings="$REPO_ROOT"/sonar-project.properties -Dsonar.projectBaseDir="$REPO_ROOT" -Dsonar.cfamily.gcov.reportsPath="$BUILD_DIR"
47+
/opt/sonar-scanner-6.2.1.4610-linux-x64/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dproject.settings="$REPO_ROOT"/sonar-project.properties -Dsonar.projectBaseDir="$REPO_ROOT" -Dsonar.cfamily.gcov.reportsPath="$BUILD_DIR"
4848

4949

ci/docker/ubuntu/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu:noble
2+
3+
RUN apt update && apt install -y libglib2.0-bin libdbus-1-3 libgtk-3-0 \
4+
libxcb* libxkbcommon* \
5+
freeglut3-dev lcov \
6+
build-essential cmake \
7+
fuse file
8+
9+
RUN apt update && apt install -y wget unzip git python3-jinja2 python3-pip
10+
RUN pip install aqtinstall --break-system-packages
11+
12+
RUN aqt install-qt -O /opt/qt linux desktop 6.8.2 -m qt3d qtshadertools
13+
ENV PATH="/opt/qt/6.8.2/gcc_64/bin/:$PATH"
14+
15+
RUN wget http://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
16+
RUN unzip build-wrapper-linux-x86.zip -d /opt
17+
18+
RUN wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip
19+
RUN unzip sonar-scanner-cli-6.2.1.4610-linux-x64.zip -d /opt
20+
21+
RUN wget https://github.com/google/or-tools/releases/download/v9.10/or-tools_amd64_ubuntu-24.04_cpp_v9.10.4067.tar.gz
22+
RUN tar -C /opt --strip-components=1 -xvf or-tools_amd64_ubuntu-24.04_cpp_v9.10.4067.tar.gz
23+
24+
RUN git config --global --add safe.directory '*'

cmake/FindLcov.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function (lcov_capture_initial_tgt TNAME)
169169
list(APPEND GENINFO_FILES ${OUTFILE})
170170

171171
add_custom_command(OUTPUT ${OUTFILE} COMMAND ${GCOV_ENV} ${GENINFO_BIN}
172-
--quiet --base-directory ${PROJECT_SOURCE_DIR} --initial
172+
--quiet --ignore-errors mismatch --base-directory ${PROJECT_SOURCE_DIR} --initial
173173
--gcov-tool ${GCOV_BIN} --output-filename ${OUTFILE}
174174
${GENINFO_EXTERN_FLAG} ${TDIR}/${FILE}.gcno
175175
DEPENDS ${TNAME}
@@ -269,7 +269,7 @@ function (lcov_capture_tgt TNAME)
269269

270270
add_custom_command(OUTPUT ${OUTFILE}
271271
COMMAND test -s "${TDIR}/${FILE}.gcda"
272-
&& ${GCOV_ENV} ${GENINFO_BIN} --quiet --base-directory
272+
&& ${GCOV_ENV} ${GENINFO_BIN} --quiet --ignore-errors mismatch --base-directory
273273
${PROJECT_SOURCE_DIR} --gcov-tool ${GCOV_BIN}
274274
--output-filename ${OUTFILE} ${GENINFO_EXTERN_FLAG}
275275
${TDIR}/${FILE}.gcda

0 commit comments

Comments
 (0)