mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 08:42:05 +02:00
Compare commits
38 Commits
main
...
v1.9.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08577429ac | ||
|
|
5a14fa2581 | ||
|
|
b4633dc863 | ||
|
|
fbea2072f9 | ||
|
|
0d49816796 | ||
|
|
696778e8e2 | ||
|
|
9b1f7ed928 | ||
|
|
3364fc4d4c | ||
|
|
a5f1bf7fa8 | ||
|
|
781b187e40 | ||
|
|
8e49fa1ade | ||
|
|
3607d805c7 | ||
|
|
b46f46f47d | ||
|
|
08b1447276 | ||
|
|
bd700071f2 | ||
|
|
9208767b18 | ||
|
|
3537bd29ae | ||
|
|
90aa9b1268 | ||
|
|
7101f5ba53 | ||
|
|
f92cce494a | ||
|
|
a9c0e3a1c5 | ||
|
|
6060777dd0 | ||
|
|
08ba3af15d | ||
|
|
1a9332f91f | ||
|
|
3f9fa08c92 | ||
|
|
bc76677e51 | ||
|
|
cd029a3727 | ||
|
|
f82b50f521 | ||
|
|
8396fc0622 | ||
|
|
e1c9915d49 | ||
|
|
0de3b0352d | ||
|
|
5b3b064954 | ||
|
|
485e1ccc49 | ||
|
|
fedd2bd1d0 | ||
|
|
2436988e4d | ||
|
|
38b22fcee6 | ||
|
|
0b0fd2f518 | ||
|
|
0fa5100933 |
@@ -1,19 +0,0 @@
|
||||
---
|
||||
allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr create:*)
|
||||
description: Commit, push, and open a PR
|
||||
---
|
||||
|
||||
## Context
|
||||
|
||||
- Current git status: !`git status`
|
||||
- Current git diff (staged and unstaged changes): !`git diff HEAD`
|
||||
- Current branch: !`git branch --show-current`
|
||||
|
||||
## Your task
|
||||
|
||||
Based on the above changes:
|
||||
1. Create a new branch if on main
|
||||
2. Create a single commit with an appropriate message
|
||||
3. Push the branch to origin
|
||||
4. Create a pull request using `gh pr create`
|
||||
5. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh api:*), Bash(gh issue comment:*)
|
||||
description: Find duplicate GitHub issues
|
||||
---
|
||||
|
||||
Find up to 3 likely duplicate issues for a given GitHub issue.
|
||||
|
||||
To do this, follow these steps precisely:
|
||||
|
||||
1. Use an agent to check if the Github issue (a) is closed, (b) does not need to be deduped (eg. because it is broad product feedback without a specific solution, or positive feedback), or (c) already has a duplicates comment that you made earlier. If so, do not proceed.
|
||||
2. Use an agent to view a Github issue, and ask the agent to return a summary of the issue
|
||||
3. Then, launch 5 parallel agents to search Github for duplicates of this issue, using diverse keywords and search approaches, using the summary from #1
|
||||
4. Next, feed the results from #1 and #2 into another agent, so that it can filter out false positives, that are likely not actually duplicates of the original issue. If there are no duplicates remaining, do not proceed.
|
||||
5. Finally, comment back on the issue with a list of up to three duplicate issues (or zero, if there are no likely duplicates)
|
||||
|
||||
Notes (be sure to tell this to your agents, too):
|
||||
|
||||
- Use `gh` to interact with Github, rather than web fetch
|
||||
- Do not use other tools, beyond `gh` (eg. don't use other MCP servers, file edit, etc.)
|
||||
- Make a todo list first
|
||||
- For your comment, follow the following format precisely (assuming for this example that you found 3 suspected duplicates):
|
||||
|
||||
---
|
||||
|
||||
Found 3 possible duplicate issues:
|
||||
|
||||
1. <link to issue>
|
||||
2. <link to issue>
|
||||
3. <link to issue>
|
||||
|
||||
This issue will be automatically closed as a duplicate in 3 days.
|
||||
|
||||
- If your issue is a duplicate, please close it and 👍 the existing issue instead
|
||||
- To prevent auto-closure, add a comment or 👎 this comment
|
||||
|
||||
🤖 OrcaSlicer bot
|
||||
|
||||
---
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
allowed-tools: Bash(gh issue list:*), Bash(gh issue view:*), Bash(gh issue edit:*), TodoWrite
|
||||
description: Triage GitHub issues and label critical ones for oncall
|
||||
---
|
||||
|
||||
You're an oncall triage assistant for GitHub issues. Your task is to identify critical issues that require immediate oncall attention and apply the "oncall" label.
|
||||
|
||||
Repository: OrcaSlicer/OrcaSlicer
|
||||
|
||||
Task overview:
|
||||
|
||||
1. First, get all open bugs updated in the last 3 days with at least 50 engagements:
|
||||
```bash
|
||||
gh issue list --repo OrcaSlicer/OrcaSlicer --state open --label bug --limit 1000 --json number,title,updatedAt,comments,reactions | jq -r '.[] | select((.updatedAt >= (now - 259200 | strftime("%Y-%m-%dT%H:%M:%SZ"))) and ((.comments | length) + ([.reactions[].content] | length) >= 50)) | "\(.number)"'
|
||||
```
|
||||
|
||||
2. Save the list of issue numbers and create a TODO list with ALL of them. This ensures you process every single one.
|
||||
|
||||
3. For each issue in your TODO list:
|
||||
- Use `gh issue view <number> --repo OrcaSlicer/OrcaSlicer --json title,body,labels,comments` to get full details
|
||||
- Read and understand the full issue content and comments to determine actual user impact
|
||||
- Evaluate: Is this truly blocking users from using Claude Code?
|
||||
- Consider: "crash", "stuck", "frozen", "hang", "unresponsive", "cannot use", "blocked", "broken"
|
||||
- Does it prevent core functionality? Can users work around it?
|
||||
- Be conservative - only flag issues that truly prevent users from getting work done
|
||||
|
||||
4. For issues that are truly blocking and don't already have the "oncall" label:
|
||||
- Use `gh issue edit <number> --repo OrcaSlicer/OrcaSlicer --add-label "oncall"`
|
||||
- Mark the issue as complete in your TODO list
|
||||
|
||||
5. After processing all issues, provide a summary:
|
||||
- List each issue number that received the "oncall" label
|
||||
- Include the issue title and brief reason why it qualified
|
||||
- If no issues qualified, state that clearly
|
||||
|
||||
Important:
|
||||
- Process ALL issues in your TODO list systematically
|
||||
- Don't post any comments to issues
|
||||
- Only add the "oncall" label, never remove it
|
||||
- Use individual `gh issue view` commands instead of bash for loops to avoid approval prompts
|
||||
@@ -1,10 +0,0 @@
|
||||
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
|
||||
deps/
|
||||
build_*/
|
||||
build/
|
||||
localization/
|
||||
sandboxes/
|
||||
resources/*
|
||||
!resources/web/
|
||||
!resources/dailytip
|
||||
!resources/shaders
|
||||
@@ -1,2 +0,0 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE}
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "OrcaSlicer",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"PLATFORM": "linux/amd64",
|
||||
"BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-22.04"
|
||||
},
|
||||
"options": ["--platform=linux/amd64"]
|
||||
},
|
||||
"runArgs": ["--platform=linux/amd64"],
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/desktop-lite:1": {
|
||||
"password": "orca"
|
||||
}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-vscode.cmake-tools",
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"forwardPorts": [6080],
|
||||
"portsAttributes": {
|
||||
"6080": {
|
||||
"label": "VNC web client (noVNC)",
|
||||
"onAutoForward": "silent"
|
||||
}
|
||||
},
|
||||
"otherPortsAttributes": {
|
||||
"onAutoForward": "ignore"
|
||||
},
|
||||
"onCreateCommand": {
|
||||
"Set postCreate executable flag": "chmod +x .devcontainer/postCreate.sh"
|
||||
},
|
||||
"postCreateCommand": "sudo .devcontainer/postCreate.sh"
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Update and upgrade all system packages
|
||||
apt update
|
||||
apt upgrade -y
|
||||
|
||||
build_linux="./build_linux.sh -u"
|
||||
echo "-----------------------------------------"
|
||||
echo "Running ${build_linux}..."
|
||||
echo "-----------------------------------------"
|
||||
${build_linux}
|
||||
|
||||
echo "------------------------------"
|
||||
echo "Installing missing packages..."
|
||||
echo "------------------------------"
|
||||
apt install -y libgl1-mesa-dev m4 autoconf libtool
|
||||
@@ -22,9 +22,7 @@ deps/build-linux/*
|
||||
**/.DS_Store
|
||||
install_*
|
||||
build_*/
|
||||
!build_linux.sh
|
||||
SVG
|
||||
scripts/Dockerfile
|
||||
scripts/DockerBuild.sh
|
||||
scripts/DockerRun.sh
|
||||
scripts/.dockerignore
|
||||
Dockerfile
|
||||
DockerBuild.sh
|
||||
DockerRun.sh
|
||||
|
||||
14
.doxygen
14
.doxygen
@@ -48,7 +48,7 @@ PROJECT_NAME = OrcaSlicer
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = latest
|
||||
PROJECT_NUMBER = 1.6.3
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -68,7 +68,7 @@ PROJECT_LOGO = ./resources/images/OrcaSlicer_32px.png
|
||||
# entered, it will be relative to the location where doxygen was started. If
|
||||
# left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = .
|
||||
OUTPUT_DIRECTORY = ../
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
|
||||
# sub-directories (in 2 levels) under the output directory of each output format
|
||||
@@ -1059,11 +1059,7 @@ EXCLUDE_SYMLINKS = NO
|
||||
# Note that the wildcards are matched against the file with absolute path, so to
|
||||
# exclude all test directories for example use the pattern */test/*
|
||||
|
||||
EXCLUDE_PATTERNS = */deps/*
|
||||
EXCLUDE_PATTERNS = */build/*
|
||||
EXCLUDE_PATTERNS = */deps_src/*
|
||||
|
||||
|
||||
EXCLUDE_PATTERNS =
|
||||
|
||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||
@@ -1290,7 +1286,7 @@ GENERATE_HTML = YES
|
||||
# The default directory is: html.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_OUTPUT = internal_docs
|
||||
HTML_OUTPUT = OrcaSlicer_Dev_Document
|
||||
|
||||
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
|
||||
# generated HTML page (for example: .htm, .php, .asp).
|
||||
@@ -1569,7 +1565,7 @@ TOC_EXPAND = NO
|
||||
# protocol see https://www.sitemaps.org
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
SITEMAP_URL = internals.orcaslicer.com
|
||||
SITEMAP_URL =
|
||||
|
||||
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
|
||||
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
|
||||
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,2 +0,0 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1,3 +1,2 @@
|
||||
github: SoftFever
|
||||
ko_fi: SoftFever
|
||||
custom: https://paypal.me/softfever3d
|
||||
|
||||
55
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
55
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,58 +1,36 @@
|
||||
name: 🐞 Bug Report
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
labels: ["bug"]
|
||||
labels: bug
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Thank you for using Orca Slicer and wanting to report a bug.**
|
||||
|
||||
Please note that this is not the place to make feature requests or ask for help.
|
||||
For this, please use the [Feature request](https://github.com/OrcaSlicer/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=feature_request.yml) issue type or you can discuss your idea on our [Discord server](https://discord.gg/P4VE9UY9gJ) with others.
|
||||
|
||||
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this problem?
|
||||
description: Please search to see if an issue already exists for the bug you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: OrcaSlicer Version
|
||||
description: Which version of Orca Slicer are you running? You can see the full version in `Help` -> `About Orca Slicer`.
|
||||
placeholder: e.g. 1.9.0
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: os_type
|
||||
attributes:
|
||||
label: "Operating System (OS)"
|
||||
description: "What OSes are you are experiencing issues on?"
|
||||
multiple: true
|
||||
options:
|
||||
- Linux
|
||||
- macOS
|
||||
- Windows
|
||||
placeholder: e.g. 1.6.6
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os_version
|
||||
id: os_info
|
||||
attributes:
|
||||
label: "OS Version"
|
||||
description: "What OS version does this relate to?"
|
||||
placeholder: "i.e. OS: Windows 7/8/10/11 ..., Ubuntu 22.04/Fedora 36 ..., macOS 10.15/11.1/12.3 ..."
|
||||
label: OS version
|
||||
description: Which OS version are you using?
|
||||
placeholder: |
|
||||
OS: Windows 7/8/10/11 ... , Ubuntu 22.04/Fedora 36 ... , macOS 10.15/11.1/12.3 ...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: system_info
|
||||
attributes:
|
||||
label: Additional system information
|
||||
description: For the performance issue, please also show the CPU, Memory information; For the 3D Rendering issue, please also show the Display Card information.
|
||||
description: For the performance issue, please also show the CPU、Memory information; For the 3D Rendering issue, please also show the Display Card information.
|
||||
placeholder: |
|
||||
CPU: 11th gen Intel r core tm i7-1185g7/AMD Ryzen 7 6800h/...
|
||||
CPU: 11th gen intel r core tm i7-1185g7/amd ryzen 7 6800h/...
|
||||
Memory: 32/16 GB...
|
||||
Display Card: NVIDIA Quadro P400/...
|
||||
validations:
|
||||
@@ -72,8 +50,8 @@ body:
|
||||
description: Please described the detailed steps to reproduce this issue
|
||||
placeholder: |
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
validations:
|
||||
required: true
|
||||
@@ -122,12 +100,3 @@ body:
|
||||
options:
|
||||
- label: Log file
|
||||
- label: Project file
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: |
|
||||
Screenshots? References? Anything that will give us more context about the issue you are encountering!
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Community Support (Discord channel)
|
||||
url: https://discord.gg/P4VE9UY9gJ
|
||||
about: Please ask and answer support "how do I?"questions here.
|
||||
- name: Discussion Forum
|
||||
url: https://github.com/OrcaSlicer/OrcaSlicer/discussions
|
||||
about: Please raise ideas and feature suggestions here.
|
||||
23
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
23
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Which printers will be beneficial to this feature**
|
||||
E.g. Voron/Klipper based printer/etc...
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
66
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
66
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,66 +0,0 @@
|
||||
name: 🚀 Feature Request / Enhancement
|
||||
description: Suggest an improvement to make Orca Slicer even better!
|
||||
labels: ["enhancement"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this feature request!
|
||||
|
||||
If your idea is still at the formulation stage, or you're not sure it would
|
||||
be useful to many users, you can raise it as a discussion topic under [Ideas](https://github.com/OrcaSlicer/OrcaSlicer/discussions/categories/ideas)
|
||||
or you can raise it on the [Discord server](https://discord.gg/P4VE9UY9gJ).
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this feature request?
|
||||
description: |
|
||||
Please search to see if an issue already exists for a feature, or perhaps one similar.
|
||||
You can then comment and react so that we know know much interest there is in the feature request.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Is your feature request related to a problem?
|
||||
description: A clear and concise description of what the problem is.
|
||||
placeholder: I'm always frustrated when [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Which printers will be beneficial to this feature?
|
||||
description: Select affected printer firmware type.
|
||||
multiple: true
|
||||
options:
|
||||
- Klipper
|
||||
- Marlin
|
||||
- Others
|
||||
- All
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
description: A clear and concise description of what you want to happen.
|
||||
placeholder: It should do [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe alternatives you've considered
|
||||
description: A clear and concise description of any alternative solutions or features you've considered.
|
||||
placeholder: |
|
||||
1. [...]
|
||||
2. [...]
|
||||
3. [...]
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: |
|
||||
Add any other context, diagrams, illustations or screenshots about the feature request here.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||
validations:
|
||||
required: false
|
||||
11
.github/actions/apt-install-deps/action.yml
vendored
11
.github/actions/apt-install-deps/action.yml
vendored
@@ -1,11 +0,0 @@
|
||||
name: 'Apt Install Deps'
|
||||
description: 'Install the packages needed for building and deploying'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Install dependencies from build_linux.sh
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
||||
sudo env "ORCA_UPDATER_SIG_KEY=$ORCA_UPDATER_SIG_KEY" ./build_linux.sh -ur
|
||||
sudo chown $USER -R ./
|
||||
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -1,18 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Only care about major updates to github actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
ignore: # Only suggest major updates for built-in actions
|
||||
- dependency-name: "github/*"
|
||||
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
|
||||
- dependency-name: "actions/*"
|
||||
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
|
||||
# Docker dependencies
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
# no support for c/cpp
|
||||
21
.github/pull_request_template.md
vendored
21
.github/pull_request_template.md
vendored
@@ -1,21 +0,0 @@
|
||||
# Description
|
||||
|
||||
<!--
|
||||
> Please provide a summary of the changes made in this PR. Include details such as:
|
||||
> * What issue does this PR address or fix?
|
||||
> * What new features or enhancements does this PR introduce?
|
||||
> * Are there any breaking changes or dependencies that need to be considered?
|
||||
-->
|
||||
|
||||
# Screenshots/Recordings/Graphs
|
||||
|
||||
<!--
|
||||
> Please attach relevant screenshots to showcase the UI changes.
|
||||
> Please attach images that can help explain the changes.
|
||||
-->
|
||||
|
||||
## Tests
|
||||
|
||||
<!--
|
||||
> Please describe the tests that you have conducted to verify the changes made in this PR.
|
||||
-->
|
||||
26
.github/workflows/assign.yml
vendored
26
.github/workflows/assign.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Assign Issue
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 0 * * *
|
||||
issue_comment:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
assign:
|
||||
permissions:
|
||||
issues: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Assign the user or unassign stale assignments
|
||||
# Note: v3.0.0 is broken (dist/index.mjs vs action.yml expects index.js)
|
||||
# See: https://github.com/takanome-dev/assign-issue-action/issues/426
|
||||
uses: takanome-dev/assign-issue-action@v2.2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
maintainers: 'noisyfox,softfever'
|
||||
days_until_unassign: 30
|
||||
block_assignment: false
|
||||
reminder_days: 7
|
||||
max_assignments: 12
|
||||
31
.github/workflows/auto-close-duplicates.yml
vendored
31
.github/workflows/auto-close-duplicates.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Auto-close duplicate issues
|
||||
description: Auto-closes issues that are duplicates of existing issues
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 9 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
auto-close-duplicates:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Auto-close duplicate issues
|
||||
run: bun run scripts/auto-close-duplicates.ts
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
|
||||
GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }}
|
||||
STATSIG_API_KEY: ${{ secrets.STATSIG_API_KEY }}
|
||||
@@ -1,44 +0,0 @@
|
||||
name: Backfill Duplicate Comments
|
||||
description: Triggers duplicate detection for old issues that don't have duplicate comments
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
days_back:
|
||||
description: 'How many days back to look for old issues'
|
||||
required: false
|
||||
default: '90'
|
||||
type: string
|
||||
dry_run:
|
||||
description: 'Dry run mode (true to only log what would be done)'
|
||||
required: false
|
||||
default: 'true'
|
||||
type: choice
|
||||
options:
|
||||
- 'true'
|
||||
- 'false'
|
||||
|
||||
jobs:
|
||||
backfill-duplicate-comments:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Backfill duplicate comments
|
||||
run: bun run scripts/backfill-duplicate-comments.ts
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DAYS_BACK: ${{ inputs.days_back }}
|
||||
DRY_RUN: ${{ inputs.dry_run }}
|
||||
201
.github/workflows/build_all.yml
vendored
201
.github/workflows/build_all.yml
vendored
@@ -13,7 +13,6 @@ on:
|
||||
- 'localization/**'
|
||||
- 'resources/**'
|
||||
- ".github/workflows/build_*.yml"
|
||||
- 'scripts/flatpak/**'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
@@ -21,19 +20,10 @@ on:
|
||||
- release/*
|
||||
paths:
|
||||
- 'deps/**'
|
||||
- 'deps_src/**'
|
||||
- 'src/**'
|
||||
- '**/CMakeLists.txt'
|
||||
- 'version.inc'
|
||||
- ".github/workflows/build_*.yml"
|
||||
- 'build_linux.sh'
|
||||
- 'build_release_vs2022.bat'
|
||||
- 'build_release_macos.sh'
|
||||
- 'scripts/flatpak/**'
|
||||
|
||||
|
||||
schedule:
|
||||
- cron: '0 17 * * *' # run once a day at 1 AM Singapore time (UTC+8)
|
||||
|
||||
workflow_dispatch: # allows for manual dispatch
|
||||
inputs:
|
||||
@@ -43,193 +33,26 @@ on:
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
secrets: inherit
|
||||
build_windows:
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
force-build: ${{ github.event_name == 'schedule' }}
|
||||
secrets: inherit
|
||||
build_macos_arch:
|
||||
build_all:
|
||||
name: Build All
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch:
|
||||
- arm64
|
||||
- x86_64
|
||||
# Don't run scheduled builds on forks:
|
||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: windows-latest
|
||||
- os: macos-12
|
||||
arch: x86_64
|
||||
- os: macos-12
|
||||
arch: arm64
|
||||
uses: ./.github/workflows/build_check_cache.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
||||
os: ${{ matrix.os }}
|
||||
arch: ${{ matrix.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||
force-build: ${{ github.event_name == 'schedule' }}
|
||||
secrets: inherit
|
||||
build_macos_universal:
|
||||
name: Build macOS Universal
|
||||
needs: build_macos_arch
|
||||
if: ${{ !cancelled() && needs.build_macos_arch.result == 'success' && !inputs.build-deps-only && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
uses: ./.github/workflows/build_orca.yml
|
||||
with:
|
||||
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
||||
arch: universal
|
||||
macos-combine-only: true
|
||||
secrets: inherit
|
||||
unit_tests:
|
||||
name: Unit Tests
|
||||
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
|
||||
needs: build_linux
|
||||
if: ${{ !cancelled() && success() }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github
|
||||
scripts
|
||||
tests
|
||||
- name: Apt-Install Dependencies
|
||||
if: ${{ !vars.SELF_HOSTED }}
|
||||
uses: ./.github/actions/apt-install-deps
|
||||
- name: Restore Test Artifact
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ github.sha }}-tests
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
|
||||
useLocalCache: true # <--= Use the local cache (default is 'false').
|
||||
useCloudCache: true
|
||||
- name: Unpackage and Run Unit Tests
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
tar -xvf build_tests.tar
|
||||
scripts/run_unit_tests.sh
|
||||
- name: Upload Test Logs
|
||||
uses: actions/upload-artifact@v7
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: unit-test-logs
|
||||
path: build/tests/**/*.log
|
||||
- name: Publish Test Results
|
||||
if: always()
|
||||
uses: EnricoMi/publish-unit-test-result-action@v2
|
||||
with:
|
||||
files: "ctest_results.xml"
|
||||
- name: Delete Test Artifact
|
||||
if: success()
|
||||
uses: geekyeggo/delete-artifact@v5
|
||||
with:
|
||||
name: ${{ github.sha }}-tests
|
||||
flatpak:
|
||||
name: "Flatpak"
|
||||
container:
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-49
|
||||
options: --privileged
|
||||
volumes:
|
||||
- /usr/local/lib/android:/usr/local/lib/android
|
||||
- /usr/share/dotnet:/usr/share/dotnet
|
||||
- /opt/ghc:/opt/ghc1
|
||||
- /usr/local/share/boost:/usr/local/share/boost1
|
||||
- /opt/hostedtoolcache:/opt/hostedtoolcache1
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
variant:
|
||||
- arch: x86_64
|
||||
runner: ubuntu-24.04
|
||||
- arch: aarch64
|
||||
runner: ubuntu-24.04-arm
|
||||
# Don't run scheduled builds on forks; skip entirely on self-hosted runners
|
||||
if: ${{ !cancelled() && !vars.SELF_HOSTED && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||
runs-on: ${{ matrix.variant.runner }}
|
||||
env:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
steps:
|
||||
- name: "Remove unneeded stuff to free disk space"
|
||||
run:
|
||||
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
|
||||
- uses: actions/checkout@v6
|
||||
- name: Get the version and date
|
||||
run: |
|
||||
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
ver="PR-${{ github.event.number }}"
|
||||
git_commit_hash="${{ github.event.pull_request.head.sha }}"
|
||||
else
|
||||
ver=V$ver_pure
|
||||
git_commit_hash="${{ github.sha }}"
|
||||
fi
|
||||
echo "ver=$ver" >> $GITHUB_ENV
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
# Manage flatpak-builder cache externally so PRs restore but never upload
|
||||
- name: Restore flatpak-builder cache
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/cache/restore@v5
|
||||
with:
|
||||
path: .flatpak-builder
|
||||
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }}
|
||||
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
|
||||
- name: Save/restore flatpak-builder cache
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .flatpak-builder
|
||||
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }}
|
||||
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
|
||||
- name: Disable debug info for faster CI builds
|
||||
run: |
|
||||
sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \
|
||||
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
||||
shell: bash
|
||||
- name: Inject git commit hash into Flatpak manifest
|
||||
run: |
|
||||
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \
|
||||
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
||||
shell: bash
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
||||
with:
|
||||
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
||||
cache: false
|
||||
arch: ${{ matrix.variant.arch }}
|
||||
upload-artifact: false
|
||||
- name: Upload artifacts Flatpak
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak'
|
||||
- name: Deploy Flatpak to nightly release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main'
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
||||
asset_name: OrcaSlicer-Linux-flatpak_nightly_${{ matrix.variant.arch }}.flatpak
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
|
||||
secrets: inherit
|
||||
22
.github/workflows/build_check_cache.yml
vendored
22
.github/workflows/build_check_cache.yml
vendored
@@ -12,9 +12,6 @@ on:
|
||||
build-deps-only:
|
||||
required: false
|
||||
type: boolean
|
||||
force-build:
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
check_cache: # determines if there is a cache and outputs variables used in caching process
|
||||
@@ -26,24 +23,22 @@ jobs:
|
||||
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
lfs: 'false'
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: set outputs
|
||||
id: set_outputs
|
||||
env:
|
||||
# Keep macOS cache keys and paths architecture-specific.
|
||||
cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && 'windows' || 'linux-clang') }}
|
||||
dep-folder-name: ${{ runner.os == 'macOS' && format('/{0}', inputs.arch) || '/OrcaSlicer_dep' }}
|
||||
output-cmd: ${{ runner.os == 'Windows' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
||||
underscore-arch: ${{ inputs.os == 'macos-12' && '_' || ''}}${{ inputs.os == 'macos-12' && inputs.arch || '' }} # if is macos, make a string that does "_{arch}", else output nothing
|
||||
dash-arch: ${{ inputs.os == 'macos-12' && '-' || ''}}${{ inputs.os == 'macos-12' && inputs.arch || '' }} # if is macos, make a string that does "-{arch}", else output nothing
|
||||
dep-folder-name: ${{ (inputs.os == 'windows-latest' || inputs.os == 'macos-12') && 'OrcaSlicer_dep' || 'destdir' }}
|
||||
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
||||
run: |
|
||||
echo cache-key=${{ env.cache-os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
||||
echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }}
|
||||
echo cache-key=${{ runner.os }}${{ env.dash-arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
||||
echo cache-path=${{ github.workspace }}/deps/build${{ env.underscore-arch }}/${{ env.dep-folder-name }}${{ env.underscore-arch }} >> ${{ env.output-cmd }}
|
||||
|
||||
- name: load cache
|
||||
id: cache_deps
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.set_outputs.outputs.cache-path }}
|
||||
key: ${{ steps.set_outputs.outputs.cache-key }}
|
||||
@@ -60,5 +55,4 @@ jobs:
|
||||
os: ${{ inputs.os }}
|
||||
arch: ${{ inputs.arch }}
|
||||
build-deps-only: ${{ inputs.build-deps-only }}
|
||||
force-build: ${{ inputs.force-build }}
|
||||
secrets: inherit
|
||||
|
||||
126
.github/workflows/build_deps.yml
vendored
126
.github/workflows/build_deps.yml
vendored
@@ -19,118 +19,111 @@ on:
|
||||
build-deps-only:
|
||||
required: false
|
||||
type: boolean
|
||||
force-build:
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build_deps:
|
||||
name: Build Deps
|
||||
if: ${{ !cancelled() && (inputs.build-deps-only || inputs.force-build || inputs.valid-cache != true) }}
|
||||
if: inputs.build-deps-only || inputs.valid-cache != true
|
||||
runs-on: ${{ inputs.os }}
|
||||
env:
|
||||
date:
|
||||
steps:
|
||||
|
||||
|
||||
# Setup the environment
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
lfs: 'false'
|
||||
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: load cached deps
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
|
||||
useLocalCache: true # <--= Use the local cache (default is 'false').
|
||||
useCloudCache: true
|
||||
|
||||
- name: setup dev on Windows
|
||||
if: runner.os == 'Windows'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
|
||||
- name: Get the date on Ubuntu and macOS
|
||||
if: runner.os != 'Windows'
|
||||
if: inputs.os != 'windows-latest'
|
||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
|
||||
- name: Get the date on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
shell: pwsh
|
||||
|
||||
|
||||
|
||||
# Build Dependencies
|
||||
- name: Build on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
if (-not "${{ vars.SELF_HOSTED }}") {
|
||||
choco install strawberryperl
|
||||
}
|
||||
.\build_release_vs.bat deps
|
||||
.\build_release_vs.bat pack
|
||||
shell: pwsh
|
||||
choco install strawberryperl
|
||||
mkdir ${{ github.workspace }}/deps/build
|
||||
mkdir ${{ github.workspace }}/deps/build/OrcaSlicer_dep
|
||||
.\build_release_vs2022.bat deps
|
||||
.\build_release_vs2022.bat pack
|
||||
cd ${{ github.workspace }}/deps/build
|
||||
|
||||
- name: Build on Mac ${{ inputs.arch }}
|
||||
if: runner.os == 'macOS'
|
||||
if: inputs.os == 'macos-12'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
if [ -z "${{ vars.SELF_HOSTED }}" ]; then
|
||||
brew install automake texinfo libtool
|
||||
fi
|
||||
./build_release_macos.sh -dx ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15
|
||||
(cd "${{ github.workspace }}/deps/build/${{ inputs.arch }}" && \
|
||||
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +)
|
||||
brew install cmake git gettext automake
|
||||
brew list
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }}
|
||||
brew uninstall --ignore-dependencies zstd
|
||||
./build_release_macos.sh -dp -a ${{ inputs.arch }} -t 10.15
|
||||
brew install zstd
|
||||
|
||||
|
||||
- name: Apt-Install Dependencies
|
||||
if: runner.os == 'Linux' && !vars.SELF_HOSTED
|
||||
uses: ./.github/actions/apt-install-deps
|
||||
|
||||
- name: Build on Ubuntu
|
||||
if: runner.os == 'Linux'
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake git g++ build-essential libgl1-mesa-dev m4 \
|
||||
libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules pkgconf \
|
||||
libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-4.0-dev \
|
||||
libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev \
|
||||
gstreamer1.0-plugins-bad libosmesa6-dev wget sudo autoconf curl libunwind-dev
|
||||
mkdir -p ${{ github.workspace }}/deps/build
|
||||
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
||||
./build_linux.sh -drlL
|
||||
sudo ./BuildLinux.sh -ur
|
||||
sudo chown $USER -R ./
|
||||
./BuildLinux.sh -dr
|
||||
cd deps/build
|
||||
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
|
||||
|
||||
|
||||
|
||||
|
||||
# Upload Artifacts
|
||||
# - name: Upload Mac ${{ inputs.arch }} artifacts
|
||||
# if: runner.os == 'macOS'
|
||||
# uses: actions/upload-artifact@v6
|
||||
# with:
|
||||
# name: OrcaSlicer_dep_mac_${{ env.date }}
|
||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz
|
||||
- name: Upload Mac ${{ inputs.arch }} artifacts
|
||||
if: inputs.os == 'macos-12'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep*.tar.gz
|
||||
|
||||
# - name: Upload Windows artifacts
|
||||
# if: runner.os == 'Windows'
|
||||
# uses: actions/upload-artifact@v6
|
||||
# with:
|
||||
# name: OrcaSlicer_dep_win64_${{ env.date }}
|
||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
||||
|
||||
# - name: Upload Ubuntu artifacts
|
||||
# if: runner.os == 'Linux' && !env.ACT
|
||||
# env:
|
||||
# ubuntu-ver: '2404'
|
||||
# uses: actions/upload-artifact@v6
|
||||
# with:
|
||||
# name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
|
||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
||||
- name: Upload Windows artifacts
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_dep_win64_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
||||
|
||||
- name: Upload Ubuntu artifacts
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_dep_ubuntu_${{ env.date }}
|
||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
||||
|
||||
build_orca:
|
||||
name: Build OrcaSlicer
|
||||
needs: [build_deps]
|
||||
if: ${{ !cancelled() && !inputs.build-deps-only && (inputs.force-build || (inputs.valid-cache == true && needs.build_deps.result == 'skipped') || (inputs.valid-cache != true && success())) }}
|
||||
if: ${{ !cancelled() && !inputs.build-deps-only && (inputs.valid-cache == true && needs.build_deps.result == 'skipped') || (inputs.valid-cache != true && success()) }}
|
||||
uses: ./.github/workflows/build_orca.yml
|
||||
with:
|
||||
cache-key: ${{ inputs.cache-key }}
|
||||
@@ -138,3 +131,4 @@ jobs:
|
||||
os: ${{ inputs.os }}
|
||||
arch: ${{ inputs.arch }}
|
||||
secrets: inherit
|
||||
|
||||
|
||||
423
.github/workflows/build_orca.yml
vendored
423
.github/workflows/build_orca.yml
vendored
@@ -2,10 +2,10 @@ on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
cache-key:
|
||||
required: false
|
||||
required: true
|
||||
type: string
|
||||
cache-path:
|
||||
required: false
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: true
|
||||
@@ -13,10 +13,6 @@ on:
|
||||
arch:
|
||||
required: false
|
||||
type: string
|
||||
macos-combine-only:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_orca:
|
||||
@@ -25,145 +21,76 @@ jobs:
|
||||
env:
|
||||
date:
|
||||
ver:
|
||||
ver_pure:
|
||||
ubuntu-ver: '2404'
|
||||
ubuntu-ver-str: '_Ubuntu2404'
|
||||
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
lfs: 'false'
|
||||
|
||||
- name: load cached deps
|
||||
if: ${{ !(runner.os == 'macOS' && inputs.macos-combine-only) }}
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
with:
|
||||
cmakeVersion: "~4.3.0" # use most recent 4.3.x version
|
||||
useLocalCache: true # <--= Use the local cache (default is 'false').
|
||||
useCloudCache: true
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get the version and date on Ubuntu and macOS
|
||||
if: runner.os != 'Windows'
|
||||
if: inputs.os != 'windows-latest'
|
||||
run: |
|
||||
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
ver="PR-${{ github.event.number }}"
|
||||
git_commit_hash="${{ github.event.pull_request.head.sha }}"
|
||||
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||
ver="nightly$(date +'%y%m%d')"
|
||||
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
ver="PR${{ github.event.number }}"
|
||||
else
|
||||
ver=V$ver_pure
|
||||
git_commit_hash=""
|
||||
ver=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
ver=V$ver
|
||||
fi
|
||||
echo "ver=$ver" >> $GITHUB_ENV
|
||||
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
||||
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Get the version and date on Windows
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: |
|
||||
$date = Get-Date -Format 'yyyyMMdd'
|
||||
$ref = "${{ github.ref }}"
|
||||
$eventName = "${{ github.event_name }}"
|
||||
$prNumber = "${{ github.event.number }}"
|
||||
|
||||
if ($eventName -eq 'pull_request') {
|
||||
|
||||
if ($ref -eq 'refs/heads/main') {
|
||||
$ver = "nightly" + $date.Substring(2)
|
||||
} elseif ($eventName -eq 'pull_request') {
|
||||
$ver = "PR" + $prNumber
|
||||
$git_commit_hash = "${{ github.event.pull_request.head.sha }}"
|
||||
} else {
|
||||
$versionContent = Get-Content version.inc -Raw
|
||||
if ($versionContent -match 'set\(SoftFever_VERSION "(.*?)"\)') {
|
||||
$ver = $matches[1]
|
||||
}
|
||||
$ver = "V$ver"
|
||||
$git_commit_hash = ""
|
||||
}
|
||||
|
||||
|
||||
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
echo "git_commit_hash=$git_commit_hash" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||
echo "date: ${{ env.date }} version: ${{ env.ver }}"
|
||||
shell: pwsh
|
||||
|
||||
|
||||
- name: load cached deps
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ inputs.cache-path }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
|
||||
# Mac
|
||||
- name: Install tools mac
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
if: inputs.os == 'macos-12'
|
||||
run: |
|
||||
if [ -z "${{ vars.SELF_HOSTED }}" ]; then
|
||||
brew install libtool
|
||||
brew list
|
||||
fi
|
||||
mkdir -p ${{ github.workspace }}/deps/build/${{ inputs.arch }}
|
||||
|
||||
- name: Free disk space
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
run: |
|
||||
df -hI /dev/disk3s1s1
|
||||
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
|
||||
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
|
||||
df -hI /dev/disk3s1s1
|
||||
brew install cmake git gettext tree
|
||||
brew list
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
|
||||
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
|
||||
tree ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
|
||||
|
||||
- name: Build slicer mac
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
if: inputs.os == 'macos-12'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
./build_release_macos.sh -s -n -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a ${{ inputs.arch }} -t 10.15
|
||||
|
||||
- name: Pack macOS app bundle ${{ inputs.arch }}
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
tar -czvf OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}.tar.gz -C build/${{ inputs.arch }} OrcaSlicer
|
||||
|
||||
- name: Upload macOS app bundle ${{ inputs.arch }}
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}.tar.gz
|
||||
|
||||
- name: Download macOS app bundles
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: OrcaSlicer_Mac_bundle_*_${{ github.sha }}
|
||||
path: ${{ github.workspace }}/mac_bundles
|
||||
|
||||
- name: Extract macOS app bundles
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
mkdir -p build/arm64 build/x86_64
|
||||
arm_bundle=$(find "${{ github.workspace }}/mac_bundles/OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}" -name '*.tar.gz' -print -quit)
|
||||
x86_bundle=$(find "${{ github.workspace }}/mac_bundles/OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}" -name '*.tar.gz' -print -quit)
|
||||
tar -xzvf "$arm_bundle" -C "${{ github.workspace }}/build/arm64"
|
||||
tar -xzvf "$x86_bundle" -C "${{ github.workspace }}/build/x86_64"
|
||||
|
||||
- name: Build universal mac app bundle
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
./build_release_macos.sh -u -x ${{ !vars.SELF_HOSTED && '-1' || '' }} -a universal -t 10.15
|
||||
|
||||
- name: Delete intermediate per-arch artifacts
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
uses: geekyeggo/delete-artifact@v5
|
||||
with:
|
||||
name: |
|
||||
OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}
|
||||
OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}
|
||||
./build_release_macos.sh -s -n -a ${{inputs.arch}} -t 10.15
|
||||
|
||||
# Thanks to RaySajuuk, it's working now
|
||||
- name: Sign app and notary
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && runner.os == 'macOS' && inputs.macos-combine-only
|
||||
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-12'
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
@@ -177,287 +104,117 @@ jobs:
|
||||
security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
|
||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
|
||||
# Set the temporary keychain as the default to prevent codesign from accessing the locked login keychain
|
||||
security default-keychain -s "$KEYCHAIN_PATH"
|
||||
security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app
|
||||
# Sign OrcaSlicer_profile_validator.app if it exists
|
||||
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app
|
||||
fi
|
||||
|
||||
# Create main OrcaSlicer DMG without the profile validator helper
|
||||
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_dmg
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/Applications
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
# Create separate OrcaSlicer_profile_validator DMG if the app exists
|
||||
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
|
||||
hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
fi
|
||||
|
||||
# Notarize main DMG
|
||||
xcrun notarytool submit "OrcaSlicer_Mac_universal_${{ env.ver }}.dmg" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}" --wait
|
||||
xcrun stapler staple OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
# Notarize profile validator DMG if it exists
|
||||
if [ -f "OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg" ]; then
|
||||
xcrun notarytool submit "OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}" --wait
|
||||
xcrun stapler staple OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
fi
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/OrcaSlicer.app
|
||||
ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}"
|
||||
xcrun notarytool submit "OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait
|
||||
xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
|
||||
- name: Create DMG without notary
|
||||
if: github.ref != 'refs/heads/main' && runner.os == 'macOS' && inputs.macos-combine-only
|
||||
if: github.ref != 'refs/heads/main' && inputs.os == 'macos-12'
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_dmg
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_dmg/Applications
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_dmg -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
# Create separate OrcaSlicer_profile_validator DMG if the app exists
|
||||
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg
|
||||
rm -rf ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/*
|
||||
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
|
||||
ln -sfn /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
|
||||
hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
fi
|
||||
ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
|
||||
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
|
||||
- name: Upload artifacts mac
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'macos-12'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_Mac_universal_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
|
||||
- name: Upload OrcaSlicer_profile_validator DMG mac
|
||||
if: runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Deploy Mac release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
|
||||
asset_name: OrcaSlicer_Mac_universal_nightly.dmg
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
|
||||
- name: Deploy Mac OrcaSlicer_profile_validator DMG release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'macOS' && inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
|
||||
asset_name: OrcaSlicer_profile_validator_Mac_universal_nightly.dmg
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1
|
||||
name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
|
||||
|
||||
# Windows
|
||||
- name: setup MSVC
|
||||
if: runner.os == 'Windows'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
|
||||
- name: Install nsis
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
if: inputs.os == 'windows-latest'
|
||||
run: |
|
||||
dir "C:/Program Files (x86)/Windows Kits/10/Include"
|
||||
choco install nsis
|
||||
|
||||
- name: Build slicer Win
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}
|
||||
env:
|
||||
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
|
||||
WindowsSDKVersion: '10.0.26100.0\'
|
||||
run: .\build_release_vs.bat slicer
|
||||
run: .\build_release_vs2022.bat slicer
|
||||
|
||||
- name: Create installer Win
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
run: |
|
||||
cpack -G NSIS
|
||||
|
||||
- name: Pack app
|
||||
if: runner.os == 'Windows'
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build
|
||||
shell: cmd
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}/build/OrcaSlicer'
|
||||
|
||||
- name: Pack PDB
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
if: inputs.os == 'windows-latest'
|
||||
working-directory: ${{ github.workspace }}/build/src/Release
|
||||
shell: cmd
|
||||
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
|
||||
|
||||
|
||||
- name: Upload artifacts Win zip
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}_portable
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||
|
||||
- name: Upload artifacts Win installer
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_Windows_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
|
||||
|
||||
- name: Upload artifacts Win PDB
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'windows-latest'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: PDB
|
||||
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
|
||||
|
||||
- name: Upload OrcaSlicer_profile_validator Win
|
||||
if: runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}
|
||||
path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
|
||||
|
||||
- name: Deploy Windows release portable
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
|
||||
asset_name: OrcaSlicer_Windows_nightly_portable.zip
|
||||
asset_content_type: application/x-zip-compressed
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy Windows release installer
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
|
||||
asset_name: OrcaSlicer_Windows_Installer_nightly.exe
|
||||
asset_content_type: application/x-msdownload
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy Windows OrcaSlicer_profile_validator release
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
|
||||
asset_name: OrcaSlicer_profile_validator_Windows_nightly.exe
|
||||
asset_content_type: application/x-msdownload
|
||||
max_releases: 1
|
||||
|
||||
# Ubuntu
|
||||
- name: Apt-Install Dependencies
|
||||
if: runner.os == 'Linux' && !vars.SELF_HOSTED
|
||||
uses: ./.github/actions/apt-install-deps
|
||||
- name: Install dependencies
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf build-essential cmake curl eglexternalplatform-dev \
|
||||
extra-cmake-modules file git libcairo2-dev libcurl4-openssl-dev libdbus-1-dev libglew-dev libglu1-mesa-dev \
|
||||
libglu1-mesa-dev libgstreamer1.0-dev libgstreamerd-3-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \
|
||||
libgtk-3-dev libgtk-3-dev libmspack-dev libosmesa6-dev libsecret-1-dev libsoup2.4-dev libssl-dev libudev-dev libwayland-dev \
|
||||
libwebkit2gtk-4.0-dev libxkbcommon-dev locales locales-all m4 pkgconf sudo wayland-protocols wget
|
||||
|
||||
# Tests must built at the same time as the slicer;
|
||||
# if you untangle them feel free to separate them here too
|
||||
- name: Build slicer and tests
|
||||
if: runner.os == 'Linux'
|
||||
- name: Install dependencies from BuildLinux.sh
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
shell: bash
|
||||
run: sudo ./BuildLinux.sh -ur
|
||||
|
||||
- name: Fix permissions
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
shell: bash
|
||||
run: sudo chown $USER -R ./
|
||||
|
||||
- name: Build slicer
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
shell: bash
|
||||
run: |
|
||||
./build_linux.sh -istrlL
|
||||
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
chmod +x ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
tar -cvpf build_tests.tar build/tests
|
||||
|
||||
# Use tar because upload-artifacts won't always preserve directory structure
|
||||
# and doesn't preserve file permissions
|
||||
- name: Upload Test Artifact
|
||||
if: runner.os == 'Linux'
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ github.sha }}-tests
|
||||
overwrite: true
|
||||
path: build_tests.tar
|
||||
retention-days: 5
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Build orca_custom_preset_tests
|
||||
if: github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED
|
||||
working-directory: ${{ github.workspace }}/build/src/Release
|
||||
shell: bash
|
||||
run: |
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -g 1
|
||||
cd ${{ github.workspace }}/resources/profiles
|
||||
zip -r orca_custom_preset_tests.zip user/
|
||||
|
||||
./BuildLinux.sh -isr
|
||||
chmod +x ./build/OrcaSlicer_ubu64.AppImage
|
||||
|
||||
- name: Upload artifacts Ubuntu
|
||||
if: ${{ ! env.ACT && runner.os == 'Linux' }}
|
||||
uses: actions/upload-artifact@v7
|
||||
if: inputs.os == 'ubuntu-20.04'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
|
||||
path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage'
|
||||
|
||||
- name: Upload OrcaSlicer_profile_validator Ubuntu
|
||||
if: ${{ ! env.ACT && runner.os == 'Linux' && !vars.SELF_HOSTED }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
|
||||
path: './build/src/Release/OrcaSlicer_profile_validator'
|
||||
|
||||
- name: Deploy Ubuntu release
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
|
||||
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_nightly.AppImage
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|
||||
- name: Deploy Ubuntu release
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED }}
|
||||
uses: rickstaa/action-create-tag@v1
|
||||
with:
|
||||
tag: "nightly-builds"
|
||||
tag_exists_error: false
|
||||
force_push_tag: true
|
||||
message: "nightly-builds"
|
||||
|
||||
- name: Deploy Ubuntu OrcaSlicer_profile_validator release
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ./build/src/Release/OrcaSlicer_profile_validator
|
||||
asset_name: OrcaSlicer_profile_validator_Linux${{ env.ubuntu-ver-str }}_nightly
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1
|
||||
|
||||
- name: Deploy orca_custom_preset_tests
|
||||
if: ${{ github.repository == 'OrcaSlicer/OrcaSlicer' && ! env.ACT && github.ref == 'refs/heads/main' && runner.os == 'Linux' && !vars.SELF_HOSTED }}
|
||||
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||
with:
|
||||
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
||||
release_id: 137995723
|
||||
asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip
|
||||
asset_name: orca_custom_preset_tests.zip
|
||||
asset_content_type: application/octet-stream
|
||||
max_releases: 1
|
||||
name: OrcaSlicer_Linux_${{ env.ver }}
|
||||
path: './build/OrcaSlicer_ubu64.AppImage'
|
||||
|
||||
2
.github/workflows/check_locale.yml
vendored
2
.github/workflows/check_locale.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install gettext
|
||||
run: |
|
||||
|
||||
118
.github/workflows/check_profiles.yml
vendored
118
.github/workflows/check_profiles.yml
vendored
@@ -1,118 +0,0 @@
|
||||
name: Check profiles
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'resources/profiles/**'
|
||||
- ".github/workflows/check_profiles.yml"
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
logLevel:
|
||||
description: 'Log level'
|
||||
required: true
|
||||
default: 'warning'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
|
||||
jobs:
|
||||
check_profiles:
|
||||
name: Check profiles
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run extra JSON check
|
||||
id: extra_json_check
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set +e
|
||||
python3 ./scripts/orca_extra_profile_check.py 2>&1 | tee ${{ runner.temp }}/extra_json_check.log
|
||||
exit ${PIPESTATUS[0]}
|
||||
|
||||
# download
|
||||
- name: Download
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
curl -LJO https://github.com/SoftFever/Orca_tools/releases/download/1/OrcaSlicer_profile_validator
|
||||
chmod +x ./OrcaSlicer_profile_validator
|
||||
|
||||
# validate profiles
|
||||
- name: validate system profiles
|
||||
id: validate_system
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set +e
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_system.log
|
||||
exit ${PIPESTATUS[0]}
|
||||
|
||||
- name: validate custom presets
|
||||
id: validate_custom
|
||||
continue-on-error: true
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set +e
|
||||
curl -LJO https://github.com/OrcaSlicer/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip
|
||||
unzip -q ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles
|
||||
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2 2>&1 | tee ${{ runner.temp }}/validate_custom.log
|
||||
exit ${PIPESTATUS[0]}
|
||||
|
||||
- name: Prepare comment artifact
|
||||
if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
run: |
|
||||
mkdir -p ${{ runner.temp }}/profile-check-results
|
||||
|
||||
{
|
||||
echo "## :x: Profile Validation Errors"
|
||||
echo ""
|
||||
|
||||
if [ "${{ steps.extra_json_check.outcome }}" = "failure" ]; then
|
||||
echo "### Extra JSON Check Failed"
|
||||
echo ""
|
||||
echo '```'
|
||||
head -c 30000 ${{ runner.temp }}/extra_json_check.log || echo "No output captured"
|
||||
echo '```'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "${{ steps.validate_system.outcome }}" = "failure" ]; then
|
||||
echo "### System Profile Validation Failed"
|
||||
echo ""
|
||||
echo '```'
|
||||
head -c 30000 ${{ runner.temp }}/validate_system.log || echo "No output captured"
|
||||
echo '```'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [ "${{ steps.validate_custom.outcome }}" = "failure" ]; then
|
||||
echo "### Custom Preset Validation Failed"
|
||||
echo ""
|
||||
echo '```'
|
||||
head -c 30000 ${{ runner.temp }}/validate_custom.log || echo "No output captured"
|
||||
echo '```'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "---"
|
||||
echo "*Please fix the above errors and push a new commit.*"
|
||||
} > ${{ runner.temp }}/profile-check-results/pr_comment.md
|
||||
|
||||
echo "${{ github.event.pull_request.number }}" > ${{ runner.temp }}/profile-check-results/pr_number.txt
|
||||
|
||||
- name: Upload comment artifact
|
||||
if: ${{ always() && github.event_name == 'pull_request' && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: profile-check-results
|
||||
path: ${{ runner.temp }}/profile-check-results/
|
||||
retention-days: 1
|
||||
|
||||
- name: Fail if any check failed
|
||||
if: ${{ always() && (steps.extra_json_check.outcome == 'failure' || steps.validate_system.outcome == 'failure' || steps.validate_custom.outcome == 'failure') }}
|
||||
run: |
|
||||
echo "One or more profile checks failed. See above for details."
|
||||
exit 1
|
||||
46
.github/workflows/check_profiles_comment.yml
vendored
46
.github/workflows/check_profiles_comment.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: Post profile check comment
|
||||
|
||||
# NOTE: The workflow name in the 'workflows' filter below must match the 'name'
|
||||
# field in check_profiles.yml exactly. If that name changes, update it here too.
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Check profiles"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
post_comment:
|
||||
name: Post PR comment
|
||||
runs-on: ubuntu-24.04
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' }}
|
||||
steps:
|
||||
- name: Download artifact
|
||||
id: download
|
||||
uses: actions/download-artifact@v8
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: profile-check-results
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
github-token: ${{ github.token }}
|
||||
|
||||
- name: Post comment on PR
|
||||
if: ${{ steps.download.outcome == 'success' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
run: |
|
||||
if [ ! -f pr_number.txt ] || [ ! -f pr_comment.md ]; then
|
||||
echo "No comment artifact found, skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PR_NUMBER=$(cat pr_number.txt)
|
||||
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
|
||||
echo "Invalid PR number: $PR_NUMBER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gh pr comment "$PR_NUMBER" --body-file pr_comment.md
|
||||
81
.github/workflows/dedupe-issues.yml
vendored
81
.github/workflows/dedupe-issues.yml
vendored
@@ -1,81 +0,0 @@
|
||||
name: Orca Issue Dedupe
|
||||
description: Automatically dedupe GitHub issues using AI
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: 'Issue number to process for duplicate detection'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
dedupe-issues:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run Claude Code slash command
|
||||
uses: anthropics/claude-code-base-action@beta
|
||||
with:
|
||||
prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}"
|
||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||
claude_args: "--model claude-sonnet-4-5-20250929"
|
||||
claude_env: |
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log duplicate comment event to Statsig
|
||||
if: always()
|
||||
env:
|
||||
STATSIG_API_KEY: ${{ secrets.STATSIG_API_KEY }}
|
||||
run: |
|
||||
ISSUE_NUMBER=${{ github.event.issue.number || inputs.issue_number }}
|
||||
REPO=${{ github.repository }}
|
||||
|
||||
if [ -z "$STATSIG_API_KEY" ]; then
|
||||
echo "STATSIG_API_KEY not found, skipping Statsig logging"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Prepare the event payload
|
||||
EVENT_PAYLOAD=$(jq -n \
|
||||
--arg issue_number "$ISSUE_NUMBER" \
|
||||
--arg repo "$REPO" \
|
||||
--arg triggered_by "${{ github.event_name }}" \
|
||||
'{
|
||||
events: [{
|
||||
eventName: "github_duplicate_comment_added",
|
||||
value: 1,
|
||||
metadata: {
|
||||
repository: $repo,
|
||||
issue_number: ($issue_number | tonumber),
|
||||
triggered_by: $triggered_by,
|
||||
workflow_run_id: "${{ github.run_id }}"
|
||||
},
|
||||
time: (now | floor | tostring)
|
||||
}]
|
||||
}')
|
||||
|
||||
# Send to Statsig API
|
||||
echo "Logging duplicate comment event to Statsig for issue #${ISSUE_NUMBER}"
|
||||
|
||||
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST https://events.statsigapi.net/v1/log_event \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "STATSIG-API-KEY: ${STATSIG_API_KEY}" \
|
||||
-d "$EVENT_PAYLOAD")
|
||||
|
||||
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
||||
BODY=$(echo "$RESPONSE" | head -n-1)
|
||||
|
||||
if [ "$HTTP_CODE" -eq 200 ] || [ "$HTTP_CODE" -eq 202 ]; then
|
||||
echo "Successfully logged duplicate comment event for issue #${ISSUE_NUMBER}"
|
||||
else
|
||||
echo "Failed to log duplicate comment event for issue #${ISSUE_NUMBER}. HTTP ${HTTP_CODE}: ${BODY}"
|
||||
fi
|
||||
78
.github/workflows/doxygen-docs.yml
vendored
78
.github/workflows/doxygen-docs.yml
vendored
@@ -1,78 +0,0 @@
|
||||
name: Generate Doxygen Documentation
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 1' # Every Monday at midnight UTC
|
||||
workflow_dispatch: # Manual trigger
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
name: Build and Deploy Docs
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
# Only run on main branch of the main repository
|
||||
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: thejerrybao/setup-swap-space@v1
|
||||
with:
|
||||
swap-space-path: /swapfile
|
||||
swap-size-gb: 8
|
||||
remove-existing-swap-files: true
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Doxygen and Graphviz
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y doxygen graphviz
|
||||
|
||||
- name: Generate documentation
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Override DOT_NUM_THREADS to avoid parallel dot race condition bug
|
||||
sed -i 's/^DOT_NUM_THREADS.*/DOT_NUM_THREADS = 1/' .doxygen
|
||||
doxygen .doxygen
|
||||
# Verify documentation was generated
|
||||
if [ ! -f "internal_docs/index.html" ]; then
|
||||
echo "Error: Documentation generation failed - index.html not found"
|
||||
exit 1
|
||||
fi
|
||||
- name: Install Rclone
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo -v
|
||||
curl -fsSL https://rclone.org/install.sh | sudo bash
|
||||
|
||||
- name: optimize
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f internal_docs/Nodes.xml internal_docs/Tokens.xml
|
||||
find internal_docs -name "*.map" -type f -delete || true
|
||||
find internal_docs -name "*.md5" -type f -delete || true
|
||||
|
||||
- name: upload
|
||||
# We configure rclone dynamically using environment variables
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Remove existing config if it exists to avoid conflicts
|
||||
rclone config delete cloudflare 2>/dev/null || true
|
||||
rclone config create cloudflare s3 \
|
||||
provider Cloudflare \
|
||||
access_key_id ${{ secrets.R2_ACCESS_KEY_ID }} \
|
||||
secret_access_key ${{ secrets.R2_SECRET_ACCESS_KEY }} \
|
||||
endpoint ${{ secrets.R2_ENDPOINT }}
|
||||
|
||||
rclone sync internal_docs/ cloudflare:orcaslicer-internals \
|
||||
--progress \
|
||||
--transfers 512 \
|
||||
--checkers 512
|
||||
|
||||
echo "Documentation upload completed successfully"
|
||||
26
.github/workflows/orca_bot.yml
vendored
Normal file
26
.github/workflows/orca_bot.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Orca bot
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
days-before-issue-stale: 90
|
||||
days-before-issue-close: 7
|
||||
operations-per-run: 1000
|
||||
stale-issue-label: "stale"
|
||||
ascending: true
|
||||
stale-issue-message: "GitHub bot: this issue is stale because it has been open for 90 days with no activity."
|
||||
close-issue-message: "GitHub bot: This issue was closed because it has been inactive for 7 days since being marked as stale."
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
remove-issue-stale-when-updated: true
|
||||
remove-pr-stale-when-updated: true
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
39
.github/workflows/publish_docs_to_wiki.yml
vendored
Normal file
39
.github/workflows/publish_docs_to_wiki.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Publish docs to Wiki
|
||||
|
||||
# Trigger this action only if there are changes pushed to the doc/** directory under the main branch
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- doc/** # This includes all sub folders
|
||||
branches:
|
||||
- main # This can be changed to any branch of your preference
|
||||
|
||||
env:
|
||||
USER_TOKEN: ${{ secrets.GH_WIKI_PAT }} # This is the repository secret personal access token
|
||||
USER_NAME: ${{ vars.BOT_USER_NAME }} # Enter the username of your (bot) account
|
||||
OWNER: ${{ github.event.repository.owner.name }} # This is the repository owner
|
||||
REPOSITORY_NAME: ${{ github.event.repository.name }} # This is the repository name
|
||||
|
||||
jobs:
|
||||
publish_docs_to_wiki:
|
||||
name: Publish docs to Wiki
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 1. Clone the current wiki master branch to a folder named `tmp_wiki`
|
||||
- name: Pull content from wiki
|
||||
run: |
|
||||
git config --global user.name "$USER_NAME"
|
||||
git config --global user.email "$USER_NAME"@users.noreply.github.com
|
||||
git clone https://"$USER_TOKEN"@github.com/"$OWNER"/"$REPOSITORY_NAME".wiki.git tmp_wiki
|
||||
# 4. Synchronize differences between `doc` & `tmp_wiki`
|
||||
# 5. Push new Wiki content
|
||||
- name: Push main repo content to wiki
|
||||
run: |
|
||||
rsync -av --delete doc/ tmp_wiki/ --exclude .git
|
||||
cd tmp_wiki
|
||||
git add .
|
||||
git commit -m "Updated Wiki content"
|
||||
git push origin master
|
||||
44
.github/workflows/shellcheck.yml
vendored
44
.github/workflows/shellcheck.yml
vendored
@@ -1,44 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.sh'
|
||||
- 'scripts/linux.d/*'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.sh'
|
||||
- 'scripts/linux.d/*'
|
||||
schedule:
|
||||
- cron: '55 7 * * *' # run once a day near midnight US Pacific time
|
||||
workflow_dispatch: # allows for manual dispatch
|
||||
|
||||
name: "Shellcheck"
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
name: Shellcheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cache shellcheck download
|
||||
id: cache-shellcheck-v0_11
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/shellcheck
|
||||
key: ${{ runner.os }}-shellcheck-v0_11
|
||||
|
||||
- name: Download shellcheck
|
||||
if: steps.cache-shellcheck-v0_11.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_VERSION: "v0.11.0"
|
||||
run: |
|
||||
curl -L#o ~/sc.tar.xz "https://github.com/koalaman/shellcheck/releases/download/${INPUT_VERSION}/shellcheck-${INPUT_VERSION}.linux.x86_64.tar.xz"
|
||||
tar -xvf ~/sc.tar.xz -C ~
|
||||
mv ~/shellcheck-"${INPUT_VERSION}"/shellcheck ~/shellcheck
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Shellcheck scripts
|
||||
run: 'find . -not -name \*.md \( -path ./scripts/linux.d/\* -o -name \*.sh \) -print0 | xargs -0 ~/shellcheck'
|
||||
38
.github/workflows/update-translation.yml
vendored
38
.github/workflows/update-translation.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Update Translation Catalog
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: 0 0 * * 1
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_translation:
|
||||
name: Update translation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install gettext
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gettext
|
||||
|
||||
- name: Update translation catalog
|
||||
run: |
|
||||
./scripts/run_gettext.sh --full
|
||||
git add localization/i18n/*
|
||||
|
||||
- name: Commit translation catalog updates
|
||||
uses: qoomon/actions--create-commit@v1
|
||||
id: commit
|
||||
with:
|
||||
message: Update translation catalog
|
||||
skip-empty: true
|
||||
|
||||
- name: Push changes
|
||||
run: git push
|
||||
14
.github/workflows/winget_updater.yml
vendored
14
.github/workflows/winget_updater.yml
vendored
@@ -1,14 +0,0 @@
|
||||
name: Publish to WinGet
|
||||
on:
|
||||
release:
|
||||
types: [ released ]
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: vedantmgoyal9/winget-releaser@main
|
||||
with:
|
||||
identifier: SoftFever.OrcaSlicer
|
||||
version: ${{ github.event.release.tag_name }}
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
installers-regex: '\.exe$'
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,9 +1,7 @@
|
||||
Build
|
||||
Build.bat
|
||||
/build*/
|
||||
CMakeLists.txt.user
|
||||
**/CMakeLists.txt.autosave
|
||||
deps/build*
|
||||
deps/build
|
||||
MYMETA.json
|
||||
MYMETA.yml
|
||||
_build
|
||||
@@ -19,7 +17,6 @@ xs/assertlib*
|
||||
local-lib
|
||||
/src/TAGS
|
||||
/.vscode/
|
||||
/.vscode
|
||||
build-linux/*
|
||||
deps/build*/*
|
||||
**/.DS_Store
|
||||
@@ -33,16 +30,4 @@ src/OrcaSlicer-doc/
|
||||
**/process_full/
|
||||
**/machine_full/
|
||||
**/filament_full/
|
||||
/deps/DL_CACHE/
|
||||
/deps/DL_CACHE
|
||||
**/.flatpak-builder/
|
||||
*.no-debug.yml
|
||||
resources/profiles/user/default
|
||||
*.code-workspace
|
||||
deps_src/build/
|
||||
test.js
|
||||
/.cache/
|
||||
.clangd
|
||||
internal_docs/
|
||||
*.flatpak
|
||||
/flatpak-repo/
|
||||
/deps/DL_CACHE/
|
||||
23
AGENTS.md
23
AGENTS.md
@@ -1,23 +0,0 @@
|
||||
# Repository Guidelines
|
||||
|
||||
## Project Structure & Module Organization
|
||||
OrcaSlicer’s C++17 sources live in `src/`, split by feature modules and platform adapters. User assets, icons, and printer presets are in `resources/`; translations stay in `localization/`. Tests sit in `tests/`, grouped by domain (`libslic3r/`, `sla_print/`, etc.) with fixtures under `tests/data/`. CMake helpers reside in `cmake/`, and longer references in `doc/` and `SoftFever_doc/`. Automation scripts belong in `scripts/` and `tools/`. Treat everything in `deps/` and `deps_src/` as vendored snapshots—do not modify without mirroring upstream tags.
|
||||
|
||||
## Build, Test, and Development Commands
|
||||
Use out-of-source builds:
|
||||
- `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release` configures dependencies and generates build files.
|
||||
- `cmake --build build --target OrcaSlicer --config Release` compiles the app; add `--parallel` to speed up.
|
||||
- `cmake --build build --target tests` then `ctest --test-dir build --output-on-failure` runs automated suites.
|
||||
Platform helpers such as `build_linux.sh`, `build_release_macos.sh`, and `build_release_vs2022.bat` wrap the same flow with toolchain flags. Use `build_release_macos.sh -sx` when reproducing macOS build issues, and `scripts/DockerBuild.sh` for reproducible container builds.
|
||||
|
||||
## Coding Style & Naming Conventions
|
||||
`.clang-format` enforces 4-space indents, a 140-column limit, aligned initializers, and brace wrapping for classes and functions. Run `clang-format -i <file>` before committing; the CMake `clang-format` target is available when LLVM tools are on your PATH. Prefer `CamelCase` for classes, `snake_case` for functions and locals, and `SCREAMING_CASE` for constants, matching conventions in `src/`. Keep headers self-contained and align include order with the IWYU pragmas.
|
||||
|
||||
## Testing Guidelines
|
||||
Unit tests rely on Catch2 (`tests/catch2/`). Name specs after the component under test—for example `tests/libslic3r/TestPlanarHole.cpp`—and tag long-running cases so `ctest -L fast` remains useful. Cover new algorithms with deterministic fixtures or sample G-code stored in `tests/data/`. Document manual printer validation or regression slicer checks in your PR when automated coverage is insufficient.
|
||||
|
||||
## Commit & Pull Request Guidelines
|
||||
The history favors concise, sentence-style subject lines with optional issue references, e.g., `Fix grid lines origin for multiple plates (#10724)`. Squash fixups locally before opening a PR. Complete `.github/pull_request_template.md`, include reproduction steps or screenshots for UI changes, and mention impacted presets or translations. Link issues via `Closes #NNNN` when applicable, and call out dependency bumps or profile migrations for maintainer review.
|
||||
|
||||
## Security & Configuration Tips
|
||||
Follow `SECURITY.md` for vulnerability reporting. Keep API tokens and printer credentials out of tracked configs; use `sandboxes/` for experimental settings. When touching third-party code in `deps_src/`, record the upstream commit or release in your PR description and run the relevant platform build script to confirm integration.
|
||||
132
Build.PL
Normal file
132
Build.PL
Normal file
@@ -0,0 +1,132 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
print "This script is currently used for installing Perl dependenices for running\n";
|
||||
print "the libslic3r unit / integration tests through Perl prove.\n";
|
||||
print "If you don't plan to run the unit / integration tests, you don't need to\n";
|
||||
print "install these dependencies to build and run OrcaSlicer.\n";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Config;
|
||||
use File::Spec;
|
||||
|
||||
my %prereqs = qw(
|
||||
Devel::CheckLib 0
|
||||
ExtUtils::MakeMaker 6.80
|
||||
ExtUtils::ParseXS 3.22
|
||||
ExtUtils::XSpp 0
|
||||
ExtUtils::XSpp::Cmd 0
|
||||
ExtUtils::CppGuess 0
|
||||
ExtUtils::Typemaps 0
|
||||
ExtUtils::Typemaps::Basic 0
|
||||
File::Basename 0
|
||||
File::Spec 0
|
||||
Getopt::Long 0
|
||||
Module::Build::WithXSpp 0.14
|
||||
Moo 1.003001
|
||||
POSIX 0
|
||||
Scalar::Util 0
|
||||
Test::More 0
|
||||
IO::Scalar 0
|
||||
Time::HiRes 0
|
||||
);
|
||||
my %recommends = qw(
|
||||
Class::XSAccessor 0
|
||||
Test::Harness 0
|
||||
);
|
||||
|
||||
my $sudo = grep { $_ eq '--sudo' } @ARGV;
|
||||
my $nolocal = grep { $_ eq '--nolocal' } @ARGV;
|
||||
|
||||
my @missing_prereqs = ();
|
||||
if ($ENV{SLIC3R_NO_AUTO}) {
|
||||
foreach my $module (sort keys %prereqs) {
|
||||
my $version = $prereqs{$module};
|
||||
next if eval "use $module $version; 1";
|
||||
push @missing_prereqs, $module if exists $prereqs{$module};
|
||||
print "Missing prerequisite $module $version\n";
|
||||
}
|
||||
foreach my $module (sort keys %recommends) {
|
||||
my $version = $recommends{$module};
|
||||
next if eval "use $module $version; 1";
|
||||
print "Missing optional $module $version\n";
|
||||
}
|
||||
} else {
|
||||
my @try = (
|
||||
$ENV{CPANM} // (),
|
||||
File::Spec->catfile($Config{sitebin}, 'cpanm'),
|
||||
File::Spec->catfile($Config{installscript}, 'cpanm'),
|
||||
);
|
||||
|
||||
my $cpanm;
|
||||
foreach my $path (@try) {
|
||||
if (-e $path) { # don't use -x because it fails on Windows
|
||||
$cpanm = $path;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (!$cpanm) {
|
||||
if ($^O =~ /^(?:darwin|linux)$/ && system(qw(which cpanm)) == 0) {
|
||||
$cpanm = 'cpanm';
|
||||
}
|
||||
}
|
||||
die <<'EOF'
|
||||
cpanm was not found. Please install it before running this script.
|
||||
|
||||
There are several ways to install cpanm, try one of these:
|
||||
|
||||
apt-get install cpanminus
|
||||
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
|
||||
cpan App::cpanminus
|
||||
|
||||
If it is installed in a non-standard location you can do:
|
||||
|
||||
CPANM=/path/to/cpanm perl Build.PL
|
||||
|
||||
EOF
|
||||
if !$cpanm;
|
||||
my @cpanm_args = ();
|
||||
push @cpanm_args, "--sudo" if $sudo;
|
||||
|
||||
# install local::lib without --local-lib otherwise it's not usable afterwards
|
||||
if (!eval "use local::lib qw(local-lib); 1") {
|
||||
my $res = system $cpanm, @cpanm_args, 'local::lib';
|
||||
warn "Warning: local::lib is required. You might need to run the `cpanm --sudo local::lib` command in order to install it.\n"
|
||||
if $res != 0;
|
||||
}
|
||||
|
||||
push @cpanm_args, ('--local-lib', 'local-lib') if ! $nolocal;
|
||||
|
||||
# make sure our cpanm is updated (old ones don't support the ~ syntax)
|
||||
system $cpanm, @cpanm_args, 'App::cpanminus';
|
||||
|
||||
my %modules = (%prereqs, %recommends);
|
||||
foreach my $module (sort keys %modules) {
|
||||
my $version = $modules{$module};
|
||||
my @cmd = ($cpanm, @cpanm_args);
|
||||
|
||||
# temporary workaround for upstream bug in test
|
||||
push @cmd, '--notest'
|
||||
if $module =~ /^(?:OpenGL|Test::Harness)$/;
|
||||
|
||||
push @cmd, "$module~$version";
|
||||
|
||||
my $res = system @cmd;
|
||||
if ($res != 0) {
|
||||
if (exists $prereqs{$module}) {
|
||||
push @missing_prereqs, $module;
|
||||
} else {
|
||||
printf "Don't worry, this module is optional.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print "In the next step, you need to build the OrcaSlicer C++ library.\n";
|
||||
print "1) Create a build directory and change to it\n";
|
||||
print "2) run cmake .. -DCMAKE_BUILD_TYPE=Release\n";
|
||||
print "3) run make\n";
|
||||
print "4) to execute the automatic tests, run ctest --verbose\n";
|
||||
__END__
|
||||
253
BuildLinux.sh
Executable file
253
BuildLinux.sh
Executable file
@@ -0,0 +1,253 @@
|
||||
#!/bin/bash
|
||||
|
||||
export ROOT=`pwd`
|
||||
export NCORES=`nproc --all`
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=${NCORES}
|
||||
FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2)
|
||||
FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)
|
||||
|
||||
set -e # exit on first error
|
||||
|
||||
function check_available_memory_and_disk() {
|
||||
FREE_MEM_GB=$(free -g -t | grep 'Mem:' | rev | cut -d" " -f1 | rev)
|
||||
MIN_MEM_GB=10
|
||||
|
||||
FREE_DISK_KB=$(df -k . | tail -1 | awk '{print $4}')
|
||||
MIN_DISK_KB=$((10 * 1024 * 1024))
|
||||
|
||||
if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then
|
||||
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (systen has only ${FREE_MEM_GB}G available)"
|
||||
echo && free -h && echo
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]]; then
|
||||
echo -e "\nERROR: Orca Slicer Builder requires at least $(echo $MIN_DISK_KB |awk '{ printf "%.1fG\n", $1/1024/1024; }') (systen has only $(echo ${FREE_DISK_KB} | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)"
|
||||
echo && df -h . && echo
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function usage() {
|
||||
echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
|
||||
echo " -i: Generate appimage (optional)"
|
||||
echo " -g: force gtk2 build"
|
||||
echo " -b: build in debug mode"
|
||||
echo " -d: build deps (optional)"
|
||||
echo " -s: build orca-slicer (optional)"
|
||||
echo " -u: only update clock & dependency packets (optional and need sudo)"
|
||||
echo " -r: skip free ram check (low ram compiling)"
|
||||
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
|
||||
echo " and then './BuildLinux.sh -dsi'"
|
||||
}
|
||||
|
||||
unset name
|
||||
while getopts ":dsiuhgbr" opt; do
|
||||
case ${opt} in
|
||||
u )
|
||||
UPDATE_LIB="1"
|
||||
;;
|
||||
i )
|
||||
BUILD_IMAGE="1"
|
||||
;;
|
||||
d )
|
||||
BUILD_DEPS="1"
|
||||
;;
|
||||
s )
|
||||
BUILD_ORCA="1"
|
||||
;;
|
||||
b )
|
||||
BUILD_DEBUG="1"
|
||||
;;
|
||||
g )
|
||||
FOUND_GTK3=""
|
||||
;;
|
||||
r )
|
||||
SKIP_RAM_CHECK="1"
|
||||
;;
|
||||
h ) usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $OPTIND -eq 1 ]
|
||||
then
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Addtional Dev packages for OrcaSlicer
|
||||
export REQUIRED_DEV_PACKAGES="libmspack-dev libgstreamerd-3-dev libsecret-1-dev libwebkit2gtk-4.0-dev libosmesa6-dev libssl-dev libcurl4-openssl-dev eglexternalplatform-dev libudev-dev libdbus-1-dev extra-cmake-modules"
|
||||
# libwebkit2gtk-4.1-dev ??
|
||||
export DEV_PACKAGES_COUNT=$(echo ${REQUIRED_DEV_PACKAGES} | wc -w)
|
||||
if [ $(dpkg --get-selections | grep -E "$(echo ${REQUIRED_DEV_PACKAGES} | tr ' ' '|')" | wc -l) -lt ${DEV_PACKAGES_COUNT} ]; then
|
||||
sudo apt install -y ${REQUIRED_DEV_PACKAGES} git cmake wget file gettext
|
||||
fi
|
||||
|
||||
#FIXME: require root for -u option
|
||||
if [[ -n "$UPDATE_LIB" ]]
|
||||
then
|
||||
echo -n -e "Updating linux ...\n"
|
||||
# hwclock -s # DeftDawg: Why does SuperSlicer want to do this?
|
||||
apt update
|
||||
if [[ -z "$FOUND_GTK3" ]]
|
||||
then
|
||||
echo -e "\nInstalling: libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
|
||||
apt install -y libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git
|
||||
else
|
||||
echo -e "\nFind libgtk-3, installing: libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
|
||||
apt install -y libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git
|
||||
fi
|
||||
# for ubuntu 22+ and 23+:
|
||||
ubu_major_version="$(grep VERSION_ID /etc/os-release | cut -d "=" -f 2 | cut -d "." -f 1 | tr -d /\"/)"
|
||||
if [ $ubu_major_version == "22" ] || [ $ubu_major_version == "23" ]
|
||||
then
|
||||
apt install -y curl libfuse-dev libssl-dev libcurl4-openssl-dev m4
|
||||
fi
|
||||
if [[ -n "$BUILD_DEBUG" ]]
|
||||
then
|
||||
echo -e "\nInstalling: libssl-dev libcurl4-openssl-dev\n"
|
||||
apt install -y libssl-dev libcurl4-openssl-dev
|
||||
fi
|
||||
echo -e "done\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
FOUND_GTK2_DEV=$(dpkg -l libgtk* | grep gtk2.0-dev || echo '')
|
||||
FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev || echo '')
|
||||
echo "FOUND_GTK2=$FOUND_GTK2)"
|
||||
if [[ -z "$FOUND_GTK2_DEV" ]]
|
||||
then
|
||||
if [[ -z "$FOUND_GTK3_DEV" ]]
|
||||
then
|
||||
echo "Error, you must install the dependencies before."
|
||||
echo "Use option -u with sudo"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[1/9] Updating submodules..."
|
||||
{
|
||||
# update submodule profiles
|
||||
pushd resources/profiles
|
||||
git submodule update --init
|
||||
popd
|
||||
}
|
||||
|
||||
echo "[2/9] Changing date in version..."
|
||||
{
|
||||
# change date in version
|
||||
sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
|
||||
}
|
||||
echo "done"
|
||||
|
||||
# mkdir in deps
|
||||
if [ ! -d "deps/build" ]
|
||||
then
|
||||
mkdir deps/build
|
||||
fi
|
||||
|
||||
if ! [[ -n "$SKIP_RAM_CHECK" ]]
|
||||
then
|
||||
check_available_memory_and_disk
|
||||
fi
|
||||
|
||||
if [[ -n "$BUILD_DEPS" ]]
|
||||
then
|
||||
echo "[3/9] Configuring dependencies..."
|
||||
BUILD_ARGS=""
|
||||
if [[ -n "$FOUND_GTK3_DEV" ]]
|
||||
then
|
||||
BUILD_ARGS="-DDEP_WX_GTK3=ON"
|
||||
fi
|
||||
if [[ -n "$BUILD_DEBUG" ]]
|
||||
then
|
||||
# have to build deps with debug & release or the cmake won't find evrything it needs
|
||||
mkdir deps/build/release
|
||||
pushd deps/build/release
|
||||
cmake ../.. -DDESTDIR="../destdir" $BUILD_ARGS
|
||||
make -j$NCORES
|
||||
popd
|
||||
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
|
||||
fi
|
||||
|
||||
# cmake deps
|
||||
pushd deps/build
|
||||
cmake .. $BUILD_ARGS
|
||||
echo "done"
|
||||
|
||||
# make deps
|
||||
echo "[4/9] Building dependencies..."
|
||||
make deps -j$NCORES
|
||||
echo "done"
|
||||
|
||||
# rename wxscintilla # TODO: DeftDawg: Does OrcaSlicer need this?
|
||||
# echo "[5/9] Renaming wxscintilla library..."
|
||||
# pushd destdir/usr/local/lib
|
||||
# if [[ -z "$FOUND_GTK3_DEV" ]]
|
||||
# then
|
||||
# cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
|
||||
# else
|
||||
# cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
|
||||
# fi
|
||||
# popd
|
||||
# echo "done"
|
||||
|
||||
# FIXME: only clean deps if compiling succeeds; otherwise reruns waste tonnes of time!
|
||||
# clean deps
|
||||
# echo "[6/9] Cleaning dependencies..."
|
||||
# rm -rf dep_*
|
||||
popd
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
# Create main "build" directory
|
||||
if [ ! -d "build" ]
|
||||
then
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
if [[ -n "$BUILD_ORCA" ]]
|
||||
then
|
||||
echo "[7/9] Configuring Slic3r..."
|
||||
BUILD_ARGS=""
|
||||
if [[ -n "$FOUND_GTK3_DEV" ]]
|
||||
then
|
||||
BUILD_ARGS="-DSLIC3R_GTK=3"
|
||||
fi
|
||||
if [[ -n "$BUILD_DEBUG" ]]
|
||||
then
|
||||
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug -DBBL_INTERNAL_TESTING=1"
|
||||
else
|
||||
BUILD_ARGS="${BUILD_ARGS} -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0"
|
||||
fi
|
||||
|
||||
# cmake
|
||||
pushd build
|
||||
cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS}
|
||||
echo "done"
|
||||
|
||||
# make Slic3r
|
||||
echo "[8/9] Building Slic3r..."
|
||||
make -j$NCORES OrcaSlicer # Slic3r
|
||||
popd
|
||||
./run_gettext.sh
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
if [[ -e $ROOT/build/src/BuildLinuxImage.sh ]]; then
|
||||
# Give proper permissions to script
|
||||
chmod 755 $ROOT/build/src/BuildLinuxImage.sh
|
||||
|
||||
echo "[9/9] Generating Linux app..."
|
||||
pushd build
|
||||
if [[ -n "$BUILD_IMAGE" ]]
|
||||
then
|
||||
$ROOT/build/src/BuildLinuxImage.sh -i
|
||||
else
|
||||
$ROOT/build/src/BuildLinuxImage.sh
|
||||
fi
|
||||
popd
|
||||
echo "done"
|
||||
fi
|
||||
234
CLAUDE.md
234
CLAUDE.md
@@ -1,234 +0,0 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Overview
|
||||
|
||||
OrcaSlicer is an open-source 3D slicer application forked from Bambu Studio, built using C++ with wxWidgets for the GUI and CMake as the build system. The project uses a modular architecture with separate libraries for core slicing functionality, GUI components, and platform-specific code.
|
||||
|
||||
## Build Commands
|
||||
|
||||
### Building on Windows
|
||||
**Always use this command to build the project when testing build issues on Windows.**
|
||||
```bash
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
```
|
||||
|
||||
### Building on macOS
|
||||
**Always use this command to build the project when testing build issues on macOS.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
```
|
||||
|
||||
### Building on Linux
|
||||
**Always use this command to build the project when testing build issues on Linux.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
|
||||
```
|
||||
### Build test:
|
||||
|
||||
**Always use this command to build the project when testing build issues on Windows.**
|
||||
```bash
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
```
|
||||
|
||||
### Building on macOS
|
||||
**Always use this command to build the project when testing build issues on macOS.**
|
||||
```bash
|
||||
cmake --build build/arm64 --config RelWithDebInfo --target all --
|
||||
```
|
||||
|
||||
### Building on Linux
|
||||
**Always use this command to build the project when testing build issues on Linux.**
|
||||
```bash
|
||||
cmake --build build --config RelWithDebInfo --target all --
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Build System
|
||||
- Uses CMake with minimum version 3.13 (maximum 3.31.x on Windows)
|
||||
- Primary build directory: `build/`
|
||||
- Dependencies are built in `deps/build/`
|
||||
- The build process is split into dependency building and main application building
|
||||
- Windows builds use Visual Studio generators
|
||||
- macOS builds use Xcode by default, Ninja with -x flag
|
||||
- Linux builds use Ninja generator
|
||||
|
||||
### Testing
|
||||
Tests are located in the `tests/` directory and use the Catch2 testing framework. Test structure:
|
||||
- `tests/libslic3r/` - Core library tests (21 test files)
|
||||
- Geometry processing, algorithms, file formats (STL, 3MF, AMF)
|
||||
- Polygon operations, clipper utilities, Voronoi diagrams
|
||||
- `tests/fff_print/` - Fused Filament Fabrication tests (12 test files)
|
||||
- Slicing algorithms, G-code generation, print mechanics
|
||||
- Fill patterns, extrusion, support material
|
||||
- `tests/sla_print/` - Stereolithography tests (4 test files)
|
||||
- SLA-specific printing algorithms, support generation
|
||||
- `tests/libnest2d/` - 2D nesting algorithm tests
|
||||
- `tests/slic3rutils/` - Utility function tests
|
||||
- `tests/sandboxes/` - Experimental/sandbox test code
|
||||
|
||||
Run all tests after building:
|
||||
```bash
|
||||
cd build && ctest
|
||||
```
|
||||
|
||||
Run tests with verbose output:
|
||||
```bash
|
||||
cd build && ctest --output-on-failure
|
||||
```
|
||||
|
||||
Run individual test suites:
|
||||
```bash
|
||||
# From build directory
|
||||
ctest --test-dir ./tests/libslic3r/libslic3r_tests
|
||||
ctest --test-dir ./tests/fff_print/fff_print_tests
|
||||
ctest --test-dir ./tests/sla_print/sla_print_tests
|
||||
# and so on
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Core Libraries
|
||||
- **libslic3r/**: Core slicing engine and algorithms (platform-independent)
|
||||
- Main slicing logic, geometry processing, G-code generation
|
||||
- Key classes: Print, PrintObject, Layer, GCode, Config
|
||||
- Modular design with specialized subdirectories:
|
||||
- `GCode/` - G-code generation, cooling, pressure equalization, thumbnails
|
||||
- `Fill/` - Infill pattern implementations (gyroid, honeycomb, lightning, etc.)
|
||||
- `Support/` - Tree supports and traditional support generation
|
||||
- `Geometry/` - Advanced geometry operations, Voronoi diagrams, medial axis
|
||||
- `Format/` - File I/O for 3MF, AMF, STL, OBJ, STEP formats
|
||||
- `SLA/` - SLA-specific print processing and support generation
|
||||
- `Arachne/` - Advanced wall generation using skeletal trapezoidation
|
||||
|
||||
- **src/slic3r/**: Main application framework and GUI
|
||||
- GUI application built with wxWidgets
|
||||
- Integration between libslic3r core and user interface
|
||||
- Located in `src/slic3r/GUI/` (not shown in this directory but exists)
|
||||
|
||||
### Key Algorithmic Components
|
||||
- **Arachne Wall Generation**: Variable-width perimeter generation using skeletal trapezoidation
|
||||
- **Tree Supports**: Organic support generation algorithm
|
||||
- **Lightning Infill**: Sparse infill optimization for internal structures
|
||||
- **Adaptive Slicing**: Variable layer height based on geometry
|
||||
- **Multi-material**: Multi-extruder and soluble support processing
|
||||
- **G-code Post-processing**: Cooling, fan control, pressure advance, conflict checking
|
||||
|
||||
### File Format Support
|
||||
- **3MF/BBS_3MF**: Native format with extensions for multi-material and metadata
|
||||
- **STL**: Standard tessellation language for 3D models
|
||||
- **AMF**: Additive Manufacturing Format with color/material support
|
||||
- **OBJ**: Wavefront OBJ with material definitions
|
||||
- **STEP**: CAD format support for precise geometry
|
||||
- **G-code**: Output format with extensive post-processing capabilities
|
||||
|
||||
### External Dependencies
|
||||
- **Clipper2**: Advanced 2D polygon clipping and offsetting
|
||||
- **libigl**: Computational geometry library for mesh operations
|
||||
- **TBB**: Intel Threading Building Blocks for parallelization
|
||||
- **wxWidgets**: Cross-platform GUI framework
|
||||
- **OpenGL**: 3D graphics rendering and visualization
|
||||
- **CGAL**: Computational Geometry Algorithms Library (selective use)
|
||||
- **OpenVDB**: Volumetric data structures for advanced operations
|
||||
- **Eigen**: Linear algebra library for mathematical operations
|
||||
|
||||
## File Organization
|
||||
|
||||
### Resources and Configuration
|
||||
- `resources/profiles/` - Printer and material profiles organized by manufacturer
|
||||
- `resources/printers/` - Printer-specific configurations and G-code templates
|
||||
- `resources/images/` - UI icons, logos, calibration images
|
||||
- `resources/calib/` - Calibration test patterns and data
|
||||
- `resources/handy_models/` - Built-in test models (benchy, calibration cubes)
|
||||
|
||||
### Internationalization and Localization
|
||||
- `localization/i18n/` - Source translation files (.pot, .po)
|
||||
- `resources/i18n/` - Runtime language resources
|
||||
- Translation managed via `scripts/run_gettext.sh` / `scripts/run_gettext.bat`
|
||||
|
||||
### Platform-Specific Code
|
||||
- `src/libslic3r/Platform.cpp` - Platform abstractions and utilities
|
||||
- `src/libslic3r/MacUtils.mm` - macOS-specific utilities (Objective-C++)
|
||||
- Windows-specific build scripts and configurations
|
||||
- Linux distribution support scripts in `scripts/linux.d/`
|
||||
|
||||
### Build and Development Tools
|
||||
- `cmake/modules/` - Custom CMake find modules and utilities
|
||||
- `scripts/` - Python utilities for profile generation and validation
|
||||
- `tools/` - Windows build tools (gettext utilities)
|
||||
- `deps/` - External dependency build configurations
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Code Style and Standards
|
||||
- **C++17 standard** with selective C++20 features
|
||||
- **Naming conventions**: PascalCase for classes, snake_case for functions/variables
|
||||
- **Header guards**: Use `#pragma once`
|
||||
- **Memory management**: Prefer smart pointers, RAII patterns
|
||||
- **Thread safety**: Use TBB for parallelization, be mindful of shared state
|
||||
|
||||
### Common Development Tasks
|
||||
|
||||
#### Adding New Print Settings
|
||||
1. Define setting in `PrintConfig.cpp` with proper bounds and defaults
|
||||
2. Add UI controls in appropriate GUI components
|
||||
3. Update serialization in config save/load
|
||||
4. Add tooltips and help text for user guidance
|
||||
5. Test with different printer profiles
|
||||
|
||||
#### Modifying Slicing Algorithms
|
||||
1. Core algorithms live in `libslic3r/` subdirectories
|
||||
2. Performance-critical code should be profiled and optimized
|
||||
3. Consider multi-threading implications (TBB integration)
|
||||
4. Validate changes don't break existing profiles
|
||||
5. Add regression tests where appropriate
|
||||
|
||||
#### GUI Development
|
||||
1. GUI code resides in `src/slic3r/GUI/` (not visible in current tree)
|
||||
2. Use existing wxWidgets patterns and custom controls
|
||||
3. Support both light and dark themes
|
||||
4. Consider DPI scaling on high-resolution displays
|
||||
5. Maintain cross-platform compatibility
|
||||
|
||||
#### Adding Printer Support
|
||||
1. Create JSON profile in `resources/profiles/[manufacturer].json`
|
||||
2. Add printer-specific start/end G-code templates
|
||||
3. Configure build volume, capabilities, and material compatibility
|
||||
4. Test thoroughly with actual hardware when possible
|
||||
5. Follow existing profile structure and naming conventions
|
||||
|
||||
### Dependencies and Build System
|
||||
- **CMake-based** with separate dependency building phase
|
||||
- **Dependencies** built once in `deps/build/`, then linked to main application
|
||||
- **Cross-platform** considerations important for all changes
|
||||
- **Resource files** embedded at build time, platform-specific handling
|
||||
|
||||
### Performance Considerations
|
||||
- **Slicing algorithms** are CPU-intensive, profile before optimizing
|
||||
- **Memory usage** can be substantial with complex models
|
||||
- **Multi-threading** extensively used via TBB
|
||||
- **File I/O** optimized for large 3MF files with embedded textures
|
||||
- **Real-time preview** requires efficient mesh processing
|
||||
|
||||
## Important Development Notes
|
||||
|
||||
### Codebase Navigation
|
||||
- Use search tools extensively - codebase has 500k+ lines
|
||||
- Key entry points: `src/OrcaSlicer.cpp` for application startup
|
||||
- Core slicing: `libslic3r/Print.cpp` orchestrates the slicing pipeline
|
||||
- Configuration: `PrintConfig.cpp` defines all print/printer/material settings
|
||||
|
||||
### Compatibility and Stability
|
||||
- **Backward compatibility** maintained for project files and profiles
|
||||
- **Cross-platform** support essential (Windows/macOS/Linux)
|
||||
- **File format** changes require careful version handling
|
||||
- **Profile migrations** needed when settings change significantly
|
||||
|
||||
### Quality and Testing
|
||||
- **Regression testing** important due to algorithm complexity
|
||||
- **Performance benchmarks** help catch performance regressions
|
||||
- **Memory leak** detection important for long-running GUI application
|
||||
- **Cross-platform** testing required before releases
|
||||
365
CMakeLists.txt
365
CMakeLists.txt
@@ -1,75 +1,14 @@
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0")
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Verify that your CMake version is exactly 3.5 series or higher on windows
|
||||
if ( (MSVC OR WIN32) AND (${CMAKE_VERSION} VERSION_LESS "3.5") )
|
||||
message(FATAL_ERROR "CMake current version ${CMAKE_VERSION} is too old. Minimum required is 3.5.")
|
||||
endif()
|
||||
|
||||
# The following line used to be in tests/CMakeLists.txt
|
||||
# Having it there causes rebuilds of all targets on any CMakeLists.txt change under tests/
|
||||
# It has no effect on how code is compiled or linked.
|
||||
# It just lets you later do `set_property(TARGET foo PROPERTY FOLDER "bar")`
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
if (WIN32)
|
||||
# Detect known CI environments
|
||||
set(IS_CI FALSE)
|
||||
if(DEFINED ENV{CI})
|
||||
set(IS_CI TRUE)
|
||||
elseif(DEFINED ENV{GITHUB_ACTIONS})
|
||||
set(IS_CI TRUE)
|
||||
elseif(DEFINED ENV{GITLAB_CI})
|
||||
set(IS_CI TRUE)
|
||||
elseif(DEFINED ENV{TF_BUILD})
|
||||
set(IS_CI TRUE)
|
||||
elseif(DEFINED ENV{BUILD_NUMBER}) # Jenkins
|
||||
set(IS_CI TRUE)
|
||||
endif()
|
||||
|
||||
# Detect common misconfiguration (Strawberry Perl in PATH before CMake)
|
||||
# We use ENV to check the PATH order
|
||||
string(REPLACE "\\" "/" ENV_PATH "$ENV{PATH}")
|
||||
string(FIND "${ENV_PATH}" "Strawberry/c/bin" STRAWBERRY_POS)
|
||||
string(FIND "${ENV_PATH}" "Program Files/CMake/bin" CMAKE_POS)
|
||||
|
||||
if (STRAWBERRY_POS GREATER -1 AND CMAKE_POS GREATER -1 AND STRAWBERRY_POS LESS CMAKE_POS)
|
||||
set(_warning_text "
|
||||
#############################################################
|
||||
Detected Strawberry Perl's 'c/bin' appearing before CMake in PATH.
|
||||
This is known to cause CMake to misbehave (e.g., missing modules).
|
||||
Please adjust your PATH so that:
|
||||
C:\\Program Files\\CMake\\bin
|
||||
appears before:
|
||||
C:\\Strawberry\\c\\bin
|
||||
You can do this in Environment Variables settings.
|
||||
#############################################################
|
||||
")
|
||||
|
||||
if(NOT IS_CI)
|
||||
message(FATAL_ERROR "${_warning_text}")
|
||||
endif()
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
|
||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version")
|
||||
endif ()
|
||||
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif ()
|
||||
|
||||
project(OrcaSlicer)
|
||||
|
||||
# Backward compatibility for old CMake versions
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_VERSION VERSION_LESS "3.25")
|
||||
set(LINUX ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
include("version.inc")
|
||||
include(GNUInstallDirs)
|
||||
include(CMakeDependentOption)
|
||||
@@ -82,76 +21,36 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
|
||||
endif()
|
||||
|
||||
if (DEFINED BBL_RELEASE_TO_PUBLIC)
|
||||
add_compile_definitions("BBL_RELEASE_TO_PUBLIC=${BBL_RELEASE_TO_PUBLIC}")
|
||||
else ()
|
||||
add_compile_definitions("BBL_RELEASE_TO_PUBLIC=$<CONFIG:Release>")
|
||||
endif ()
|
||||
|
||||
find_package(Git)
|
||||
if(DEFINED ENV{git_commit_hash} AND NOT "$ENV{git_commit_hash}" STREQUAL "")
|
||||
message(STATUS "Specified git commit hash: $ENV{git_commit_hash}")
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# Convert the given hash to short hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short "$ENV{git_commit_hash}"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
else()
|
||||
# No .git directory (e.g., Flatpak sandbox) — truncate directly
|
||||
string(SUBSTRING "$ENV{git_commit_hash}" 0 7 GIT_COMMIT_HASH)
|
||||
endif()
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
elseif(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# Check current Git commit hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{SLIC3R_STATIC})
|
||||
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
|
||||
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
|
||||
else()
|
||||
set(SLIC3R_STATIC_INITIAL 1)
|
||||
if (MSVC OR MINGW OR APPLE)
|
||||
set(SLIC3R_STATIC_INITIAL 1)
|
||||
else()
|
||||
set(SLIC3R_STATIC_INITIAL 0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(SLIC3R_STATIC "Compile OrcaSlicer with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
|
||||
option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL, wxWidgets)" 1)
|
||||
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
|
||||
option(SLIC3R_WX_STABLE "Build against wxWidgets stable (3.0) as oppsed to dev (3.1) on Linux" 0)
|
||||
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
|
||||
option(SLIC3R_PCH "Use precompiled headers" 1)
|
||||
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
|
||||
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
|
||||
option(SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0)
|
||||
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
|
||||
# If SLIC3R_FHS is 1 -> SLIC3R_DESKTOP_INTEGRATION is always 0, othrewise variable.
|
||||
CMAKE_DEPENDENT_OPTION(SLIC3R_DESKTOP_INTEGRATION "Allow performing desktop integration during runtime" 1 "NOT SLIC3R_FHS" 0)
|
||||
CMAKE_DEPENDENT_OPTION(SLIC3R_DESKTOP_INTEGRATION "Allow perfoming desktop integration during runtime" 1 "NOT SLIC3R_FHS" 0)
|
||||
|
||||
set(OPENVDB_FIND_MODULE_PATH "" CACHE PATH "Path to OpenVDB installation's find modules.")
|
||||
|
||||
set(SLIC3R_GTK "3" CACHE STRING "GTK version to use with wxWidgets on Linux")
|
||||
set(SLIC3R_GTK "2" CACHE STRING "GTK version to use with wxWidgets on Linux")
|
||||
|
||||
set(IS_CROSS_COMPILE FALSE)
|
||||
|
||||
option (COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
|
||||
if (${COLORED_OUTPUT})
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
add_compile_options (-fdiagnostics-color=always)
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
add_compile_options (-fcolor-diagnostics)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
list(LENGTH CMAKE_OSX_ARCHITECTURES _arch_len)
|
||||
if (_arch_len GREATER 1)
|
||||
message(FATAL_ERROR "OrcaSlicer only supports building for one architecture at a time. Please make sure only one architecture is specified in CMAKE_OSX_ARCHITECTURES")
|
||||
endif ()
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
set(CMAKE_FIND_APPBUNDLE LAST)
|
||||
list(FIND CMAKE_OSX_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR} _arch_idx)
|
||||
@@ -161,24 +60,20 @@ if (APPLE)
|
||||
if (CMAKE_MACOSX_BUNDLE)
|
||||
set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks)
|
||||
endif()
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.orcaslicer.OrcaSlicer")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.softfever3d.orca-slicer")
|
||||
|
||||
message(STATUS "Orca: IS_CROSS_COMPILE: ${IS_CROSS_COMPILE}")
|
||||
endif ()
|
||||
|
||||
# Proposal for C++ unit tests and sandboxes
|
||||
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
|
||||
option(BUILD_TESTS "Build unit tests" OFF)
|
||||
option(ORCA_TOOLS "Build Orca tools" OFF)
|
||||
|
||||
if (FLATPAK)
|
||||
set(SLIC3R_FHS ON CACHE BOOL "" FORCE)
|
||||
set(SLIC3R_DESKTOP_INTEGRATION OFF CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
option(SLIC3R_BUILD_TESTS "Build unit tests" OFF)
|
||||
|
||||
if (IS_CROSS_COMPILE)
|
||||
message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!")
|
||||
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(SLIC3R_PERL_XS OFF CACHE BOOL "" FORCE)
|
||||
set(SLIC3R_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
# Print out the SLIC3R_* cache options
|
||||
@@ -198,13 +93,6 @@ if(SLIC3R_DESKTOP_INTEGRATION)
|
||||
add_definitions(-DSLIC3R_DESKTOP_INTEGRATION)
|
||||
endif ()
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
message(STATUS "Automatically setting CMAKE_INSTALL_PREFIX")
|
||||
set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_BINARY_DIR}/OrcaSlicer")
|
||||
endif()
|
||||
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
set(IS_CLANG_CL TRUE)
|
||||
|
||||
@@ -232,9 +120,6 @@ if (MSVC)
|
||||
# C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data. An integer type is converted to a smaller integer type.
|
||||
# C4267: The compiler detected a conversion from size_t to a smaller type.
|
||||
add_compile_options(/wd4244 /wd4267)
|
||||
# Disable warnings on comparison of unsigned and signed
|
||||
# C4018: signed/unsigned mismatch
|
||||
add_compile_options(/wd4018)
|
||||
endif ()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||
@@ -250,61 +135,24 @@ if (NOT MSVC)
|
||||
add_compile_options(-fsigned-char)
|
||||
endif ()
|
||||
|
||||
if ("${DEP_BUILD_DIR}" STREQUAL "")
|
||||
get_filename_component(BIN_DIR_NAME ${CMAKE_BINARY_DIR} NAME)
|
||||
if (APPLE AND BIN_DIR_NAME STREQUAL "${CMAKE_OSX_ARCHITECTURES}")
|
||||
file(RELATIVE_PATH BIN_DIR_NAME ${CMAKE_BINARY_DIR}/../.. ${CMAKE_BINARY_DIR})
|
||||
endif ()
|
||||
set(DEP_BUILD_DIR "${CMAKE_SOURCE_DIR}/deps/${BIN_DIR_NAME}" CACHE PATH "Path to dependencies build directory" FORCE)
|
||||
message(STATUS "DEP_BUILD_DIR: ${DEP_BUILD_DIR} (generated automatically and saved to cache)")
|
||||
set(AUTOGENERATED_DEP_BUILD_DIR ${DEP_BUILD_DIR} CACHE PATH "Provides the last autogenerated DEP_BUILD_DIR" FORCE)
|
||||
else ()
|
||||
message(STATUS "DEP_BUILD_DIR: ${DEP_BUILD_DIR} (from cache or command line)")
|
||||
endif ()
|
||||
|
||||
if ("${CMAKE_PREFIX_PATH}" STREQUAL "" OR "${CMAKE_PREFIX_PATH}" STREQUAL "${AUTOGENERATED_PREFIX_PATH}")
|
||||
if (DEFINED AUTOGENERATED_DEP_BUILD_DIR AND NOT "${DEP_BUILD_DIR}" STREQUAL "${AUTOGENERATED_DEP_BUILD_DIR}")
|
||||
message(STATUS "CMAKE_PREFIX_PATH is being re-generated due to DEP_BUILD_DIR being manually updated")
|
||||
set(REGEN_DESTDIR TRUE)
|
||||
unset(AUTOGENERATED_DEP_BUILD_DIR CACHE)
|
||||
endif ()
|
||||
else ()
|
||||
unset(AUTOGENERATED_PREFIX_PATH CACHE)
|
||||
endif ()
|
||||
|
||||
# Display and check CMAKE_PREFIX_PATH
|
||||
if ("${CMAKE_PREFIX_PATH}" STREQUAL "" OR REGEN_DESTDIR)
|
||||
set(CMAKE_PREFIX_PATH "${DEP_BUILD_DIR}/OrcaSlicer_dep/usr/local" CACHE PATH "Path to dependencies install directory" FORCE)
|
||||
message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH} (generated automatically and saved to cache)")
|
||||
set(AUTOGENERATED_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE STRING "Provides the last autogenerated CMAKE_PREFIX_PATH" FORCE)
|
||||
unset(REGEN_DESTDIR CACHE)
|
||||
else ()
|
||||
message(STATUS "SLIC3R_STATIC: ${SLIC3R_STATIC}")
|
||||
if (NOT "${CMAKE_PREFIX_PATH}" STREQUAL "")
|
||||
message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH} (from cache or command line)")
|
||||
endif ()
|
||||
set(PREFIX_PATH_CHECK ${CMAKE_PREFIX_PATH})
|
||||
|
||||
# the CMAKE_PREFIX_PATH environment variable is separate from the CMAKE_PREFIX_PATH cache variable and provides additional paths to search for libraries.
|
||||
if (NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
|
||||
set(PREFIX_PATH_CHECK ${CMAKE_PREFIX_PATH})
|
||||
elseif (NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
|
||||
message(STATUS "CMAKE_PREFIX_PATH: $ENV{CMAKE_PREFIX_PATH} (from environment)")
|
||||
list(APPEND PREFIX_PATH_CHECK $ENV{CMAKE_PREFIX_PATH})
|
||||
set(PREFIX_PATH_CHECK $ENV{CMAKE_PREFIX_PATH})
|
||||
else ()
|
||||
message(STATUS "CMAKE_PREFIX_PATH: (default)")
|
||||
endif ()
|
||||
|
||||
# Check all directories in CMAKE_PREFIX_PATH variables
|
||||
foreach (DIR ${PREFIX_PATH_CHECK})
|
||||
if (NOT EXISTS "${DIR}")
|
||||
message(WARNING "CMAKE_PREFIX_PATH element doesn't exist: ${DIR}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
|
||||
set(CMAKE_MACOSX_BUNDLE ON CACHE BOOL "")
|
||||
endif ()
|
||||
|
||||
if (APPLE AND CMAKE_MACOSX_RPATH AND "${CMAKE_INSTALL_RPATH}" STREQUAL "")
|
||||
set(CMAKE_INSTALL_RPATH ${CMAKE_PREFIX_PATH})
|
||||
endif ()
|
||||
|
||||
# Add our own cmake module path.
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/)
|
||||
message(STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
|
||||
@@ -318,7 +166,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT WIN32)
|
||||
# Add DEBUG flags to debug builds.
|
||||
add_compile_definitions("$<IF:$<CONFIG:Debug>,DEBUG,NDEBUG>")
|
||||
add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")
|
||||
endif()
|
||||
|
||||
# To be able to link libslic3r with the Perl XS module.
|
||||
@@ -345,11 +193,7 @@ if(WIN32)
|
||||
endif()
|
||||
else()
|
||||
# Try to use the default Windows 10 SDK path.
|
||||
if (DEFINED ENV{WindowsSdkDir} AND DEFINED ENV{WindowsSDKVersion})
|
||||
set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}")
|
||||
else ()
|
||||
set(WIN10SDK_INCLUDE_PATH "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0")
|
||||
endif ()
|
||||
set(WIN10SDK_INCLUDE_PATH "$ENV{WindowsSdkDir}/Include/$ENV{WindowsSDKVersion}")
|
||||
if (NOT EXISTS "${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h")
|
||||
message("${WIN10SDK_INCLUDE_PATH}/winrt/windows.graphics.printing3d.h was not found")
|
||||
message("STL fixing by the Netfabb service will not be compiled")
|
||||
@@ -359,7 +203,7 @@ if(WIN32)
|
||||
if(WIN10SDK_INCLUDE_PATH)
|
||||
message("Building with Win10 Netfabb STL fixing service support")
|
||||
add_definitions(-DHAS_WIN10SDK)
|
||||
include_directories(SYSTEM "${WIN10SDK_INCLUDE_PATH}")
|
||||
include_directories("${WIN10SDK_INCLUDE_PATH}")
|
||||
else()
|
||||
message("Building without Win10 Netfabb STL fixing service support")
|
||||
endif()
|
||||
@@ -387,7 +231,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_package(DBus REQUIRED)
|
||||
include_directories(SYSTEM ${DBUS_INCLUDE_DIRS})
|
||||
include_directories(${DBUS_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
|
||||
@@ -404,22 +248,6 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
||||
# On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error.
|
||||
add_compile_options(-Werror=return-type)
|
||||
|
||||
# Since some portions of code are just commented out or put under conditional compilation, there are
|
||||
# a bunch of warning related to unused functions and variables. Suppress those warnings to not pollute
|
||||
# compilers diagnostics output with warnings we not going to look at
|
||||
add_compile_options(-Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-label -Wno-unused-local-typedefs)
|
||||
|
||||
# Ignore signed/unsigned comparison warnings
|
||||
add_compile_options(-Wno-sign-compare)
|
||||
|
||||
# The mismatch of tabs and spaces throughout the project can sometimes
|
||||
# cause this warning to appear even though the indentation is fine.
|
||||
# Some includes also cause the warning
|
||||
add_compile_options(-Wno-misleading-indentation)
|
||||
|
||||
# Disable warning if enum value does not have a corresponding case in switch statement
|
||||
add_compile_options(-Wno-switch)
|
||||
|
||||
# removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1)
|
||||
# https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||
@@ -433,38 +261,14 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
|
||||
add_compile_options(-Wno-deprecated-declarations)
|
||||
endif()
|
||||
|
||||
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag(-Wno-error=enum-constexpr-conversion HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
|
||||
if(HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV)
|
||||
add_compile_options(-Wno-error=enum-constexpr-conversion)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||
# We will turn the warning of for GCC for now:
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||
# We will turn the warning of for GCC for now:
|
||||
add_compile_options(-Wno-unknown-pragmas)
|
||||
endif()
|
||||
|
||||
# Compress the debug info with zstd to save space in Flatpak CI builds
|
||||
if(FLATPAK)
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0) OR
|
||||
("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
|
||||
add_compile_options(-gz=zstd)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=template-id-cdtor" )
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if (SLIC3R_ASAN)
|
||||
@@ -477,8 +281,6 @@ if (SLIC3R_ASAN)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
|
||||
else()
|
||||
add_compile_definitions(_DISABLE_STRING_ANNOTATION=1 _DISABLE_VECTOR_ANNOTATION=1)
|
||||
endif ()
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
@@ -492,8 +294,7 @@ if (APPLE)
|
||||
endif ()
|
||||
|
||||
if(MSVC)
|
||||
# Ignore truncating casts in initializers & constructors
|
||||
# https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4305
|
||||
# 添加编译选项,忽略警告 C4305 (格式转换截断)
|
||||
add_compile_options(/wd4305)
|
||||
endif()
|
||||
|
||||
@@ -504,17 +305,17 @@ message(STATUS "LIBDIR: ${LIBDIR}")
|
||||
message(STATUS "LIBDIR_BIN: ${LIBDIR_BIN}")
|
||||
|
||||
# For the bundled boost libraries (boost::nowide)
|
||||
include_directories(SYSTEM ${LIBDIR})
|
||||
include_directories(${LIBDIR})
|
||||
# For generated header files
|
||||
include_directories(SYSTEM ${LIBDIR_BIN}/dev-utils/platform)
|
||||
include_directories(${LIBDIR_BIN}/platform)
|
||||
# For ligigl
|
||||
include_directories(SYSTEM ${LIBDIR}/libigl)
|
||||
include_directories(${LIBDIR}/libigl)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
|
||||
if(MSVC)
|
||||
# BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking.
|
||||
add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x602 -DBOOST_SYSTEM_USE_UTF8 )
|
||||
add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -DBOOST_SYSTEM_USE_UTF8 )
|
||||
# Force the source code encoding to UTF-8. See OrcaSlicer GH pull request #5583
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
@@ -571,18 +372,14 @@ if(SLIC3R_STATIC)
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
# Use boost libraries linked statically to the C++ runtime.
|
||||
# set(Boost_USE_STATIC_RUNTIME ON)
|
||||
else()
|
||||
add_definitions(-DBOOST_LOG_DYN_LINK)
|
||||
endif()
|
||||
#set(Boost_DEBUG ON)
|
||||
# set(Boost_COMPILER "-mgw81")
|
||||
# boost::process was introduced first in version 1.64.0,
|
||||
# boost::beast::detail::base64 was introduced first in version 1.66.0
|
||||
if(POLICY CMP0167)
|
||||
cmake_policy(SET CMP0167 NEW)
|
||||
endif()
|
||||
set(Boost_NO_SYSTEM_PATHS TRUE)
|
||||
find_package(Boost 1.83.0 REQUIRED COMPONENTS system filesystem thread log log_setup locale regex chrono atomic date_time iostreams program_options nowide)
|
||||
set(MINIMUM_BOOST_VERSION "1.66.0")
|
||||
set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams")
|
||||
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components})
|
||||
|
||||
add_library(boost_libs INTERFACE)
|
||||
add_library(boost_headeronly INTERFACE)
|
||||
@@ -599,7 +396,7 @@ endif()
|
||||
function(slic3r_remap_configs targets from_Cfg to_Cfg)
|
||||
if(MSVC)
|
||||
string(TOUPPER ${from_Cfg} from_CFG)
|
||||
|
||||
|
||||
foreach(tgt ${targets})
|
||||
if(TARGET ${tgt})
|
||||
set_target_properties(${tgt} PROPERTIES MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg})
|
||||
@@ -608,8 +405,28 @@ function(slic3r_remap_configs targets from_Cfg to_Cfg)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
target_include_directories(boost_headeronly SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES})
|
||||
if(TARGET Boost::system)
|
||||
message(STATUS "Boost::boost exists")
|
||||
target_link_libraries(boost_headeronly INTERFACE Boost::boost)
|
||||
|
||||
# Only from cmake 3.12
|
||||
# list(TRANSFORM _boost_components PREPEND Boost:: OUTPUT_VARIABLE _boost_targets)
|
||||
set(_boost_targets "")
|
||||
foreach(comp ${_boost_components})
|
||||
list(APPEND _boost_targets "Boost::${comp}")
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(boost_libs INTERFACE
|
||||
boost_headeronly # includes the custom compile definitions as well
|
||||
${_boost_targets}
|
||||
)
|
||||
slic3r_remap_configs("${_boost_targets}" RelWithDebInfo Release)
|
||||
else()
|
||||
target_include_directories(boost_headeronly INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# Find and configure intel-tbb
|
||||
if(SLIC3R_STATIC)
|
||||
@@ -618,7 +435,7 @@ endif()
|
||||
set(TBB_DEBUG 1)
|
||||
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release "")
|
||||
find_package(TBB REQUIRED)
|
||||
# include_directories(SYSTEM ${TBB_INCLUDE_DIRS})
|
||||
# include_directories(${TBB_INCLUDE_DIRS})
|
||||
# add_definitions(${TBB_DEFINITIONS})
|
||||
# if(MSVC)
|
||||
# # Suppress implicit linking of the TBB libraries by the Visual Studio compiler.
|
||||
@@ -629,7 +446,6 @@ find_package(TBB REQUIRED)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(CURL REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
|
||||
|
||||
add_library(libcurl INTERFACE)
|
||||
@@ -661,7 +477,7 @@ if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
|
||||
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
|
||||
target_include_directories(libcurl SYSTEM INTERFACE ${OPENSSL_INCLUDE_DIR})
|
||||
target_include_directories(libcurl INTERFACE ${OPENSSL_INCLUDE_DIR})
|
||||
target_link_libraries(libcurl INTERFACE ${OPENSSL_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
@@ -699,10 +515,6 @@ find_package(PNG REQUIRED)
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
if(APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
set(OPENGL_LIBRARIES "-framework OpenGL" CACHE STRING "OpenGL framework" FORCE)
|
||||
endif()
|
||||
|
||||
set(GLEW_ROOT "${CMAKE_PREFIX_PATH}")
|
||||
message("GLEW_ROOT: ${GLEW_ROOT}")
|
||||
# Find glew or use bundled version
|
||||
@@ -731,13 +543,13 @@ add_custom_target(gettext_make_pot
|
||||
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost
|
||||
-f "${BBL_L18N_DIR}/list.txt"
|
||||
-o "${BBL_L18N_DIR}/OrcaSlicer.pot"
|
||||
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
||||
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Generate pot file from strings in the source tree"
|
||||
)
|
||||
add_custom_target(gettext_merge_po_with_pot
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Merge localization po with new generated pot file"
|
||||
COMMENT "Merge localization po with new generted pot file"
|
||||
)
|
||||
file(GLOB BBL_L10N_PO_FILES "${BBL_L18N_DIR}/*/OrcaSlicer*.po")
|
||||
foreach(po_file ${BBL_L10N_PO_FILES})
|
||||
@@ -786,9 +598,11 @@ endif ()
|
||||
|
||||
find_path(SPNAV_INCLUDE_DIR spnav.h)
|
||||
if (SPNAV_INCLUDE_DIR)
|
||||
find_library(SPNAV_LIB NAMES libspnav.a) # Force linking libspnav statically
|
||||
if (SPNAV_LIB)
|
||||
find_library(HAVE_SPNAV spnav)
|
||||
if (HAVE_SPNAV)
|
||||
add_definitions(-DHAVE_SPNAV)
|
||||
add_library(libspnav SHARED IMPORTED)
|
||||
target_link_libraries(libspnav INTERFACE spnav)
|
||||
message(STATUS "SPNAV library found")
|
||||
else()
|
||||
message(STATUS "SPNAV library NOT found, Spacenavd not supported")
|
||||
@@ -799,12 +613,10 @@ endif()
|
||||
|
||||
set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
|
||||
function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
|
||||
set(_arch "x64")
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86")
|
||||
set(_arch "x86")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(_bits 32)
|
||||
endif ()
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
@@ -821,9 +633,9 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
message ("set out_dir to CMAKE_CURRENT_BINARY_DIR: ${_out_dir}")
|
||||
endif ()
|
||||
|
||||
file(COPY ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win-${_arch}/libgmp-10.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win-${_arch}/libmpfr-4.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/WebView2/lib/win-${_arch}/WebView2Loader.dll
|
||||
file(COPY ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll
|
||||
${TOP_LEVEL_PROJECT_DIR}/deps/WebView2/lib/win${_bits}/WebView2Loader.dll
|
||||
DESTINATION ${_out_dir})
|
||||
|
||||
file(COPY ${CMAKE_PREFIX_PATH}/bin/occt/TKBO.dll
|
||||
@@ -891,28 +703,39 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
|
||||
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
# libslic3r, OrcaSlicer GUI and the OrcaSlicer executable.
|
||||
add_subdirectory(deps_src)
|
||||
add_subdirectory(src)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OrcaSlicer_app_gui)
|
||||
|
||||
add_dependencies(gettext_make_pot hintsToPot)
|
||||
|
||||
# Perl bindings, currently only used for the unit / integration tests of libslic3r.
|
||||
# Also runs the unit / integration tests.
|
||||
#FIXME Port the tests into C++ to finally get rid of the Perl!
|
||||
if (SLIC3R_PERL_XS)
|
||||
add_subdirectory(xs)
|
||||
endif ()
|
||||
|
||||
if(SLIC3R_BUILD_SANDBOXES)
|
||||
add_subdirectory(sandboxes)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTS)
|
||||
if(SLIC3R_BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if (NOT WIN32 AND NOT APPLE)
|
||||
set(SLIC3R_APP_CMD "orca-slicer")
|
||||
configure_file(${LIBDIR}/dev-utils/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh USE_SOURCE_PERMISSIONS @ONLY)
|
||||
configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh @ONLY)
|
||||
endif()
|
||||
|
||||
option(BUILD_BBS_TEST_TOOLS "Build bbs test tools" OFF)
|
||||
if(BUILD_BBS_TEST_TOOLS)
|
||||
add_subdirectory(bbs_test_tools)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -920,7 +743,7 @@ endif()
|
||||
if (WIN32)
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources")
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
|
||||
elseif (SLIC3R_FHS)
|
||||
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
|
||||
@@ -928,7 +751,7 @@ elseif (SLIC3R_FHS)
|
||||
install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES}
|
||||
PATTERN "*/udev" EXCLUDE
|
||||
)
|
||||
install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
install(FILES src/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
foreach(SIZE 32 128 192)
|
||||
install(FILES ${SLIC3R_RESOURCES_DIR}/images/OrcaSlicer_${SIZE}px.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME OrcaSlicer.png
|
||||
@@ -937,21 +760,21 @@ elseif (SLIC3R_FHS)
|
||||
elseif (CMAKE_MACOSX_BUNDLE)
|
||||
# install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/OrcaSlicer.app/Contents/resources")
|
||||
else ()
|
||||
install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
|
||||
install(FILES src/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
|
||||
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
|
||||
endif ()
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ".")
|
||||
configure_file(${LIBDIR}/dev-utils/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/dev-utils/platform/unix/fhs.hpp)
|
||||
configure_file(${LIBDIR}/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fhs.hpp)
|
||||
|
||||
set (CPACK_PACKAGE_NAME "OrcaSlicer")
|
||||
set (CPACK_PACKAGE_VENDOR "SoftFever")
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR "${ORCA_VERSION_MAJOR}")
|
||||
set (CPACK_PACKAGE_VERSION_MINOR "${ORCA_VERSION_MINOR}")
|
||||
set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}")
|
||||
set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_V${SoftFever_VERSION}")
|
||||
set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_${SoftFever_VERSION}")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orca Slicer is an open source slicer for FDM printers")
|
||||
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/OrcaSlicer/OrcaSlicer")
|
||||
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SoftFever/OrcaSlicer")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
||||
set (CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/images\\\\OrcaSlicer.ico")
|
||||
set (CPACK_NSIS_MUI_ICON "${CPACK_PACKAGE_ICON}")
|
||||
|
||||
BIN
OrcaSlicer.mo
Normal file
BIN
OrcaSlicer.mo
Normal file
Binary file not shown.
250
README.md
250
README.md
@@ -1,158 +1,73 @@
|
||||
<div align="center">
|
||||
|
||||
<picture>
|
||||
<img alt="OrcaSlicer logo" src="resources/images/OrcaSlicer.png" width="15%" height="15%">
|
||||
</picture>
|
||||
|
||||
<a href="https://trendshift.io/repositories/15552" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15552" alt="OrcaSlicer%2FOrcaSlicer | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
[](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml)
|
||||
|
||||
OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints.
|
||||
Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection.
|
||||
<h3>
|
||||
|
||||
# Official links and community
|
||||
|
||||
#### Official Website:
|
||||
<a href="https://www.orcaslicer.com/" style="font-size:2em;">OrcaSlicer.com</a>
|
||||
|
||||
#### Github Repository:
|
||||
<a href="https://github.com/OrcaSlicer/OrcaSlicer"><img src="https://img.shields.io/badge/OrcaSlicer-181717?style=flat&logo=github&logoColor=white" width="200" alt="GitHub Logo"/> </a>
|
||||
|
||||
#### Follow us:
|
||||
<a href="https://twitter.com/real_OrcaSlicer"><img src="https://img.shields.io/badge/real__OrcaSlicer-000000?style=flat&logo=x&logoColor=white" width="200" alt="X Logo"/> </a>
|
||||
|
||||
#### Join our Discord community:
|
||||
<a href="https://discord.gg/P4VE9UY9gJ"><img src="https://img.shields.io/badge/-Discord-5865F2?style=flat&logo=discord&logoColor=fff" width="200" alt="discord logo"/> </a>
|
||||
|
||||
<table border="2" style="border-color: #ffa500; background-color:rgb(232, 220, 180); color: #856404;">
|
||||
<tr>
|
||||
<td>
|
||||
<strong>⚠️ CAUTION:</strong><br>
|
||||
Several clickbait and malicious websites, such as <b>orca-slicer[.]com</b> and <b>orcaslicer[.]net</b>, are pretending to be the official OrcaSlicer site. These sites may redirect you to dangerous downloads or contain misleading information.<br>
|
||||
<b>Our only official website is <a href="https://www.orcaslicer.com/">www.orcaslicer.com</a>.</b><br><br>
|
||||
If you come across any of these in search results, please <b>report them</b> as unsafe or phishing to help keep the community secure with:<br>
|
||||
- <a href="https://safebrowsing.google.com/safebrowsing/report_phish/">Google Safe Browsing</a><br>
|
||||
- <a href="https://www.microsoft.com/en-us/wdsi/support/report-unsafe-site">Microsoft Security Intelligence</a><br>
|
||||
- <a href="https://ipthreat.net/tools/reportphishing">IPThreat</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
[](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml)
|
||||
# Orca Slicer
|
||||
Orca Slicer is an open source slicer for FDM printers.
|
||||
You can download Orca Slicer here: [github releases page](https://github.com/SoftFever/OrcaSlicer/releases/).
|
||||
 Join community: [OrcaSlicer Official Discord Server](https://discord.gg/P4VE9UY9gJ)
|
||||
|
||||
# Main features
|
||||
- Auto calibrations for all printers
|
||||
- Sandwich(inner-outer-inner) mode - an improved version of the `External perimeters first` mode
|
||||
- [Precise wall](https://github.com/SoftFever/OrcaSlicer/wiki/Precise-wall)
|
||||
- Polyholes conversion support [SuperSlicer Wiki: Polyholes](https://github.com/supermerill/SuperSlicer/wiki/Polyholes)
|
||||
- Klipper support
|
||||
- More granular controls
|
||||
- More features can be found in [change notes](https://github.com/SoftFever/OrcaSlicer/releases/)
|
||||
|
||||
- **[Advanced Calibration Tools](https://www.orcaslicer.com/wiki/Calibration)**
|
||||
Comprehensive suite: temperature towers, flow rate, retraction & more for optimal performance.
|
||||
- **[Precise Wall](https://www.orcaslicer.com/wiki/quality_settings_precision#precise-wall) and [Seam Control](https://www.orcaslicer.com/wiki/quality_settings_seam)**
|
||||
Adjust outer wall spacing and apply scarf seams to enhance print accuracy.
|
||||
- **[Sandwich Mode](https://www.orcaslicer.com/wiki/quality_settings_wall_and_surfaces#innerouterinner) and [Polyholes](https://www.orcaslicer.com/wiki/quality_settings_precision#polyholes) Support**
|
||||
Use varied infill [patterns](https://www.orcaslicer.com/wiki/strength_settings_patterns) and accurate hole shapes for improved clarity.
|
||||
- **[Overhang](https://www.orcaslicer.com/wiki/quality_settings_overhangs) and [Support Optimization](https://www.orcaslicer.com/wiki#support-settings)**
|
||||
Modify geometry for printable overhangs with precise support placement.
|
||||
- **[Granular Controls and Customization](https://www.orcaslicer.com/wiki#process-settings)**
|
||||
Fine-tune print speed, layer height, pressure, and temperature with precision.
|
||||
- **Network Printer Support**
|
||||
Seamless integration with Klipper, PrusaLink, and OctoPrint for remote control.
|
||||
- **[Mouse Ear Brims](https://www.orcaslicer.com/wiki/others_settings_brim) & [Adaptive Bed Mesh](https://www.orcaslicer.com/wiki/printer_basic_information_adaptive_bed_mesh)**
|
||||
Automatic brims and adaptive mesh calibration ensure consistent adhesion.
|
||||
- **User-Friendly Interface**
|
||||
Intuitive drag-and-drop design with pre-made profiles for popular printers.
|
||||
- **[Open-Source](https://github.com/OrcaSlicer/OrcaSlicer) & [Community Driven](https://discord.gg/P4VE9UY9gJ)**
|
||||
Regular updates fueled by continuous community contributions.
|
||||
- **Wide Printer Compatibility**
|
||||
Supports a broad range of printers: Bambu Lab, Prusa, Creality, Voron, and more.
|
||||
- Additional features can be found in the [change notes](https://github.com/OrcaSlicer/OrcaSlicer/releases/).
|
||||
|
||||
# Wiki
|
||||
|
||||
The [wiki](https://www.orcaslicer.com/wiki) aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.
|
||||
|
||||
- **[Access the wiki here](https://www.orcaslicer.com/wiki)**
|
||||
- **[Contribute to the wiki](https://www.orcaslicer.com/wiki/How-to-wiki)**
|
||||
|
||||
# Download
|
||||
|
||||
## Stable Release
|
||||
|
||||
📥 **[Download the Latest Stable Release](https://github.com/OrcaSlicer/OrcaSlicer/releases/latest)**
|
||||
Visit our GitHub Releases page for the latest stable version of OrcaSlicer, recommended for most users.
|
||||
|
||||
## Nightly Builds
|
||||
|
||||
🌙 **[Download the Latest Nightly Build](https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/nightly-builds)**
|
||||
Explore the latest developments in OrcaSlicer with our nightly builds. Feedback on these versions is highly appreciated.
|
||||
### Some background
|
||||
OrcaSlicer is fork of Bambu Studio
|
||||
It was previously known as BambuStudio-SoftFever
|
||||
Bambu Studio is forked from [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.
|
||||
Orca Slicer incorporates a lot of features from SuperSlicer by @supermerill
|
||||
Orca Slicer's logo is designed by community member Justin Levine(@freejstnalxndr)
|
||||
|
||||
# How to install
|
||||
|
||||
## Windows
|
||||
|
||||
Download the **Windows Installer exe** for your preferred version from the [releases page](https://github.com/OrcaSlicer/OrcaSlicer/releases).
|
||||
|
||||
- *For convenience there is also a portable build available.*
|
||||
<details>
|
||||
<summary>Troubleshooting</summary>
|
||||
|
||||
**Windows**:
|
||||
1. Install and run
|
||||
- *If you have troubles to run the build, you might need to install following runtimes:*
|
||||
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
|
||||
- [Details of this runtime](https://aka.ms/webview2)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703)
|
||||
- [vcredist2019_x64](https://github.com/OrcaSlicer/OrcaSlicer/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
|
||||
- [Alternative Download Link Hosted by Microsoft](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
- This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
|
||||
</details>
|
||||
|
||||
Windows Package Manager
|
||||
|
||||
```shell
|
||||
winget install --id=SoftFever.OrcaSlicer -e
|
||||
```
|
||||
|
||||
## Mac
|
||||
|
||||
1. Download the DMG for your computer: `arm64` version for Apple Silicon and `x86_64` for Intel CPU.
|
||||
2. Drag OrcaSlicer.app to Application folder.
|
||||
3. *If you want to run a build from a PR, you also need to follow the instructions below:*
|
||||
|
||||
<details>
|
||||
<summary>Quarantine</summary>
|
||||
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/SoftFever/BambuStudio-SoftFever/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
|
||||
- [vcredist2019_x64](https://github.com/SoftFever/BambuStudio-SoftFever/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
|
||||
|
||||
**Mac**:
|
||||
1. Download the DMG for your computer: `arm64` version for Apple Silicon and `x86_64` for Intel CPU.
|
||||
2. Drag OrcaSlicer.app to Application folder.
|
||||
3. *If you want to run a build from a PR, you also need following instructions below*
|
||||
<details quarantine>
|
||||
- Option 1 (You only need to do this once. After that the app can be opened normally.):
|
||||
- Step 1: Hold _cmd_ and right click the app, from the context menu choose **Open**.
|
||||
- Step 2: A warning window will pop up, click _Open_
|
||||
|
||||
- Option 2:
|
||||
Execute this command in terminal:
|
||||
|
||||
```shell
|
||||
xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app
|
||||
- Step 2: A warning window will pop up, click _Open_
|
||||
|
||||
- Option 2:
|
||||
Execute this command in terminal: `xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app`
|
||||
```console
|
||||
softfever@mac:~$ xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app
|
||||
```
|
||||
|
||||
- Option 3:
|
||||
- Option 3:
|
||||
- Step 1: open the app, a warning window will pop up
|
||||

|
||||

|
||||
- Step 2: in `System Settings` -> `Privacy & Security`, click `Open Anyway`:
|
||||

|
||||

|
||||
</details>
|
||||
|
||||
**Linux(Ubuntu)**:
|
||||
1. If you run into trouble to execute it, try this command in terminal:
|
||||
`chmod +x /path_to_appimage/OrcaSlicer_ubu64.AppImage`
|
||||
# How to compile
|
||||
- Windows 64-bit
|
||||
- Tools needed: Visual Studio 2019, Cmake, git, Strawberry Perl.
|
||||
- Run `build_release.bat` in `x64 Native Tools Command Prompt for VS 2019`
|
||||
|
||||
## Linux (Ubuntu)
|
||||
- Mac 64-bit
|
||||
- Tools needed: Xcode, Cmake, git, gettext, libtool, automake, autoconf
|
||||
- run `build_release_macos.sh`
|
||||
|
||||
1. If you run into trouble executing it, try this command in the terminal:
|
||||
`chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage`
|
||||
- Ubuntu
|
||||
- run 'sudo ./BuildLinux.sh -u'
|
||||
- run './BuildLinux.sh -dsir'
|
||||
|
||||
# How to Compile
|
||||
|
||||
All updated build instructions for Windows, macOS, and Linux are now available on the official [OrcaSlicer Wiki - How to build](https://www.orcaslicer.com/wiki/How-to-build) page.
|
||||
|
||||
Please refer to the wiki to ensure you're following the latest and most accurate steps for your platform.
|
||||
|
||||
# Klipper Note
|
||||
|
||||
# Note:
|
||||
If you're running Klipper, it's recommended to add the following configuration to your `printer.cfg` file.
|
||||
|
||||
```gcode
|
||||
```
|
||||
# Enable object exclusion
|
||||
[exclude_object]
|
||||
|
||||
@@ -162,48 +77,49 @@ resolution: 0.1
|
||||
```
|
||||
|
||||
# Supports
|
||||
|
||||
**OrcaSlicer** is an open-source project and I'm deeply grateful to all my sponsors and backers.
|
||||
Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
|
||||
**Orca Slicer** is an open-source project, and I'm deeply grateful to all my sponsors and backers.
|
||||
Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
|
||||
Thank you! :)
|
||||
|
||||
## Sponsors:
|
||||
|
||||
### Sponsors:
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://qidi3d.com/" style="display:inline-block; border-radius:8px; background:#fff;">
|
||||
<img src="SoftFever_doc\sponsor_logos\QIDI.png" alt="QIDI" width="100" height="100">
|
||||
<a href="https://peopoly.net/">
|
||||
<img src="SoftFever_doc\sponsor_logos\peopoly-standard-logo.png" alt="Peopoly" width="64" height="">
|
||||
</a>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://bigtree-tech.com/" style="display:inline-block; border-radius:8px; background:#222;">
|
||||
<img src="SoftFever_doc\sponsor_logos\BigTreeTech.png" alt="BIGTREE TECH" width="100" height="100">
|
||||
<a href="https://qidi3d.com/">
|
||||
<img src="SoftFever_doc\sponsor_logos\QIDI.png" alt="QIDI" width="64" height="">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Backers:
|
||||
### Backers:
|
||||
Ko-fi supporters: [Backers list](https://github.com/SoftFever/OrcaSlicer/wiki/OrcaSlicer-backers-%E2%80%90-28-Oct-2023)
|
||||
|
||||
**Ko-fi supporters** ☕: [Backers list](https://github.com/user-attachments/files/16147016/Supporters_638561417699952499.csv)
|
||||
|
||||
## Support me
|
||||
|
||||
<a href="https://github.com/sponsors/SoftFever"><img src="https://img.shields.io/badge/GitHub%20Sponsors-30363D?style=flat&logo=GitHub-Sponsors&logoColor=EA4AAA" height="50"></a>
|
||||
<a href="https://ko-fi.com/G2G5IP3CP"><img src="https://img.shields.io/badge/Support_me_on_Ko--fi-FF5E5B?style=flat&logo=ko-fi&logoColor=white" height="50"></a>
|
||||
<a href="https://paypal.me/softfever3d"><img src="https://img.shields.io/badge/PayPal-003087?style=flat&logo=paypal&logoColor=fff" height="50"></a>
|
||||
|
||||
## Some Background
|
||||
|
||||
Open-source slicing has always been built on a tradition of collaboration and attribution. [Slic3r](https://github.com/Slic3r/Slic3r), created by Alessandro Ranellucci and the RepRap community, laid the foundation. [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research built on Slic3r and acknowledged that heritage. [Bambu Studio](https://github.com/bambulab/BambuStudio) in turn forked from PrusaSlicer, and [SuperSlicer](https://github.com/supermerill/SuperSlicer) by @supermerill extended PrusaSlicer with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before.
|
||||
|
||||
OrcaSlicer began in that same spirit, drawing from BambuStudio, PrusaSlicer, and ideas inspired by CuraSlicer and SuperSlicer. But it has since grown far beyond its origins. Through relentless innovation — introducing advanced calibration tools, precise wall and seam control, tree supports, adaptive slicing, and hundreds of other features — OrcaSlicer has become the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry.
|
||||
|
||||
The OrcaSlicer logo was designed by community member Justin Levine (@freejstnalxndr).
|
||||
Support me
|
||||
[](https://ko-fi.com/G2G5IP3CP)
|
||||
|
||||
# License
|
||||
- **OrcaSlicer** is licensed under the GNU Affero General Public License, version 3.
|
||||
- The **GNU Affero General Public License**, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
|
||||
- OrcaSlicer includes a **pressure advance calibration pattern test** adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
|
||||
- The **Bambu networking plugin** is based on non-free libraries from BambuLab. It is optional to the OrcaSlicer and provides extended functionalities for Bambulab printer users.
|
||||
Orca Slicer is licensed under the GNU Affero General Public License, version 3. Orca Slicer is based on Bambu Studio by BambuLab.
|
||||
|
||||
Bambu Studio is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch.
|
||||
|
||||
PrusaSlicer is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci.
|
||||
|
||||
Slic3r is licensed under the GNU Affero General Public License, version 3. Slic3r was created by Alessandro Ranellucci with the help of many other contributors.
|
||||
|
||||
The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
|
||||
|
||||
Orca Slicer includes a pressure advance calibration pattern test adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
|
||||
|
||||
The bambu networking plugin is based on non-free libraries from Bambulab. It is optional to the Orca Slicer and provides extended functionalities for Bambulab printer users.
|
||||
|
||||
|
||||
1
Readme.txt
Normal file
1
Readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
Init Version
|
||||
47
SECURITY.md
47
SECURITY.md
@@ -1,47 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
At OrcaSlicer, we are committed to maintaining the security of our ecosystem. Our policy is to ensure that we do not introduce vulnerabilities and that any security issues are addressed promptly and responsibly. We appreciate your help in improving the security of OrcaSlicer and thank you for your responsible disclosure.
|
||||
Reporting Security Bugs
|
||||
|
||||
## To report a security bug, please follow these guidelines:
|
||||
|
||||
* Email Security Bugs:
|
||||
Send an email to the lead maintainer at softfeverever@gmail.com.
|
||||
Include the word "SECURITY" in the subject line of your email.
|
||||
|
||||
* Response Times:
|
||||
The lead maintainer will acknowledge receipt of your email within one week (7 days).
|
||||
A detailed response will follow within 48 hours, outlining the next steps for handling your report.
|
||||
After the initial reply, the security team will keep you informed about the progress toward a fix and any announcements.
|
||||
|
||||
* Information and Collaboration:
|
||||
We may request additional information or guidance as we work on addressing the issue.
|
||||
|
||||
* Handling the Report:
|
||||
OrcaSlicer will confirm the problem and determine the affected versions.
|
||||
We will audit the code to find any similar issues and prepare fixes for all releases still under maintenance.
|
||||
Fixes will be released as quickly as possible.
|
||||
|
||||
* Third-Party Modules:
|
||||
Report security issues in third-party modules to the respective maintainer of those modules.
|
||||
|
||||
## Security Disclosure Guidelines
|
||||
|
||||
When disclosing a vulnerability, please follow these steps to ensure your report is clear and actionable:
|
||||
|
||||
* Provide Detailed Information:
|
||||
Scope: Clearly define the scope of the vulnerability.
|
||||
Potential Impact: Let us know who could be affected by this exploit.
|
||||
Reproduction Steps: Document detailed steps to reproduce the vulnerability.
|
||||
|
||||
Reference OWASP Guidelines:
|
||||
Follow the <a href="https://cheatsheetseries.owasp.org/cheatsheets/Vulnerability_Disclosure_Cheat_Sheet.html">OWASP Vulnerability Disclosure Cheat Sheet</a> for best practices in vulnerability disclosure.
|
||||
|
||||
## Security Recommendations
|
||||
|
||||
To enhance security when using OrcaSlicer, we recommend following these steps:
|
||||
|
||||
* SEE SOMETHING: If you notice anything suspicious or have concerns, please report it.
|
||||
* SAY SOMETHING: If you have any doubts or need assistance, do not hesitate to contact us.
|
||||
|
||||
### Thank you for your commitment to the security of OrcaSlicer. Your efforts help us maintain a safe and reliable ecosystem.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 62 KiB |
BIN
SoftFever_doc/sponsor_logos/peopoly-standard-logo.png
Normal file
BIN
SoftFever_doc/sponsor_logos/peopoly-standard-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
377
build_flatpak.sh
377
build_flatpak.sh
@@ -1,377 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# OrcaSlicer Flatpak Build Script
|
||||
# This script builds and packages OrcaSlicer as a Flatpak package locally
|
||||
# Based on the GitHub Actions workflow in .github/workflows/build_all.yml
|
||||
|
||||
set -e
|
||||
SECONDS=0
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Default values
|
||||
ARCH=$(uname -m)
|
||||
BUILD_DIR="build_flatpak"
|
||||
CLEANUP=false
|
||||
INSTALL_RUNTIME=false
|
||||
JOBS=$(nproc)
|
||||
FORCE_CLEAN=false
|
||||
ENABLE_CCACHE=false
|
||||
DISABLE_ROFILES_FUSE=false
|
||||
NO_DEBUGINFO=true
|
||||
CACHE_DIR=".flatpak-builder"
|
||||
|
||||
# Help function
|
||||
show_help() {
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Build OrcaSlicer as a Flatpak package"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -a, --arch ARCH Target architecture (x86_64, aarch64) [default: $ARCH]"
|
||||
echo " -d, --build-dir DIR Build directory [default: $BUILD_DIR]"
|
||||
echo " -j, --jobs JOBS Number of parallel build jobs for flatpak-builder and modules [default: $JOBS]"
|
||||
echo " -c, --cleanup Clean build directory before building"
|
||||
echo " -f, --force-clean Force clean build (disables caching)"
|
||||
echo " --ccache Enable ccache for faster rebuilds (requires ccache in SDK)"
|
||||
echo " --disable-rofiles-fuse Disable rofiles-fuse (workaround for FUSE issues)"
|
||||
echo " --with-debuginfo Include debug info (slower builds, needed for Flathub)"
|
||||
echo " --cache-dir DIR Flatpak builder cache directory [default: $CACHE_DIR]"
|
||||
echo " -i, --install-runtime Install required Flatpak runtime and SDK"
|
||||
echo " -h, --help Show this help message"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0 # Build for current architecture with caching enabled"
|
||||
echo " $0 -f # Force clean build (no caching)"
|
||||
echo " $0 --ccache -j 8 # Use ccache and 8 parallel jobs for faster builds"
|
||||
echo " $0 -a x86_64 -c # Build for x86_64 and cleanup first"
|
||||
echo " $0 -i -j 16 --ccache # Install runtime, build with 16 jobs and ccache"
|
||||
}
|
||||
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-a|--arch)
|
||||
ARCH="$2"
|
||||
shift 2
|
||||
;;
|
||||
-d|--build-dir)
|
||||
BUILD_DIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
-j|--jobs)
|
||||
JOBS="$2"
|
||||
shift 2
|
||||
;;
|
||||
-c|--cleanup)
|
||||
CLEANUP=true
|
||||
shift
|
||||
;;
|
||||
-f|--force-clean)
|
||||
FORCE_CLEAN=true
|
||||
shift
|
||||
;;
|
||||
--ccache)
|
||||
ENABLE_CCACHE=true
|
||||
shift
|
||||
;;
|
||||
--disable-rofiles-fuse)
|
||||
DISABLE_ROFILES_FUSE=true
|
||||
shift
|
||||
;;
|
||||
--with-debuginfo)
|
||||
NO_DEBUGINFO=false
|
||||
shift
|
||||
;;
|
||||
--cache-dir)
|
||||
CACHE_DIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
-i|--install-runtime)
|
||||
INSTALL_RUNTIME=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo -e "${RED}Error: Unknown option $1${NC}"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Validate architecture
|
||||
if [[ "$ARCH" != "x86_64" && "$ARCH" != "aarch64" ]]; then
|
||||
echo -e "${RED}Error: Unsupported architecture '$ARCH'. Supported: x86_64, aarch64${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate jobs parameter
|
||||
if ! [[ "$JOBS" =~ ^[1-9][0-9]*$ ]]; then
|
||||
echo -e "${RED}Error: Jobs must be a positive integer, got '$JOBS'${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${BLUE}OrcaSlicer Flatpak Build Script${NC}"
|
||||
echo -e "${BLUE}================================${NC}"
|
||||
echo -e "Architecture: ${GREEN}$ARCH${NC}"
|
||||
echo -e "Build directory: ${GREEN}$BUILD_DIR${NC}"
|
||||
echo -e "Cache directory: ${GREEN}$CACHE_DIR${NC}"
|
||||
echo -e "Parallel jobs: ${GREEN}$JOBS${NC}"
|
||||
if [[ "$FORCE_CLEAN" == true ]]; then
|
||||
echo -e "Cache mode: ${RED}DISABLED (force clean)${NC}"
|
||||
else
|
||||
echo -e "Cache mode: ${GREEN}ENABLED${NC}"
|
||||
fi
|
||||
if [[ "$ENABLE_CCACHE" == true ]]; then
|
||||
echo -e "Ccache: ${GREEN}ENABLED${NC}"
|
||||
else
|
||||
echo -e "Ccache: ${YELLOW}DISABLED${NC}"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Check available disk space (flatpak builds need several GB)
|
||||
AVAILABLE_SPACE=$(df . | awk 'NR==2 {print $4}')
|
||||
REQUIRED_SPACE=$((5 * 1024 * 1024)) # 5GB in KB
|
||||
|
||||
if [[ $AVAILABLE_SPACE -lt $REQUIRED_SPACE ]]; then
|
||||
echo -e "${YELLOW}Warning: Low disk space detected.${NC}"
|
||||
echo -e "Available: $(( AVAILABLE_SPACE / 1024 / 1024 ))GB, Recommended: 5GB+"
|
||||
echo -e "Continue anyway? (y/N)"
|
||||
read -r response
|
||||
if [[ ! "$response" =~ ^[Yy]$ ]]; then
|
||||
echo "Build cancelled by user"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if flatpak is installed
|
||||
if ! command -v flatpak &> /dev/null; then
|
||||
echo -e "${RED}Error: Flatpak is not installed. Please install it first.${NC}"
|
||||
echo "On Ubuntu/Debian: sudo apt install flatpak"
|
||||
echo "On Fedora: sudo dnf install flatpak"
|
||||
echo "On Arch: sudo pacman -S flatpak"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if flatpak-builder is installed
|
||||
if ! command -v flatpak-builder &> /dev/null; then
|
||||
echo -e "${RED}Error: flatpak-builder is not installed. Please install it first.${NC}"
|
||||
echo "On Ubuntu/Debian: sudo apt install flatpak-builder"
|
||||
echo "On Fedora: sudo dnf install flatpak-builder"
|
||||
echo "On Arch: sudo pacman -S flatpak-builder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check additional build dependencies
|
||||
echo -e "${YELLOW}Checking build dependencies...${NC}"
|
||||
MISSING_DEPS=()
|
||||
|
||||
if ! command -v cmake &> /dev/null; then
|
||||
MISSING_DEPS+=("cmake")
|
||||
fi
|
||||
|
||||
if ! command -v ninja &> /dev/null && ! command -v make &> /dev/null; then
|
||||
MISSING_DEPS+=("ninja or make")
|
||||
fi
|
||||
|
||||
if ! command -v pkg-config &> /dev/null; then
|
||||
MISSING_DEPS+=("pkg-config")
|
||||
fi
|
||||
|
||||
if [ ${#MISSING_DEPS[@]} -ne 0 ]; then
|
||||
echo -e "${RED}Error: Missing required build dependencies: ${MISSING_DEPS[*]}${NC}"
|
||||
echo "On Ubuntu/Debian: sudo apt install cmake ninja-build pkg-config"
|
||||
echo "On Fedora: sudo dnf install cmake ninja-build pkgconfig"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}All required dependencies found${NC}"
|
||||
|
||||
# Install runtime and SDK if requested
|
||||
if [[ "$INSTALL_RUNTIME" == true ]]; then
|
||||
echo -e "${YELLOW}Installing GNOME runtime and SDK...${NC}"
|
||||
flatpak install --user -y flathub org.gnome.Platform//49
|
||||
flatpak install --user -y flathub org.gnome.Sdk//49
|
||||
fi
|
||||
|
||||
# Check if required runtime is available
|
||||
if ! flatpak info --user org.gnome.Platform//49 &> /dev/null; then
|
||||
echo -e "${RED}Error: GNOME Platform 49 runtime is not installed.${NC}"
|
||||
echo "Run with -i flag to install it automatically, or install manually:"
|
||||
echo "flatpak install --user flathub org.gnome.Platform//49"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! flatpak info --user org.gnome.Sdk//49 &> /dev/null; then
|
||||
echo -e "${RED}Error: GNOME SDK 49 is not installed.${NC}"
|
||||
echo "Run with -i flag to install it automatically, or install manually:"
|
||||
echo "flatpak install --user flathub org.gnome.Sdk//49"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get version information
|
||||
echo -e "${YELLOW}Getting version information...${NC}"
|
||||
if [[ -f "version.inc" ]]; then
|
||||
VER_PURE=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
||||
VER="V$VER_PURE"
|
||||
DATE=$(date +'%Y%m%d')
|
||||
echo -e "Version: ${GREEN}$VER${NC}"
|
||||
echo -e "Date: ${GREEN}$DATE${NC}"
|
||||
else
|
||||
echo -e "${RED}Error: version.inc not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cleanup build directory if requested
|
||||
if [[ "$CLEANUP" == true ]]; then
|
||||
echo -e "${YELLOW}Cleaning up flatpak-specific build directories...${NC}"
|
||||
rm -rf deps/build_flatpak build_flatpak
|
||||
|
||||
echo -e "${YELLOW}Cleaning up flatpak build directories...${NC}"
|
||||
rm -rf "$BUILD_DIR"
|
||||
|
||||
# Only clean cache if force-clean is enabled
|
||||
if [[ "$FORCE_CLEAN" == true ]]; then
|
||||
echo -e "${YELLOW}Cleaning up flatpak build cache...${NC}"
|
||||
rm -rf "$CACHE_DIR"
|
||||
else
|
||||
echo -e "${BLUE}Preserving build cache at: $CACHE_DIR${NC}"
|
||||
fi
|
||||
|
||||
echo -e "${BLUE}Note: Host build directories (deps/build, build) are preserved${NC}"
|
||||
fi
|
||||
|
||||
# Create build directory
|
||||
mkdir -p "$BUILD_DIR"
|
||||
rm -rf "$BUILD_DIR/build-dir"
|
||||
|
||||
# Check if flatpak manifest exists
|
||||
if [[ ! -f "./scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" ]]; then
|
||||
echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/com.orcaslicer.OrcaSlicer.yml${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build the Flatpak
|
||||
echo -e "${YELLOW}Building Flatpak package...${NC}"
|
||||
echo -e "This may take a while (30+ minutes depending on your system)..."
|
||||
echo ""
|
||||
|
||||
BUNDLE_NAME="OrcaSlicer-Linux-flatpak_${VER}_${ARCH}.flatpak"
|
||||
|
||||
# Remove any existing bundle
|
||||
rm -f "$BUNDLE_NAME"
|
||||
|
||||
# Create necessary directories inside repo
|
||||
mkdir -p "$BUILD_DIR/cache" "$BUILD_DIR/flatpak-builder"
|
||||
|
||||
# Set environment variables to match GitHub Actions
|
||||
export FLATPAK_BUILDER_N_JOBS=$JOBS
|
||||
|
||||
echo -e "${BLUE}Running flatpak-builder...${NC}"
|
||||
echo -e "Using $JOBS parallel jobs for flatpak-builder and $FLATPAK_BUILDER_N_JOBS for module builds"
|
||||
|
||||
# Check flatpak-builder version to determine available options
|
||||
FLATPAK_BUILDER_VERSION=$(flatpak-builder --version 2>/dev/null | head -1 | awk '{print $2}' || echo "unknown")
|
||||
echo -e "flatpak-builder version: $FLATPAK_BUILDER_VERSION"
|
||||
|
||||
# Build command with caching support
|
||||
BUILDER_ARGS=(
|
||||
--arch="$ARCH"
|
||||
--user
|
||||
--install-deps-from=flathub
|
||||
--repo="$BUILD_DIR/repo"
|
||||
--verbose
|
||||
--state-dir="$CACHE_DIR"
|
||||
--jobs="$JOBS"
|
||||
--mirror-screenshots-url=https://dl.flathub.org/media/
|
||||
)
|
||||
|
||||
# Add force-clean only if explicitly requested (disables caching)
|
||||
if [[ "$FORCE_CLEAN" == true ]]; then
|
||||
BUILDER_ARGS+=(--force-clean)
|
||||
echo -e "${YELLOW}Using --force-clean (caching disabled)${NC}"
|
||||
else
|
||||
echo -e "${GREEN}Using build cache for faster rebuilds${NC}"
|
||||
fi
|
||||
|
||||
# Add ccache if enabled
|
||||
if [[ "$ENABLE_CCACHE" == true ]]; then
|
||||
BUILDER_ARGS+=(--ccache)
|
||||
echo -e "${GREEN}Using ccache for compiler caching${NC}"
|
||||
fi
|
||||
|
||||
# Disable rofiles-fuse if requested (workaround for FUSE issues)
|
||||
if [[ "$DISABLE_ROFILES_FUSE" == true ]]; then
|
||||
BUILDER_ARGS+=(--disable-rofiles-fuse)
|
||||
echo -e "${YELLOW}rofiles-fuse disabled${NC}"
|
||||
fi
|
||||
|
||||
# Use a temp manifest with no-debuginfo if requested
|
||||
MANIFEST="scripts/flatpak/com.orcaslicer.OrcaSlicer.yml"
|
||||
if [[ "$NO_DEBUGINFO" == true ]]; then
|
||||
MANIFEST="scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
|
||||
sed '/^build-options:/a\ no-debuginfo: true\n strip: true' \
|
||||
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml > "$MANIFEST"
|
||||
echo -e "${YELLOW}Debug info disabled (using temp manifest)${NC}"
|
||||
fi
|
||||
|
||||
if ! flatpak-builder \
|
||||
"${BUILDER_ARGS[@]}" \
|
||||
"$BUILD_DIR/build-dir" \
|
||||
"$MANIFEST"; then
|
||||
echo -e "${RED}Error: flatpak-builder failed${NC}"
|
||||
echo -e "${YELLOW}Check the build log above for details${NC}"
|
||||
rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Clean up temp manifest
|
||||
rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml"
|
||||
|
||||
# Create bundle
|
||||
echo -e "${YELLOW}Creating Flatpak bundle...${NC}"
|
||||
if ! flatpak build-bundle \
|
||||
"$BUILD_DIR/repo" \
|
||||
"$BUNDLE_NAME" \
|
||||
com.orcaslicer.OrcaSlicer \
|
||||
--arch="$ARCH"; then
|
||||
echo -e "${RED}Error: Failed to create Flatpak bundle${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Success message
|
||||
echo ""
|
||||
echo -e "${GREEN}✓ Flatpak build completed successfully!${NC}"
|
||||
echo -e "Bundle created: ${GREEN}$BUNDLE_NAME${NC}"
|
||||
echo -e "Size: ${GREEN}$(du -h "$BUNDLE_NAME" | cut -f1)${NC}"
|
||||
if [[ "$FORCE_CLEAN" != true ]]; then
|
||||
echo -e "Build cache: ${GREEN}$CACHE_DIR${NC} (preserved for faster future builds)"
|
||||
fi
|
||||
echo ""
|
||||
echo -e "${BLUE}To install the Flatpak:${NC}"
|
||||
echo -e "flatpak install --user $BUNDLE_NAME"
|
||||
echo ""
|
||||
echo -e "${BLUE}To run OrcaSlicer:${NC}"
|
||||
echo -e "flatpak run com.orcaslicer.OrcaSlicer"
|
||||
echo ""
|
||||
echo -e "${BLUE}To uninstall:${NC}"
|
||||
echo -e "flatpak uninstall --user com.orcaslicer.OrcaSlicer"
|
||||
echo ""
|
||||
if [[ "$FORCE_CLEAN" != true ]]; then
|
||||
echo -e "${BLUE}Cache Management:${NC}"
|
||||
echo -e "• Subsequent builds will be faster thanks to caching"
|
||||
echo -e "• To force a clean build: $0 -f"
|
||||
echo -e "• To clean cache manually: rm -rf $CACHE_DIR"
|
||||
fi
|
||||
|
||||
elapsed=$SECONDS
|
||||
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
|
||||
275
build_linux.sh
275
build_linux.sh
@@ -1,275 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e # Exit immediately if a command exits with a non-zero status.
|
||||
SECONDS=0
|
||||
|
||||
SCRIPT_NAME=$(basename "$0")
|
||||
SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
|
||||
|
||||
pushd "${SCRIPT_PATH}" > /dev/null
|
||||
|
||||
function usage() {
|
||||
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-h][-i][-j N][-p][-r][-s][-t][-u][-l][-L]"
|
||||
echo " -1: limit builds to one core (where possible)"
|
||||
echo " -j N: limit builds to N cores (where possible)"
|
||||
echo " -b: build in Debug mode"
|
||||
echo " -c: force a clean build"
|
||||
echo " -C: enable ANSI-colored compile output (GNU/Clang only)"
|
||||
echo " -d: download and build dependencies in ./deps/ (build prerequisite)"
|
||||
echo " -D: dry run"
|
||||
echo " -e: build in RelWithDebInfo mode"
|
||||
echo " -h: prints this help text"
|
||||
echo " -i: build the Orca Slicer AppImage (optional)"
|
||||
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)"
|
||||
echo " -r: skip RAM and disk checks (low RAM compiling)"
|
||||
echo " -s: build the Orca Slicer (optional)"
|
||||
echo " -t: build tests (optional), requires -s flag"
|
||||
echo " -u: install system dependencies (asks for sudo password; build prerequisite)"
|
||||
echo " -l: use Clang instead of GCC (default: GCC)"
|
||||
echo " -L: use ld.lld as linker (if available)"
|
||||
echo "For a first use, you want to './${SCRIPT_NAME} -u'"
|
||||
echo " and then './${SCRIPT_NAME} -dsi'"
|
||||
}
|
||||
|
||||
SLIC3R_PRECOMPILED_HEADERS="ON"
|
||||
|
||||
unset name
|
||||
BUILD_DIR=build
|
||||
BUILD_CONFIG=Release
|
||||
while getopts ":1j:bcCdDehiprstulL" opt ; do
|
||||
case ${opt} in
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
;;
|
||||
j )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG
|
||||
;;
|
||||
b )
|
||||
BUILD_DIR=build-dbg
|
||||
BUILD_CONFIG=Debug
|
||||
;;
|
||||
c )
|
||||
CLEAN_BUILD=1
|
||||
;;
|
||||
C )
|
||||
COLORED_OUTPUT="-DCOLORED_OUTPUT=ON"
|
||||
;;
|
||||
d )
|
||||
BUILD_DEPS="1"
|
||||
;;
|
||||
D )
|
||||
DRY_RUN="1"
|
||||
;;
|
||||
e )
|
||||
BUILD_DIR=build-dbginfo
|
||||
BUILD_CONFIG=RelWithDebInfo
|
||||
;;
|
||||
h ) usage
|
||||
exit 1
|
||||
;;
|
||||
i )
|
||||
BUILD_IMAGE="1"
|
||||
;;
|
||||
p )
|
||||
SLIC3R_PRECOMPILED_HEADERS="OFF"
|
||||
;;
|
||||
r )
|
||||
SKIP_RAM_CHECK="1"
|
||||
;;
|
||||
s )
|
||||
BUILD_ORCA="1"
|
||||
;;
|
||||
t )
|
||||
BUILD_TESTS="1"
|
||||
;;
|
||||
u )
|
||||
export UPDATE_LIB="1"
|
||||
;;
|
||||
l )
|
||||
USE_CLANG="1"
|
||||
;;
|
||||
L )
|
||||
USE_LLD="1"
|
||||
;;
|
||||
* )
|
||||
echo "Unknown argument '${opt}', aborting."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${OPTIND} -eq 1 ] ; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function check_available_memory_and_disk() {
|
||||
FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev)
|
||||
MIN_MEM_GB=10
|
||||
|
||||
FREE_DISK_KB=$(df --block-size=1K . | tail -1 | awk '{print $4}')
|
||||
MIN_DISK_KB=$((10 * 1024 * 1024))
|
||||
|
||||
if [[ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]] ; then
|
||||
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (system has only ${FREE_MEM_GB}G available)"
|
||||
echo && free --human && echo
|
||||
echo "Invoke with -r to skip RAM and disk checks."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]] ; then
|
||||
echo -e "\nERROR: Orca Slicer Builder requires at least $(echo "${MIN_DISK_KB}" |awk '{ printf "%.1fG\n", $1/1024/1024; }') (system has only $(echo "${FREE_DISK_KB}" | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)"
|
||||
echo && df --human-readable . && echo
|
||||
echo "Invoke with -r to skip ram and disk checks."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function print_and_run() {
|
||||
cmd=()
|
||||
# Remove empty arguments, leading and trailing spaces
|
||||
for item in "$@" ; do
|
||||
if [[ -n $item ]]; then
|
||||
cmd+=( "$(echo "${item}" | xargs)" )
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${cmd[@]}"
|
||||
if [[ -z "${DRY_RUN}" ]] ; then
|
||||
"${cmd[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
# cmake 4.x compatibility workaround
|
||||
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
|
||||
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"')
|
||||
DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"')
|
||||
# Check for direct distribution match to Ubuntu/Debian
|
||||
if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ] ; then
|
||||
DISTRIBUTION="debian"
|
||||
# Check if distribution is Debian/Ubuntu-like based on ID_LIKE
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]] ; then
|
||||
DISTRIBUTION="debian"
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]] ; then
|
||||
DISTRIBUTION="arch"
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"suse"* ]] ; then
|
||||
DISTRIBUTION="suse"
|
||||
fi
|
||||
|
||||
if [ ! -f "./scripts/linux.d/${DISTRIBUTION}" ] ; then
|
||||
echo "Your distribution \"${DISTRIBUTION}\" is not supported by system-dependency scripts in ./scripts/linux.d/"
|
||||
echo "Please resolve dependencies manually and contribute a script for your distribution to upstream."
|
||||
exit 1
|
||||
else
|
||||
echo "resolving system dependencies for distribution \"${DISTRIBUTION}\" ..."
|
||||
# shellcheck source=/dev/null
|
||||
source "./scripts/linux.d/${DISTRIBUTION}"
|
||||
fi
|
||||
|
||||
echo "FOUND_GTK3_DEV=${FOUND_GTK3_DEV}"
|
||||
if [[ -z "${FOUND_GTK3_DEV}" ]] ; then
|
||||
echo "Error, you must install the dependencies before."
|
||||
echo "Use option -u with sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Changing date in version..."
|
||||
{
|
||||
# change date in version
|
||||
sed --in-place "s/+UNKNOWN/_$(date '+%F')/" version.inc
|
||||
}
|
||||
echo "done"
|
||||
|
||||
|
||||
if [[ -z "${SKIP_RAM_CHECK}" ]] ; then
|
||||
check_available_memory_and_disk
|
||||
fi
|
||||
|
||||
export CMAKE_C_CXX_COMPILER_CLANG=()
|
||||
if [[ -n "${USE_CLANG}" ]] ; then
|
||||
export CMAKE_C_CXX_COMPILER_CLANG=(-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++)
|
||||
fi
|
||||
|
||||
# Configure use of ld.lld as the linker when requested
|
||||
export CMAKE_LLD_LINKER_ARGS=()
|
||||
if [[ -n "${USE_LLD}" ]] ; then
|
||||
if command -v ld.lld >/dev/null 2>&1 ; then
|
||||
LLD_BIN=$(command -v ld.lld)
|
||||
export CMAKE_LLD_LINKER_ARGS=(-DCMAKE_LINKER="${LLD_BIN}" -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld)
|
||||
else
|
||||
echo "Error: ld.lld not found. Please install the 'lld' package (e.g., sudo apt install lld) or omit -L."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_DEPS}" ]] ; then
|
||||
echo "Configuring dependencies..."
|
||||
read -r -a BUILD_ARGS <<< "${DEPS_EXTRA_BUILD_ARGS}"
|
||||
if [[ -n "${CLEAN_BUILD}" ]]
|
||||
then
|
||||
print_and_run rm -fr deps/$BUILD_DIR
|
||||
fi
|
||||
mkdir -p deps/$BUILD_DIR
|
||||
if [[ $BUILD_CONFIG != Release ]] ; then
|
||||
BUILD_ARGS+=(-DCMAKE_BUILD_TYPE="${BUILD_CONFIG}")
|
||||
fi
|
||||
|
||||
print_and_run cmake -S deps -B deps/$BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" -G Ninja "${COLORED_OUTPUT}" "${BUILD_ARGS[@]}"
|
||||
print_and_run cmake --build deps/$BUILD_DIR
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_ORCA}" ]] || [[ -n "${BUILD_TESTS}" ]] ; then
|
||||
echo "Configuring OrcaSlicer..."
|
||||
if [[ -n "${CLEAN_BUILD}" ]] ; then
|
||||
print_and_run rm -fr $BUILD_DIR
|
||||
fi
|
||||
read -r -a BUILD_ARGS <<< "${ORCA_EXTRA_BUILD_ARGS}"
|
||||
if [[ $BUILD_CONFIG != Release ]] ; then
|
||||
BUILD_ARGS+=(-DCMAKE_BUILD_TYPE="${BUILD_CONFIG}")
|
||||
fi
|
||||
if [[ -n "${BUILD_TESTS}" ]] ; then
|
||||
BUILD_ARGS+=(-DBUILD_TESTS=ON)
|
||||
fi
|
||||
if [[ -n "${ORCA_UPDATER_SIG_KEY}" ]] ; then
|
||||
BUILD_ARGS+=(-DORCA_UPDATER_SIG_KEY="${ORCA_UPDATER_SIG_KEY}")
|
||||
fi
|
||||
|
||||
print_and_run cmake -S . -B $BUILD_DIR "${CMAKE_C_CXX_COMPILER_CLANG[@]}" "${CMAKE_LLD_LINKER_ARGS[@]}" -G "Ninja Multi-Config" \
|
||||
-DSLIC3R_PCH=${SLIC3R_PRECOMPILED_HEADERS} \
|
||||
-DORCA_TOOLS=ON \
|
||||
"${COLORED_OUTPUT}" \
|
||||
"${BUILD_ARGS[@]}"
|
||||
echo "done"
|
||||
if [[ -n "${BUILD_ORCA}" ]]; then
|
||||
echo "Building OrcaSlicer ..."
|
||||
print_and_run cmake --build $BUILD_DIR --config "${BUILD_CONFIG}" --target OrcaSlicer
|
||||
echo "Building OrcaSlicer_profile_validator .."
|
||||
print_and_run cmake --build $BUILD_DIR --config "${BUILD_CONFIG}" --target OrcaSlicer_profile_validator
|
||||
./scripts/run_gettext.sh
|
||||
fi
|
||||
if [[ -n "${BUILD_TESTS}" ]] ; then
|
||||
echo "Building tests ..."
|
||||
print_and_run cmake --build ${BUILD_DIR} --config "${BUILD_CONFIG}" --target tests/all
|
||||
fi
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
if [[ -n "${BUILD_IMAGE}" || -n "${BUILD_ORCA}" ]] ; then
|
||||
pushd $BUILD_DIR > /dev/null
|
||||
build_linux_image="./src/build_linux_image.sh"
|
||||
if [[ -e ${build_linux_image} ]] ; then
|
||||
extra_script_args=""
|
||||
if [[ -n "${BUILD_IMAGE}" ]] ; then
|
||||
extra_script_args="-i"
|
||||
fi
|
||||
print_and_run ${build_linux_image} ${extra_script_args} -R "${BUILD_CONFIG}"
|
||||
|
||||
echo "done"
|
||||
fi
|
||||
popd > /dev/null # build
|
||||
fi
|
||||
|
||||
elapsed=$SECONDS
|
||||
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
|
||||
|
||||
popd > /dev/null # ${SCRIPT_PATH}
|
||||
@@ -1,52 +1,26 @@
|
||||
set WP=%CD%
|
||||
|
||||
set debug=OFF
|
||||
set debuginfo=OFF
|
||||
if "%1"=="debug" set debug=ON
|
||||
if "%2"=="debug" set debug=ON
|
||||
if "%1"=="debuginfo" set debuginfo=ON
|
||||
if "%2"=="debuginfo" set debuginfo=ON
|
||||
if "%debug%"=="ON" (
|
||||
set build_type=Debug
|
||||
set build_dir=build-dbg
|
||||
) else (
|
||||
if "%debuginfo%"=="ON" (
|
||||
set build_type=RelWithDebInfo
|
||||
set build_dir=build-dbginfo
|
||||
) else (
|
||||
set build_type=Release
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
echo build type set to %build_type%
|
||||
|
||||
cd deps
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
mkdir build
|
||||
cd build
|
||||
set DEPS=%CD%/OrcaSlicer_dep
|
||||
set "SIG_FLAG="
|
||||
if defined ORCA_UPDATER_SIG_KEY set "SIG_FLAG=-DORCA_UPDATER_SIG_KEY=%ORCA_UPDATER_SIG_KEY%"
|
||||
if "%1"=="slicer" (
|
||||
GOTO :slicer
|
||||
)
|
||||
echo "building deps.."
|
||||
|
||||
echo cmake ../ -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake ../ -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
cmake ../ -G "Visual Studio 16 2019" -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . --config Release --target deps -- -m
|
||||
|
||||
if "%1"=="deps" exit /b 0
|
||||
|
||||
:slicer
|
||||
echo "building Orca Slicer..."
|
||||
cd %WP%
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
echo cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=%build_type% %SIG_FLAG%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
cmake .. -G "Visual Studio 16 2019" -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"
|
||||
cmake --build . --config Release --target ALL_BUILD -- -m
|
||||
cd ..
|
||||
call scripts/run_gettext.bat
|
||||
cd %build_dir%
|
||||
cmake --build . --target install --config %build_type%
|
||||
call run_gettext.bat
|
||||
cd build
|
||||
cmake --build . --target install --config Release
|
||||
@@ -1,11 +1,7 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
SECONDS=0
|
||||
|
||||
while getopts ":dpa:snt:xbc:i:1Tuh" opt; do
|
||||
case "${opt}" in
|
||||
while getopts ":a:sdpt:hn" opt; do
|
||||
case ${opt} in
|
||||
d )
|
||||
export BUILD_TARGET="deps"
|
||||
;;
|
||||
@@ -24,102 +20,25 @@ while getopts ":dpa:snt:xbc:i:1Tuh" opt; do
|
||||
t )
|
||||
export OSX_DEPLOYMENT_TARGET="$OPTARG"
|
||||
;;
|
||||
x )
|
||||
export SLICER_CMAKE_GENERATOR="Ninja Multi-Config"
|
||||
export SLICER_BUILD_TARGET="all"
|
||||
export DEPS_CMAKE_GENERATOR="Ninja"
|
||||
;;
|
||||
b )
|
||||
export BUILD_ONLY="1"
|
||||
;;
|
||||
c )
|
||||
export BUILD_CONFIG="$OPTARG"
|
||||
;;
|
||||
i )
|
||||
export CMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH:+$CMAKE_IGNORE_PREFIX_PATH;}$OPTARG"
|
||||
;;
|
||||
1 )
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=1
|
||||
;;
|
||||
T )
|
||||
export BUILD_TESTS="1"
|
||||
;;
|
||||
u )
|
||||
export BUILD_TARGET="universal"
|
||||
;;
|
||||
h ) echo "Usage: ./build_release_macos.sh [-d]"
|
||||
echo " -d: Build deps only"
|
||||
echo " -a: Set ARCHITECTURE (arm64 or x86_64 or universal)"
|
||||
echo " -a: Set ARCHITECTURE (arm64 or x86_64)"
|
||||
echo " -s: Build slicer only"
|
||||
echo " -u: Build universal app only (requires existing arm64 and x86_64 app bundles)"
|
||||
echo " -n: Nightly build"
|
||||
echo " -t: Specify minimum version of the target platform, default is 11.3"
|
||||
echo " -x: Use Ninja Multi-Config CMake generator, default is Xcode"
|
||||
echo " -b: Build without reconfiguring CMake"
|
||||
echo " -c: Set CMake build configuration, default is Release"
|
||||
echo " -i: Add a prefix to ignore during CMake dependency discovery (repeatable), defaults to /opt/local:/usr/local:/opt/homebrew"
|
||||
echo " -1: Use single job for building"
|
||||
echo " -T: Build and run tests"
|
||||
exit 0
|
||||
;;
|
||||
* )
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Set defaults
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
ARCH="$(uname -m)"
|
||||
export ARCH
|
||||
if [ -z "$ARCH" ]
|
||||
then
|
||||
export ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_CONFIG" ]; then
|
||||
export BUILD_CONFIG="Release"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_TARGET" ]; then
|
||||
export BUILD_TARGET="all"
|
||||
fi
|
||||
|
||||
if [ -z "$SLICER_CMAKE_GENERATOR" ]; then
|
||||
export SLICER_CMAKE_GENERATOR="Xcode"
|
||||
fi
|
||||
|
||||
if [ -z "$SLICER_BUILD_TARGET" ]; then
|
||||
export SLICER_BUILD_TARGET="ALL_BUILD"
|
||||
fi
|
||||
|
||||
if [ -z "$DEPS_CMAKE_GENERATOR" ]; then
|
||||
export DEPS_CMAKE_GENERATOR="Unix Makefiles"
|
||||
fi
|
||||
|
||||
if [ -z "$OSX_DEPLOYMENT_TARGET" ]; then
|
||||
export OSX_DEPLOYMENT_TARGET="11.3"
|
||||
fi
|
||||
|
||||
if [ -z "$CMAKE_IGNORE_PREFIX_PATH" ]; then
|
||||
export CMAKE_IGNORE_PREFIX_PATH="/opt/local:/usr/local:/opt/homebrew"
|
||||
fi
|
||||
|
||||
CMAKE_VERSION=$(cmake --version | head -1 | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
||||
if [ "$CMAKE_VERSION" -ge 4 ] 2>/dev/null; then
|
||||
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
export CMAKE_POLICY_COMPAT="-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
|
||||
echo "Detected CMake 4.x, adding compatibility flag (env + cmake arg)"
|
||||
else
|
||||
export CMAKE_POLICY_COMPAT=""
|
||||
fi
|
||||
|
||||
echo "Build params:"
|
||||
echo " - ARCH: $ARCH"
|
||||
echo " - BUILD_CONFIG: $BUILD_CONFIG"
|
||||
echo " - BUILD_TARGET: $BUILD_TARGET"
|
||||
echo " - CMAKE_GENERATOR: $SLICER_CMAKE_GENERATOR for Slicer, $DEPS_CMAKE_GENERATOR for deps"
|
||||
echo " - OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
|
||||
echo " - CMAKE_IGNORE_PREFIX_PATH: $CMAKE_IGNORE_PREFIX_PATH"
|
||||
echo
|
||||
|
||||
echo "Arch: $ARCH"
|
||||
echo "BUILD_TARGET: $BUILD_TARGET"
|
||||
echo "OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
|
||||
# if which -s brew; then
|
||||
# brew --prefix libiconv
|
||||
# brew --prefix zstd
|
||||
@@ -133,216 +52,57 @@ echo
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$ARCH"
|
||||
DEPS_DIR="$PROJECT_DIR/deps"
|
||||
|
||||
# For Multi-config generators like Ninja and Xcode
|
||||
export BUILD_DIR_CONFIG_SUBDIR="/$BUILD_CONFIG"
|
||||
|
||||
function build_deps() {
|
||||
# iterate over two architectures: x86_64 and arm64
|
||||
for _ARCH in x86_64 arm64; do
|
||||
# if ARCH is universal or equal to _ARCH
|
||||
if [ "$ARCH" == "universal" ] || [ "$ARCH" == "$_ARCH" ]; then
|
||||
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$_ARCH"
|
||||
DEPS_BUILD_DIR="$DEPS_DIR/build/$_ARCH"
|
||||
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep"
|
||||
|
||||
echo "Building deps..."
|
||||
(
|
||||
set -x
|
||||
mkdir -p "$DEPS"
|
||||
cd "$DEPS_BUILD_DIR"
|
||||
if [ "1." != "$BUILD_ONLY". ]; then
|
||||
cmake "${DEPS_DIR}" \
|
||||
-G "${DEPS_CMAKE_GENERATOR}" \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
|
||||
-DCMAKE_OSX_ARCHITECTURES:STRING="${_ARCH}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH}" \
|
||||
${CMAKE_POLICY_COMPAT}
|
||||
fi
|
||||
cmake --build . --config "$BUILD_CONFIG" --target deps
|
||||
)
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function pack_deps() {
|
||||
echo "Packing deps..."
|
||||
(
|
||||
set -x
|
||||
cd "$DEPS_DIR"
|
||||
tar -zcvf "OrcaSlicer_dep_mac_${ARCH}_$(date +"%Y%m%d").tar.gz" "build"
|
||||
)
|
||||
}
|
||||
|
||||
function build_slicer() {
|
||||
# iterate over two architectures: x86_64 and arm64
|
||||
for _ARCH in x86_64 arm64; do
|
||||
# if ARCH is universal or equal to _ARCH
|
||||
if [ "$ARCH" == "universal" ] || [ "$ARCH" == "$_ARCH" ]; then
|
||||
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$_ARCH"
|
||||
DEPS_BUILD_DIR="$DEPS_DIR/build/$_ARCH"
|
||||
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep"
|
||||
|
||||
echo "Building slicer for $_ARCH..."
|
||||
(
|
||||
set -x
|
||||
mkdir -p "$PROJECT_BUILD_DIR"
|
||||
cd "$PROJECT_BUILD_DIR"
|
||||
if [ "1." != "$BUILD_ONLY". ]; then
|
||||
cmake "${PROJECT_DIR}" \
|
||||
-G "${SLICER_CMAKE_GENERATOR}" \
|
||||
-DORCA_TOOLS=ON \
|
||||
${ORCA_UPDATER_SIG_KEY:+-DORCA_UPDATER_SIG_KEY="$ORCA_UPDATER_SIG_KEY"} \
|
||||
${BUILD_TESTS:+-DBUILD_TESTS=ON} \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
|
||||
-DCMAKE_OSX_ARCHITECTURES="${_ARCH}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH="${CMAKE_IGNORE_PREFIX_PATH}" \
|
||||
${CMAKE_POLICY_COMPAT}
|
||||
fi
|
||||
cmake --build . --config "$BUILD_CONFIG" --target "$SLICER_BUILD_TARGET"
|
||||
)
|
||||
|
||||
if [ "1." == "$BUILD_TESTS". ]; then
|
||||
echo "Running tests for $_ARCH..."
|
||||
(
|
||||
set -x
|
||||
cd "$PROJECT_BUILD_DIR"
|
||||
ctest --build-config "$BUILD_CONFIG" --output-on-failure
|
||||
)
|
||||
fi
|
||||
|
||||
echo "Verify localization with gettext..."
|
||||
(
|
||||
cd "$PROJECT_DIR"
|
||||
./scripts/run_gettext.sh
|
||||
)
|
||||
|
||||
echo "Fix macOS app package..."
|
||||
(
|
||||
cd "$PROJECT_BUILD_DIR"
|
||||
mkdir -p OrcaSlicer
|
||||
cd OrcaSlicer
|
||||
# remove previously built app
|
||||
rm -rf ./OrcaSlicer.app
|
||||
# fully copy newly built app
|
||||
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer.app" ./OrcaSlicer.app
|
||||
# fix resources
|
||||
resources_path=$(readlink ./OrcaSlicer.app/Contents/Resources)
|
||||
rm ./OrcaSlicer.app/Contents/Resources
|
||||
cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources
|
||||
# delete .DS_Store file
|
||||
find ./OrcaSlicer.app/ -name '.DS_Store' -delete
|
||||
|
||||
# Copy OrcaSlicer_profile_validator.app if it exists
|
||||
if [ -f "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
|
||||
echo "Copying OrcaSlicer_profile_validator.app..."
|
||||
rm -rf ./OrcaSlicer_profile_validator.app
|
||||
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app" ./OrcaSlicer_profile_validator.app
|
||||
# delete .DS_Store file
|
||||
find ./OrcaSlicer_profile_validator.app/ -name '.DS_Store' -delete
|
||||
fi
|
||||
)
|
||||
|
||||
# extract version
|
||||
# export ver=$(grep '^#define SoftFever_VERSION' ../src/libslic3r/libslic3r_version.h | cut -d ' ' -f3)
|
||||
# ver="_V${ver//\"}"
|
||||
# echo $PWD
|
||||
# if [ "1." != "$NIGHTLY_BUILD". ];
|
||||
# then
|
||||
# ver=${ver}_dev
|
||||
# fi
|
||||
|
||||
# zip -FSr OrcaSlicer${ver}_Mac_${_ARCH}.zip OrcaSlicer.app
|
||||
|
||||
WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd $WD/deps
|
||||
mkdir -p build_$ARCH
|
||||
cd build_$ARCH
|
||||
DEPS=$PWD/OrcaSlicer_dep_$ARCH
|
||||
mkdir -p $DEPS
|
||||
if [ "slicer." != $BUILD_TARGET. ];
|
||||
then
|
||||
echo "building deps..."
|
||||
echo "cmake ../ -DDESTDIR=$DEPS -DOPENSSL_ARCH=darwin64-${ARCH}-cc -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES:STRING=${ARCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}"
|
||||
cmake ../ -DDESTDIR="$DEPS" -DOPENSSL_ARCH="darwin64-${ARCH}-cc" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES:STRING=${ARCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}
|
||||
cmake --build . --config Release --target deps
|
||||
if [ "1." == "$PACK_DEPS". ];
|
||||
then
|
||||
tar -zcvf OrcaSlicer_dep_mac_${ARCH}_$(date +"%Y%m%d").tar.gz OrcaSlicer_dep_$ARCH
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function lipo_dir() {
|
||||
local universal_dir="$1"
|
||||
local x86_64_dir="$2"
|
||||
|
||||
# Find all Mach-O files in the universal (arm64-based) copy and lipo them
|
||||
while IFS= read -r -d '' f; do
|
||||
local rel="${f#"$universal_dir"/}"
|
||||
local x86="$x86_64_dir/$rel"
|
||||
if [ -f "$x86" ]; then
|
||||
echo " lipo: $rel"
|
||||
lipo -create "$f" "$x86" -output "$f.tmp"
|
||||
mv "$f.tmp" "$f"
|
||||
else
|
||||
echo " warning: no x86_64 counterpart for $rel, keeping arm64 only"
|
||||
fi
|
||||
done < <(find "$universal_dir" -type f -print0 | while IFS= read -r -d '' candidate; do
|
||||
if file "$candidate" | grep -q "Mach-O"; then
|
||||
printf '%s\0' "$candidate"
|
||||
fi
|
||||
done)
|
||||
}
|
||||
|
||||
function build_universal() {
|
||||
echo "Building universal binary..."
|
||||
|
||||
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$ARCH"
|
||||
ARM64_APP="$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app"
|
||||
X86_64_APP="$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer.app"
|
||||
|
||||
mkdir -p "$PROJECT_BUILD_DIR/OrcaSlicer"
|
||||
UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer.app"
|
||||
rm -rf "$UNIVERSAL_APP"
|
||||
cp -R "$ARM64_APP" "$UNIVERSAL_APP"
|
||||
|
||||
echo "Creating universal binaries for OrcaSlicer.app..."
|
||||
lipo_dir "$UNIVERSAL_APP" "$X86_64_APP"
|
||||
echo "Universal OrcaSlicer.app created at $UNIVERSAL_APP"
|
||||
|
||||
# Create universal binary for profile validator if it exists
|
||||
ARM64_VALIDATOR="$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app"
|
||||
X86_64_VALIDATOR="$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app"
|
||||
if [ -d "$ARM64_VALIDATOR" ] && [ -d "$X86_64_VALIDATOR" ]; then
|
||||
echo "Creating universal binaries for OrcaSlicer_profile_validator.app..."
|
||||
UNIVERSAL_VALIDATOR_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer_profile_validator.app"
|
||||
rm -rf "$UNIVERSAL_VALIDATOR_APP"
|
||||
cp -R "$ARM64_VALIDATOR" "$UNIVERSAL_VALIDATOR_APP"
|
||||
lipo_dir "$UNIVERSAL_VALIDATOR_APP" "$X86_64_VALIDATOR"
|
||||
echo "Universal OrcaSlicer_profile_validator.app created at $UNIVERSAL_VALIDATOR_APP"
|
||||
fi
|
||||
}
|
||||
|
||||
case "${BUILD_TARGET}" in
|
||||
all)
|
||||
build_deps
|
||||
build_slicer
|
||||
;;
|
||||
deps)
|
||||
build_deps
|
||||
;;
|
||||
slicer)
|
||||
build_slicer
|
||||
;;
|
||||
universal)
|
||||
build_universal
|
||||
;;
|
||||
*)
|
||||
echo "Unknown target: $BUILD_TARGET. Available targets: deps, slicer, universal, all."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$ARCH" = "universal" ] && { [ "$BUILD_TARGET" = "all" ] || [ "$BUILD_TARGET" = "slicer" ]; }; then
|
||||
build_universal
|
||||
fi
|
||||
|
||||
if [ "1." == "$PACK_DEPS". ]; then
|
||||
pack_deps
|
||||
|
||||
if [ "deps." == "$BUILD_TARGET". ];
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
elapsed=$SECONDS
|
||||
printf "\nBuild completed in %dh %dm %ds\n" $((elapsed/3600)) $((elapsed%3600/60)) $((elapsed%60))
|
||||
cd $WD
|
||||
mkdir -p build_$ARCH
|
||||
cd build_$ARCH
|
||||
echo "building slicer..."
|
||||
cmake .. -GXcode -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="$DEPS/usr/local" -DCMAKE_INSTALL_PREFIX="$PWD/OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="$DEPS/usr/local" -DCMAKE_MACOSX_BUNDLE=ON -DCMAKE_OSX_ARCHITECTURES=${ARCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}
|
||||
cmake --build . --config Release --target ALL_BUILD
|
||||
cd ..
|
||||
./run_gettext.sh
|
||||
cd build_$ARCH
|
||||
mkdir -p OrcaSlicer
|
||||
cd OrcaSlicer
|
||||
rm -r ./OrcaSlicer.app
|
||||
cp -pR ../src/Release/OrcaSlicer.app ./OrcaSlicer.app
|
||||
resources_path=$(readlink ./OrcaSlicer.app/Contents/Resources)
|
||||
rm ./OrcaSlicer.app/Contents/Resources
|
||||
cp -R $resources_path ./OrcaSlicer.app/Contents/Resources
|
||||
# delete .DS_Store file
|
||||
find ./OrcaSlicer.app/ -name '.DS_Store' -delete
|
||||
# extract version
|
||||
# export ver=$(grep '^#define SoftFever_VERSION' ../src/libslic3r/libslic3r_version.h | cut -d ' ' -f3)
|
||||
# ver="_V${ver//\"}"
|
||||
# echo $PWD
|
||||
# if [ "1." != "$NIGHTLY_BUILD". ];
|
||||
# then
|
||||
# ver=${ver}_dev
|
||||
# fi
|
||||
|
||||
|
||||
# zip -FSr OrcaSlicer${ver}_Mac_${ARCH}.zip OrcaSlicer.app
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
@REM OrcaSlicer build script for Windows with VS auto-detect
|
||||
@echo off
|
||||
set WP=%CD%
|
||||
set _START_TIME=%TIME%
|
||||
|
||||
@REM Check for Ninja Multi-Config option (-x)
|
||||
set USE_NINJA=0
|
||||
for %%a in (%*) do (
|
||||
if "%%a"=="-x" set USE_NINJA=1
|
||||
)
|
||||
|
||||
if "%USE_NINJA%"=="1" (
|
||||
echo Using Ninja Multi-Config generator
|
||||
set CMAKE_GENERATOR="Ninja Multi-Config"
|
||||
set VS_VERSION=Ninja
|
||||
goto :generator_ready
|
||||
)
|
||||
|
||||
@REM Detect Visual Studio version using msbuild
|
||||
echo Detecting Visual Studio version using msbuild...
|
||||
|
||||
@REM Try to get MSBuild version - the output format varies by VS version
|
||||
set VS_MAJOR=
|
||||
for /f "tokens=*" %%i in ('msbuild -version 2^>^&1 ^| findstr /r "^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*"') do (
|
||||
for /f "tokens=1 delims=." %%a in ("%%i") do set VS_MAJOR=%%a
|
||||
set MSBUILD_OUTPUT=%%i
|
||||
goto :version_found
|
||||
)
|
||||
|
||||
@REM Alternative method for newer MSBuild versions
|
||||
if "%VS_MAJOR%"=="" (
|
||||
for /f "tokens=*" %%i in ('msbuild -version 2^>^&1 ^| findstr /r "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*"') do (
|
||||
for /f "tokens=1 delims=." %%a in ("%%i") do set VS_MAJOR=%%a
|
||||
set MSBUILD_OUTPUT=%%i
|
||||
goto :version_found
|
||||
)
|
||||
)
|
||||
|
||||
:version_found
|
||||
echo MSBuild version detected: %MSBUILD_OUTPUT%
|
||||
echo Major version: %VS_MAJOR%
|
||||
|
||||
if "%VS_MAJOR%"=="" (
|
||||
echo Error: Could not determine Visual Studio version from msbuild
|
||||
echo Please ensure Visual Studio and MSBuild are properly installed
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%VS_MAJOR%"=="16" (
|
||||
set VS_VERSION=2019
|
||||
set CMAKE_GENERATOR="Visual Studio 16 2019"
|
||||
) else if "%VS_MAJOR%"=="17" (
|
||||
set VS_VERSION=2022
|
||||
set CMAKE_GENERATOR="Visual Studio 17 2022"
|
||||
) else if "%VS_MAJOR%"=="18" (
|
||||
set VS_VERSION=2026
|
||||
set CMAKE_GENERATOR="Visual Studio 18 2026"
|
||||
) else (
|
||||
echo Error: Unsupported Visual Studio version: %VS_MAJOR%
|
||||
echo Supported versions: VS2019 (16.x^), VS2022 (17.x^), VS2026 (18.x^)
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Detected Visual Studio %VS_VERSION% (version %VS_MAJOR%)
|
||||
echo Using CMake generator: %CMAKE_GENERATOR%
|
||||
|
||||
:generator_ready
|
||||
|
||||
@REM Pack deps
|
||||
if "%1"=="pack" (
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
cd %WP%/deps/build
|
||||
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set build_date=%%c%%b%%a
|
||||
echo packing deps: OrcaSlicer_dep_win64_!build_date!_vs!VS_VERSION!.zip
|
||||
|
||||
%WP%/tools/7z.exe a OrcaSlicer_dep_win64_!build_date!_vs!VS_VERSION!.zip OrcaSlicer_dep
|
||||
goto :done
|
||||
)
|
||||
|
||||
set debug=OFF
|
||||
set debuginfo=OFF
|
||||
if "%1"=="debug" set debug=ON
|
||||
if "%2"=="debug" set debug=ON
|
||||
if "%1"=="debuginfo" set debuginfo=ON
|
||||
if "%2"=="debuginfo" set debuginfo=ON
|
||||
if "%debug%"=="ON" (
|
||||
set build_type=Debug
|
||||
set build_dir=build-dbg
|
||||
) else (
|
||||
if "%debuginfo%"=="ON" (
|
||||
set build_type=RelWithDebInfo
|
||||
set build_dir=build-dbginfo
|
||||
) else (
|
||||
set build_type=Release
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
echo build type set to %build_type%
|
||||
|
||||
setlocal DISABLEDELAYEDEXPANSION
|
||||
cd deps
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
set "SIG_FLAG="
|
||||
if defined ORCA_UPDATER_SIG_KEY set "SIG_FLAG=-DORCA_UPDATER_SIG_KEY=%ORCA_UPDATER_SIG_KEY%"
|
||||
|
||||
if "%1"=="slicer" (
|
||||
GOTO :slicer
|
||||
)
|
||||
echo "building deps.."
|
||||
|
||||
echo on
|
||||
REM Set minimum CMake policy to avoid <3.5 errors
|
||||
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
if "%USE_NINJA%"=="1" (
|
||||
cmake ../ -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps
|
||||
) else (
|
||||
cmake ../ -G %CMAKE_GENERATOR% -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
)
|
||||
@echo off
|
||||
|
||||
if "%1"=="deps" goto :done
|
||||
|
||||
:slicer
|
||||
echo "building Orca Slicer..."
|
||||
cd %WP%
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
|
||||
echo on
|
||||
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
if "%USE_NINJA%"=="1" (
|
||||
cmake .. -G %CMAKE_GENERATOR% -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD
|
||||
) else (
|
||||
cmake .. -G %CMAKE_GENERATOR% -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
)
|
||||
@echo off
|
||||
cd ..
|
||||
call scripts/run_gettext.bat
|
||||
cd %build_dir%
|
||||
cmake --build . --target install --config %build_type%
|
||||
|
||||
:done
|
||||
@echo off
|
||||
for /f "tokens=1-3 delims=:.," %%a in ("%_START_TIME: =0%") do set /a "_start_s=%%a*3600+%%b*60+%%c"
|
||||
for /f "tokens=1-3 delims=:.," %%a in ("%TIME: =0%") do set /a "_end_s=%%a*3600+%%b*60+%%c"
|
||||
set /a "_elapsed=_end_s - _start_s"
|
||||
if %_elapsed% lss 0 set /a "_elapsed+=86400"
|
||||
set /a "_hours=_elapsed / 3600"
|
||||
set /a "_remainder=_elapsed - _hours * 3600"
|
||||
set /a "_mins=_remainder / 60"
|
||||
set /a "_secs=_remainder - _mins * 60"
|
||||
echo.
|
||||
echo Build completed in %_hours%h %_mins%m %_secs%s
|
||||
@@ -1,4 +1,4 @@
|
||||
@REM OrcaSlicer build script for Windows
|
||||
@REM OcarSlicer build script for Windows
|
||||
@echo off
|
||||
set WP=%CD%
|
||||
|
||||
@@ -13,59 +13,33 @@ if "%1"=="pack" (
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
set debug=OFF
|
||||
set debuginfo=OFF
|
||||
if "%1"=="debug" set debug=ON
|
||||
if "%2"=="debug" set debug=ON
|
||||
if "%1"=="debuginfo" set debuginfo=ON
|
||||
if "%2"=="debuginfo" set debuginfo=ON
|
||||
if "%debug%"=="ON" (
|
||||
set build_type=Debug
|
||||
set build_dir=build-dbg
|
||||
) else (
|
||||
if "%debuginfo%"=="ON" (
|
||||
set build_type=RelWithDebInfo
|
||||
set build_dir=build-dbginfo
|
||||
) else (
|
||||
set build_type=Release
|
||||
set build_dir=build
|
||||
)
|
||||
)
|
||||
echo build type set to %build_type%
|
||||
|
||||
setlocal DISABLEDELAYEDEXPANSION
|
||||
cd deps
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
set "SIG_FLAG="
|
||||
if defined ORCA_UPDATER_SIG_KEY set "SIG_FLAG=-DORCA_UPDATER_SIG_KEY=%ORCA_UPDATER_SIG_KEY%"
|
||||
mkdir build
|
||||
cd build
|
||||
set DEPS=%CD%/OrcaSlicer_dep
|
||||
|
||||
if "%1"=="slicer" (
|
||||
GOTO :slicer
|
||||
)
|
||||
echo "building deps.."
|
||||
|
||||
echo on
|
||||
REM Set minimum CMake policy to avoid <3.5 errors
|
||||
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target deps -- -m
|
||||
@echo off
|
||||
|
||||
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . --config Release --target deps -- -m
|
||||
|
||||
if "%1"=="deps" exit /b 0
|
||||
|
||||
:slicer
|
||||
echo "building Orca Slicer..."
|
||||
cd %WP%
|
||||
mkdir %build_dir%
|
||||
cd %build_dir%
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
echo on
|
||||
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
||||
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
||||
@echo off
|
||||
echo cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
|
||||
cmake --build . --config Release --target ALL_BUILD -- -m
|
||||
cd ..
|
||||
call scripts/run_gettext.bat
|
||||
cd %build_dir%
|
||||
cmake --build . --target install --config %build_type%
|
||||
call run_gettext.bat
|
||||
cd build
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
175
cmake/modules/Catch2/Catch.cmake
Normal file
175
cmake/modules/Catch2/Catch.cmake
Normal file
@@ -0,0 +1,175 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
Catch
|
||||
-----
|
||||
|
||||
This module defines a function to help use the Catch test framework.
|
||||
|
||||
The :command:`catch_discover_tests` discovers tests by asking the compiled test
|
||||
executable to enumerate its tests. This does not require CMake to be re-run
|
||||
when tests change. However, it may not work in a cross-compiling environment,
|
||||
and setting test properties is less convenient.
|
||||
|
||||
This command is intended to replace use of :command:`add_test` to register
|
||||
tests, and will create a separate CTest test for each Catch test case. Note
|
||||
that this is in some cases less efficient, as common set-up and tear-down logic
|
||||
cannot be shared by multiple test cases executing in the same instance.
|
||||
However, it provides more fine-grained pass/fail information to CTest, which is
|
||||
usually considered as more beneficial. By default, the CTest test name is the
|
||||
same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
|
||||
|
||||
.. command:: catch_discover_tests
|
||||
|
||||
Automatically add tests with CTest by querying the compiled test executable
|
||||
for available tests::
|
||||
|
||||
catch_discover_tests(target
|
||||
[TEST_SPEC arg1...]
|
||||
[EXTRA_ARGS arg1...]
|
||||
[WORKING_DIRECTORY dir]
|
||||
[TEST_PREFIX prefix]
|
||||
[TEST_SUFFIX suffix]
|
||||
[PROPERTIES name1 value1...]
|
||||
[TEST_LIST var]
|
||||
)
|
||||
|
||||
``catch_discover_tests`` sets up a post-build command on the test executable
|
||||
that generates the list of tests by parsing the output from running the test
|
||||
with the ``--list-test-names-only`` argument. This ensures that the full
|
||||
list of tests is obtained. Since test discovery occurs at build time, it is
|
||||
not necessary to re-run CMake when the list of tests changes.
|
||||
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
|
||||
in order to function in a cross-compiling environment.
|
||||
|
||||
Additionally, setting properties on tests is somewhat less convenient, since
|
||||
the tests are not available at CMake time. Additional test properties may be
|
||||
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
|
||||
more fine-grained test control is needed, custom content may be provided
|
||||
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
|
||||
directory property. The set of discovered tests is made accessible to such a
|
||||
script via the ``<target>_TESTS`` variable.
|
||||
|
||||
The options are:
|
||||
|
||||
``target``
|
||||
Specifies the Catch executable, which must be a known CMake executable
|
||||
target. CMake will substitute the location of the built executable when
|
||||
running the test.
|
||||
|
||||
``TEST_SPEC arg1...``
|
||||
Specifies test cases, wildcarded test cases, tags and tag expressions to
|
||||
pass to the Catch executable with the ``--list-test-names-only`` argument.
|
||||
|
||||
``EXTRA_ARGS arg1...``
|
||||
Any extra arguments to pass on the command line to each test case.
|
||||
|
||||
``WORKING_DIRECTORY dir``
|
||||
Specifies the directory in which to run the discovered test cases. If this
|
||||
option is not provided, the current binary directory is used.
|
||||
|
||||
``TEST_PREFIX prefix``
|
||||
Specifies a ``prefix`` to be prepended to the name of each discovered test
|
||||
case. This can be useful when the same test executable is being used in
|
||||
multiple calls to ``catch_discover_tests()`` but with different
|
||||
``TEST_SPEC`` or ``EXTRA_ARGS``.
|
||||
|
||||
``TEST_SUFFIX suffix``
|
||||
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
|
||||
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
|
||||
be specified.
|
||||
|
||||
``PROPERTIES name1 value1...``
|
||||
Specifies additional properties to be set on all tests discovered by this
|
||||
invocation of ``catch_discover_tests``.
|
||||
|
||||
``TEST_LIST var``
|
||||
Make the list of tests available in the variable ``var``, rather than the
|
||||
default ``<target>_TESTS``. This can be useful when the same test
|
||||
executable is being used in multiple calls to ``catch_discover_tests()``.
|
||||
Note that this variable is only available in CTest.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
function(catch_discover_tests TARGET)
|
||||
cmake_parse_arguments(
|
||||
""
|
||||
""
|
||||
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
|
||||
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if(NOT _WORKING_DIRECTORY)
|
||||
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
if(NOT _TEST_LIST)
|
||||
set(_TEST_LIST ${TARGET}_TESTS)
|
||||
endif()
|
||||
|
||||
## Generate a unique name based on the extra arguments
|
||||
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
|
||||
string(SUBSTRING ${args_hash} 0 7 args_hash)
|
||||
|
||||
# Define rule to generate test list for aforementioned test executable
|
||||
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
|
||||
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
|
||||
get_property(crosscompiling_emulator
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CROSSCOMPILING_EMULATOR
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET ${TARGET} POST_BUILD
|
||||
BYPRODUCTS "${ctest_tests_file}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_TARGET=${TARGET}"
|
||||
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
|
||||
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
|
||||
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
|
||||
-D "TEST_SPEC=${_TEST_SPEC}"
|
||||
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
|
||||
-D "TEST_PROPERTIES=${_PROPERTIES}"
|
||||
-D "TEST_PREFIX='${_TEST_PREFIX}'"
|
||||
-D "TEST_SUFFIX='${_TEST_SUFFIX}'"
|
||||
-D "TEST_LIST=${_TEST_LIST}"
|
||||
-D "CTEST_FILE=${ctest_tests_file}"
|
||||
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
file(WRITE "${ctest_include_file}"
|
||||
"if(EXISTS \"${ctest_tests_file}\")\n"
|
||||
" include(\"${ctest_tests_file}\")\n"
|
||||
"else()\n"
|
||||
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
|
||||
"endif()\n"
|
||||
)
|
||||
|
||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
|
||||
# Add discovered tests to directory TEST_INCLUDE_FILES
|
||||
set_property(DIRECTORY
|
||||
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
|
||||
)
|
||||
else()
|
||||
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
|
||||
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
|
||||
if (NOT ${test_include_file_set})
|
||||
set_property(DIRECTORY
|
||||
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Cannot set more than one TEST_INCLUDE_FILE"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
###############################################################################
|
||||
|
||||
set(_CATCH_DISCOVER_TESTS_SCRIPT
|
||||
${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
|
||||
)
|
||||
106
cmake/modules/Catch2/CatchAddTests.cmake
Normal file
106
cmake/modules/Catch2/CatchAddTests.cmake
Normal file
@@ -0,0 +1,106 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
set(prefix "${TEST_PREFIX}")
|
||||
set(suffix "${TEST_SUFFIX}")
|
||||
set(spec ${TEST_SPEC})
|
||||
set(extra_args ${TEST_EXTRA_ARGS})
|
||||
set(properties ${TEST_PROPERTIES})
|
||||
set(script)
|
||||
set(suite)
|
||||
set(tests)
|
||||
|
||||
function(add_command NAME)
|
||||
set(_args "")
|
||||
foreach(_arg ${ARGN})
|
||||
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
|
||||
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
|
||||
else()
|
||||
set(_args "${_args} ${_arg}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(_add_catch_test_labels LINE)
|
||||
# convert to list of tags
|
||||
string(REPLACE "][" "]\\;[" tags ${line})
|
||||
|
||||
add_command(
|
||||
set_tests_properties "${prefix}${test}${suffix}"
|
||||
PROPERTIES
|
||||
LABELS "${tags}"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
macro(_add_catch_test LINE)
|
||||
set(test ${line})
|
||||
# use escape commas to handle properly test cases with commans inside the name
|
||||
string(REPLACE "," "\\," test_name ${test})
|
||||
# ...and add to script
|
||||
add_command(
|
||||
add_test "${prefix}${test}${suffix}"
|
||||
${TEST_EXECUTOR}
|
||||
"${TEST_EXECUTABLE}"
|
||||
"${test_name}"
|
||||
${extra_args}
|
||||
)
|
||||
|
||||
add_command(
|
||||
set_tests_properties "${prefix}${test}${suffix}"
|
||||
PROPERTIES
|
||||
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
|
||||
${properties}
|
||||
)
|
||||
list(APPEND tests "${prefix}${test}${suffix}")
|
||||
endmacro()
|
||||
|
||||
# Run test executable to get list of available tests
|
||||
if(NOT EXISTS "${TEST_EXECUTABLE}")
|
||||
message(FATAL_ERROR
|
||||
"Specified test executable '${TEST_EXECUTABLE}' does not exist"
|
||||
)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-tests
|
||||
OUTPUT_VARIABLE output
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
|
||||
if(${result} EQUAL 0)
|
||||
message(WARNING
|
||||
"Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
|
||||
)
|
||||
elseif(${result} LESS 0)
|
||||
message(FATAL_ERROR
|
||||
"Error running test executable '${TEST_EXECUTABLE}':\n"
|
||||
" Result: ${result}\n"
|
||||
" Output: ${output}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REPLACE "\n" ";" output "${output}")
|
||||
set(test)
|
||||
set(tags_regex "(\\[([^\\[]*)\\])+$")
|
||||
|
||||
# Parse output
|
||||
foreach(line ${output})
|
||||
# lines without leading whitespaces are catch output not tests
|
||||
if(${line} MATCHES "^[ \t]+")
|
||||
# strip leading spaces and tabs
|
||||
string(REGEX REPLACE "^[ \t]+" "" line ${line})
|
||||
|
||||
if(${line} MATCHES "${tags_regex}")
|
||||
_add_catch_test_labels(${line})
|
||||
else()
|
||||
_add_catch_test(${line})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Create a list of all discovered tests, which users may use to e.g. set
|
||||
# properties on the tests
|
||||
add_command(set ${TEST_LIST} ${tests})
|
||||
|
||||
# Write CTest script
|
||||
file(WRITE "${CTEST_FILE}" "${script}")
|
||||
225
cmake/modules/Catch2/ParseAndAddCatchTests.cmake
Normal file
225
cmake/modules/Catch2/ParseAndAddCatchTests.cmake
Normal file
@@ -0,0 +1,225 @@
|
||||
#==================================================================================================#
|
||||
# supported macros #
|
||||
# - TEST_CASE, #
|
||||
# - SCENARIO, #
|
||||
# - TEST_CASE_METHOD, #
|
||||
# - CATCH_TEST_CASE, #
|
||||
# - CATCH_SCENARIO, #
|
||||
# - CATCH_TEST_CASE_METHOD. #
|
||||
# #
|
||||
# Usage #
|
||||
# 1. make sure this module is in the path or add this otherwise: #
|
||||
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
|
||||
# 2. make sure that you've enabled testing option for the project by the call: #
|
||||
# enable_testing() #
|
||||
# 3. add the lines to the script for testing target (sample CMakeLists.txt): #
|
||||
# project(testing_target) #
|
||||
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
|
||||
# enable_testing() #
|
||||
# #
|
||||
# find_path(CATCH_INCLUDE_DIR "catch.hpp") #
|
||||
# include_directories(${INCLUDE_DIRECTORIES} ${CATCH_INCLUDE_DIR}) #
|
||||
# #
|
||||
# file(GLOB SOURCE_FILES "*.cpp") #
|
||||
# add_executable(${PROJECT_NAME} ${SOURCE_FILES}) #
|
||||
# #
|
||||
# include(ParseAndAddCatchTests) #
|
||||
# ParseAndAddCatchTests(${PROJECT_NAME}) #
|
||||
# #
|
||||
# The following variables affect the behavior of the script: #
|
||||
# #
|
||||
# PARSE_CATCH_TESTS_VERBOSE (Default OFF) #
|
||||
# -- enables debug messages #
|
||||
# PARSE_CATCH_TESTS_NO_HIDDEN_TESTS (Default OFF) #
|
||||
# -- excludes tests marked with [!hide], [.] or [.foo] tags #
|
||||
# PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME (Default ON) #
|
||||
# -- adds fixture class name to the test name #
|
||||
# PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME (Default ON) #
|
||||
# -- adds cmake target name to the test name #
|
||||
# PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS (Default OFF) #
|
||||
# -- causes CMake to rerun when file with tests changes so that new tests will be discovered #
|
||||
# #
|
||||
# One can also set (locally) the optional variable OptionalCatchTestLauncher to precise the way #
|
||||
# a test should be run. For instance to use test MPI, one can write #
|
||||
# set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) #
|
||||
# just before calling this ParseAndAddCatchTests function #
|
||||
# #
|
||||
# The AdditionalCatchParameters optional variable can be used to pass extra argument to the test #
|
||||
# command. For example, to include successful tests in the output, one can write #
|
||||
# set(AdditionalCatchParameters --success) #
|
||||
# #
|
||||
# After the script, the ParseAndAddCatchTests_TESTS property for the target, and for each source #
|
||||
# file in the target is set, and contains the list of the tests extracted from that target, or #
|
||||
# from that file. This is useful, for example to add further labels or properties to the tests. #
|
||||
# #
|
||||
#==================================================================================================#
|
||||
|
||||
if (CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
|
||||
message(FATAL_ERROR "ParseAndAddCatchTests requires CMake 2.8.8 or newer")
|
||||
endif()
|
||||
|
||||
option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
|
||||
option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
|
||||
option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the test name" ON)
|
||||
option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
|
||||
option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
|
||||
|
||||
function(ParseAndAddCatchTests_PrintDebugMessage)
|
||||
if(PARSE_CATCH_TESTS_VERBOSE)
|
||||
message(STATUS "ParseAndAddCatchTests: ${ARGV}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# This removes the contents between
|
||||
# - block comments (i.e. /* ... */)
|
||||
# - full line comments (i.e. // ... )
|
||||
# contents have been read into '${CppCode}'.
|
||||
# !keep partial line comments
|
||||
function(ParseAndAddCatchTests_RemoveComments CppCode)
|
||||
string(ASCII 2 CMakeBeginBlockComment)
|
||||
string(ASCII 3 CMakeEndBlockComment)
|
||||
string(REGEX REPLACE "/\\*" "${CMakeBeginBlockComment}" ${CppCode} "${${CppCode}}")
|
||||
string(REGEX REPLACE "\\*/" "${CMakeEndBlockComment}" ${CppCode} "${${CppCode}}")
|
||||
string(REGEX REPLACE "${CMakeBeginBlockComment}[^${CMakeEndBlockComment}]*${CMakeEndBlockComment}" "" ${CppCode} "${${CppCode}}")
|
||||
string(REGEX REPLACE "\n[ \t]*//+[^\n]+" "\n" ${CppCode} "${${CppCode}}")
|
||||
|
||||
set(${CppCode} "${${CppCode}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Worker function
|
||||
function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
|
||||
# If SourceFile is an object library, do not scan it (as it is not a file). Exit without giving a warning about a missing file.
|
||||
if(SourceFile MATCHES "\\\$<TARGET_OBJECTS:.+>")
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Detected OBJECT library: ${SourceFile} this will not be scanned for tests.")
|
||||
return()
|
||||
endif()
|
||||
# According to CMake docs EXISTS behavior is well-defined only for full paths.
|
||||
get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
|
||||
if(NOT EXISTS ${SourceFile})
|
||||
message(WARNING "Cannot find source file: ${SourceFile}")
|
||||
return()
|
||||
endif()
|
||||
ParseAndAddCatchTests_PrintDebugMessage("parsing ${SourceFile}")
|
||||
file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME)
|
||||
|
||||
# Remove block and fullline comments
|
||||
ParseAndAddCatchTests_RemoveComments(Contents)
|
||||
|
||||
# Find definition of test names
|
||||
string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^\)]+\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
|
||||
|
||||
if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
|
||||
set_property(
|
||||
DIRECTORY
|
||||
APPEND
|
||||
PROPERTY CMAKE_CONFIGURE_DEPENDS ${SourceFile}
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(TestName ${Tests})
|
||||
# Strip newlines
|
||||
string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
|
||||
|
||||
# Get test type and fixture if applicable
|
||||
string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
|
||||
string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
|
||||
string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
|
||||
|
||||
# Get string parts of test definition
|
||||
string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")
|
||||
|
||||
# Strip wrapping quotation marks
|
||||
string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
|
||||
string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")
|
||||
|
||||
# Validate that a test name and tags have been provided
|
||||
list(LENGTH TestStrings TestStringsLength)
|
||||
if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
|
||||
message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
|
||||
endif()
|
||||
|
||||
# Assign name and tags
|
||||
list(GET TestStrings 0 Name)
|
||||
if("${TestType}" STREQUAL "SCENARIO")
|
||||
set(Name "Scenario: ${Name}")
|
||||
endif()
|
||||
if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND TestFixture)
|
||||
set(CTestName "${TestFixture}:${Name}")
|
||||
else()
|
||||
set(CTestName "${Name}")
|
||||
endif()
|
||||
if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
|
||||
set(CTestName "${TestTarget}:${CTestName}")
|
||||
endif()
|
||||
# add target to labels to enable running all tests added from this target
|
||||
set(Labels ${TestTarget})
|
||||
if(TestStringsLength EQUAL 2)
|
||||
list(GET TestStrings 1 Tags)
|
||||
string(TOLOWER "${Tags}" Tags)
|
||||
# remove target from labels if the test is hidden
|
||||
if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
|
||||
list(REMOVE_ITEM Labels ${TestTarget})
|
||||
endif()
|
||||
string(REPLACE "]" ";" Tags "${Tags}")
|
||||
string(REPLACE "[" "" Tags "${Tags}")
|
||||
else()
|
||||
# unset tags variable from previous loop
|
||||
unset(Tags)
|
||||
endif()
|
||||
|
||||
list(APPEND Labels ${Tags})
|
||||
|
||||
set(HiddenTagFound OFF)
|
||||
foreach(label ${Labels})
|
||||
string(REGEX MATCH "^!hide|^\\." result ${label})
|
||||
if(result)
|
||||
set(HiddenTagFound ON)
|
||||
break()
|
||||
endif(result)
|
||||
endforeach(label)
|
||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
|
||||
else()
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Adding test \"${CTestName}\"")
|
||||
if(Labels)
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Setting labels to ${Labels}")
|
||||
endif()
|
||||
|
||||
# Escape commas in the test spec
|
||||
string(REPLACE "," "\\," Name ${Name})
|
||||
|
||||
# Add the test and set its properties
|
||||
add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
|
||||
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
|
||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property")
|
||||
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
|
||||
else()
|
||||
set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
|
||||
LABELS "${Labels}")
|
||||
endif()
|
||||
set_property(
|
||||
TARGET ${TestTarget}
|
||||
APPEND
|
||||
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
|
||||
set_property(
|
||||
SOURCE ${SourceFile}
|
||||
APPEND
|
||||
PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"")
|
||||
endif()
|
||||
|
||||
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# entry point
|
||||
function(ParseAndAddCatchTests TestTarget)
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}")
|
||||
get_target_property(SourceFiles ${TestTarget} SOURCES)
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}")
|
||||
foreach(SourceFile ${SourceFiles})
|
||||
ParseAndAddCatchTests_ParseFile(${SourceFile} ${TestTarget})
|
||||
endforeach()
|
||||
ParseAndAddCatchTests_PrintDebugMessage("Finished parsing ${TestTarget}")
|
||||
endfunction()
|
||||
@@ -1,26 +0,0 @@
|
||||
set(_q "")
|
||||
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
||||
set(_q QUIET)
|
||||
set(_quietly TRUE)
|
||||
endif()
|
||||
find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
|
||||
|
||||
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
|
||||
include(CheckIncludeFileCXX)
|
||||
add_library(draco INTERFACE)
|
||||
target_include_directories(draco INTERFACE include)
|
||||
|
||||
if (_quietly)
|
||||
set(CMAKE_REQUIRED_QUIET ON)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILE_CXX("draco/draco_features.h" HAVE_DRACO_H)
|
||||
|
||||
if (NOT HAVE_DRACO_H)
|
||||
if (${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Draco library not found. Please install the dependency.")
|
||||
elseif(NOT _quietly)
|
||||
message(WARNING "Draco library not found.")
|
||||
endif()
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# PrusaSlicer specifics:
|
||||
# This file is backported from CMake 3.15 distribution to behave uniformly
|
||||
# across all versions of CMake. It explicitly adds GLEW_STATIC compile
|
||||
# across all versions of CMake. It explicitly adds GLEW_STATIC complile
|
||||
# definition to static targets which is needed to prevent link errors.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
@@ -152,7 +152,7 @@ find_library(GLEW_STATIC_LIBRARY_RELEASE
|
||||
PATHS ENV GLEW_ROOT)
|
||||
|
||||
find_library(GLEW_STATIC_LIBRARY_DEBUG
|
||||
NAMES GLEWds GLEWd glewd glewds glew32ds
|
||||
NAMES GLEWds glewd glewds glew32ds
|
||||
PATH_SUFFIXES lib lib64
|
||||
PATHS ENV GLEW_ROOT)
|
||||
|
||||
@@ -223,13 +223,8 @@ if(NOT TARGET GLEW::glew AND NOT GLEW_USE_STATIC_LIBS)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
|
||||
|
||||
if(APPLE)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "-framework OpenGL")
|
||||
else()
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
set_target_properties(GLEW::glew
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(GLEW_SHARED_LIBRARY_RELEASE)
|
||||
@@ -263,13 +258,8 @@ elseif(NOT TARGET GLEW::glew_s AND GLEW_USE_STATIC_LIBS)
|
||||
set_target_properties(GLEW::glew_s PROPERTIES INTERFACE_COMPILE_DEFINITIONS GLEW_STATIC)
|
||||
|
||||
if(APPLE)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "-framework OpenGL")
|
||||
else()
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
set_target_properties(GLEW::glew_s
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(GLEW_STATIC_LIBRARY_RELEASE)
|
||||
@@ -302,13 +292,8 @@ if(NOT TARGET GLEW::GLEW)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIRS}")
|
||||
|
||||
if(APPLE)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "-framework OpenGL")
|
||||
else()
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
set_target_properties(GLEW::GLEW
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(TARGET GLEW::glew)
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
#//
|
||||
#// Description:
|
||||
#// cmake module for finding NLopt installation
|
||||
#// NLopt installation location is defined by environment variable $NLOPT
|
||||
#//
|
||||
#// following variables are defined:
|
||||
#// NLopt_DIR - NLopt installation directory
|
||||
#// NLopt_INCLUDE_DIR - NLopt header directory
|
||||
#// NLopt_LIBRARY_DIR - NLopt library directory
|
||||
#// NLopt_LIBS - NLopt library files
|
||||
#//
|
||||
#// Example usage:
|
||||
#// find_package(NLopt 1.4 REQUIRED)
|
||||
@@ -10,27 +17,114 @@
|
||||
#//
|
||||
#//-------------------------------------------------------------------------
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
unset(_q)
|
||||
if (NLopt_FIND_QUIETLY)
|
||||
set(_q QUIET)
|
||||
endif ()
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "")
|
||||
set(NLopt_DEFINITIONS "")
|
||||
unset(NLopt_LIBS CACHE)
|
||||
|
||||
set(NLopt_DIR $ENV{NLOPT})
|
||||
if(NOT NLopt_DIR)
|
||||
|
||||
set(NLopt_FOUND TRUE)
|
||||
|
||||
set(_NLopt_LIB_NAMES "nlopt")
|
||||
find_library(NLopt_LIBS
|
||||
NAMES ${_NLopt_LIB_NAMES})
|
||||
if(NOT NLopt_LIBS)
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} Cannot find NLopt library '${_NLopt_LIB_NAMES}'.")
|
||||
else()
|
||||
get_filename_component(NLopt_DIR ${NLopt_LIBS} PATH)
|
||||
endif()
|
||||
unset(_NLopt_LIB_NAMES)
|
||||
|
||||
set(_NLopt_HEADER_FILE_NAME "nlopt.hpp")
|
||||
find_file(_NLopt_HEADER_FILE
|
||||
NAMES ${_NLopt_HEADER_FILE_NAME})
|
||||
if(NOT _NLopt_HEADER_FILE)
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} Cannot find NLopt header file '${_NLopt_HEADER_FILE_NAME}'.")
|
||||
endif()
|
||||
unset(_NLopt_HEADER_FILE_NAME)
|
||||
|
||||
if(NOT NLopt_FOUND)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} NLopt not found in system directories (and environment variable NLOPT is not set).")
|
||||
else()
|
||||
get_filename_component(NLopt_INCLUDE_DIR ${_NLopt_HEADER_FILE} DIRECTORY )
|
||||
endif()
|
||||
|
||||
unset(_NLopt_HEADER_FILE CACHE)
|
||||
|
||||
else()
|
||||
|
||||
set(NLopt_FOUND TRUE)
|
||||
|
||||
set(NLopt_INCLUDE_DIR "${NLopt_DIR}/include")
|
||||
if(NOT EXISTS "${NLopt_INCLUDE_DIR}")
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} Directory '${NLopt_INCLUDE_DIR}' does not exist.")
|
||||
endif()
|
||||
|
||||
set(NLopt_LIBRARY_DIR "${NLopt_DIR}/lib")
|
||||
if(NOT EXISTS "${NLopt_LIBRARY_DIR}")
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} Directory '${NLopt_LIBRARY_DIR}' does not exist.")
|
||||
endif()
|
||||
|
||||
set(_NLopt_LIB_NAMES "nlopt_cxx")
|
||||
find_library(NLopt_LIBS
|
||||
NAMES ${_NLopt_LIB_NAMES}
|
||||
PATHS ${NLopt_LIBRARY_DIR}
|
||||
NO_DEFAULT_PATH)
|
||||
if(NOT NLopt_LIBS)
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} Cannot find NLopt library '${_NLopt_LIB_NAMES}' in '${NLopt_LIBRARY_DIR}'.")
|
||||
endif()
|
||||
unset(_NLopt_LIB_NAMES)
|
||||
|
||||
set(_NLopt_HEADER_FILE_NAME "nlopt.hpp")
|
||||
find_file(_NLopt_HEADER_FILE
|
||||
NAMES ${_NLopt_HEADER_FILE_NAME}
|
||||
PATHS ${NLopt_INCLUDE_DIR}
|
||||
NO_DEFAULT_PATH)
|
||||
if(NOT _NLopt_HEADER_FILE)
|
||||
set(NLopt_FOUND FALSE)
|
||||
set(NLopt_ERROR_REASON "${NLopt_ERROR_REASON} Cannot find NLopt header file '${_NLopt_HEADER_FILE_NAME}' in '${NLopt_INCLUDE_DIR}'.")
|
||||
endif()
|
||||
unset(_NLopt_HEADER_FILE_NAME)
|
||||
unset(_NLopt_HEADER_FILE CACHE)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
# make variables changeable
|
||||
mark_as_advanced(
|
||||
NLopt_INCLUDE_DIR
|
||||
NLopt_LIBRARY_DIR
|
||||
NLopt_LIBS
|
||||
NLopt_DEFINITIONS
|
||||
)
|
||||
|
||||
find_package(NLopt ${NLopt_VERSION} CONFIG ${_q})
|
||||
find_package_handle_standard_args(NLopt CONFIG_MODE)
|
||||
|
||||
# report result
|
||||
if(NLopt_FOUND AND NOT _q)
|
||||
get_filename_component(NLOPT_LIBRARY_DIRS ${NLOPT_LIBRARY_DIRS} ABSOLUTE)
|
||||
get_filename_component(NLOPT_INCLUDE_DIRS ${NLOPT_INCLUDE_DIRS} ABSOLUTE)
|
||||
|
||||
message(STATUS "Found NLopt in '${NLOPT_LIBRARY_DIRS}'.")
|
||||
message(STATUS "Using NLopt include directory '${NLOPT_INCLUDE_DIRS}'.")
|
||||
|
||||
get_target_property(_configs NLopt::nlopt IMPORTED_CONFIGURATIONS)
|
||||
foreach (_config ${_configs})
|
||||
get_target_property(_lib NLopt::nlopt IMPORTED_LOCATION_${_config})
|
||||
message(STATUS "Found NLopt ${_config} library: ${_lib}")
|
||||
endforeach ()
|
||||
if(NLopt_FOUND)
|
||||
message(STATUS "Found NLopt in '${NLopt_DIR}'.")
|
||||
message(STATUS "Using NLopt include directory '${NLopt_INCLUDE_DIR}'.")
|
||||
message(STATUS "Using NLopt library '${NLopt_LIBS}'.")
|
||||
add_library(NLopt::nlopt INTERFACE IMPORTED)
|
||||
set_target_properties(NLopt::nlopt PROPERTIES INTERFACE_LINK_LIBRARIES ${NLopt_LIBS})
|
||||
set_target_properties(NLopt::nlopt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${NLopt_INCLUDE_DIR})
|
||||
set_target_properties(NLopt::nlopt PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${NLopt_DEFINITIONS}")
|
||||
# target_link_libraries(Nlopt::Nlopt INTERFACE ${NLopt_LIBS})
|
||||
# target_include_directories(Nlopt::Nlopt INTERFACE ${NLopt_INCLUDE_DIR})
|
||||
# target_compile_definitions(Nlopt::Nlopt INTERFACE ${NLopt_DEFINITIONS})
|
||||
else()
|
||||
if(NLopt_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Unable to find requested NLopt installation:${NLopt_ERROR_REASON}")
|
||||
else()
|
||||
if(NOT NLopt_FIND_QUIETLY)
|
||||
message(STATUS "NLopt was not found:${NLopt_ERROR_REASON}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -123,7 +123,7 @@ if (OPENVDB_FIND_MODULE_PATH)
|
||||
endif ()
|
||||
# ###########################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
# Monitoring <PackageName>_ROOT variables
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#
|
||||
# * TBB_FOUND - Set to false, or undefined, if we haven’t found, or
|
||||
# don’t want to use TBB.
|
||||
# * TBB_<component>_FOUND - If False, optional <component> part of TBB system is
|
||||
# * TBB_<component>_FOUND - If False, optional <component> part of TBB sytem is
|
||||
# not available.
|
||||
# * TBB_VERSION - The full version string
|
||||
# * TBB_VERSION_MAJOR - The major version
|
||||
@@ -77,7 +77,7 @@
|
||||
# tbbmalloc, tbbmalloc_debug, tbb_preview, or
|
||||
# tbb_preview_debug.
|
||||
#
|
||||
# The following variables should be used to build and link with TBB:
|
||||
# The following varibles should be used to build and link with TBB:
|
||||
#
|
||||
# * TBB_INCLUDE_DIRS - The include directory for TBB.
|
||||
# * TBB_LIBRARIES - The libraries to link against to use TBB.
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
find_path(LIBNOISE_INCLUDE_DIR libnoise/noise.h)
|
||||
find_library(LIBNOISE_LIBRARY_RELEASE NAMES libnoise libnoise_static liblibnoise_static)
|
||||
find_library(LIBNOISE_LIBRARY_DEBUG NAMES libnoised libnoise_staticd liblibnoise_staticd)
|
||||
|
||||
set(libnoise_LIB_FOUND FALSE)
|
||||
if (LIBNOISE_LIBRARY_RELEASE OR LIBNOISE_LIBRARY_DEBUG)
|
||||
set(libnoise_LIB_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libnoise DEFAULT_MSG
|
||||
libnoise_LIB_FOUND
|
||||
LIBNOISE_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(libnoise_FOUND)
|
||||
add_library(noise::noise STATIC IMPORTED)
|
||||
|
||||
set_target_properties(noise::noise PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBNOISE_INCLUDE_DIR}"
|
||||
)
|
||||
if (NOT libnoise_FIND_QUIETLY)
|
||||
message(STATUS "Found libnoise include directory: ${LIBNOISE_INCLUDE_DIR}")
|
||||
if (LIBNOISE_LIBRARY_RELEASE)
|
||||
message(STATUS "Found libnoise RELEASE library: ${LIBNOISE_LIBRARY_RELEASE}")
|
||||
endif ()
|
||||
if (LIBNOISE_LIBRARY_DEBUG)
|
||||
message(STATUS "Found libnoise DEBUG library: ${LIBNOISE_LIBRARY_DEBUG}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (LIBNOISE_LIBRARY_RELEASE)
|
||||
set_property(TARGET noise::noise APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(noise::noise PROPERTIES IMPORTED_LOCATION_RELEASE ${LIBNOISE_LIBRARY_RELEASE})
|
||||
endif ()
|
||||
|
||||
if (LIBNOISE_LIBRARY_DEBUG)
|
||||
set_property(TARGET noise::noise APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(noise::noise PROPERTIES IMPORTED_LOCATION_DEBUG ${LIBNOISE_LIBRARY_DEBUG})
|
||||
endif ()
|
||||
endif()
|
||||
@@ -11,7 +11,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.orcaslicer.OrcaSlicer</string>
|
||||
<string>com.softfever3d.orca-slicer</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
@@ -26,19 +26,6 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>ATSApplicationFontsPath</key>
|
||||
<string>fonts/</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>OrcaSlicer Downloads</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>orcaslicer</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
@@ -48,7 +35,7 @@
|
||||
<string>STL</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/stl.icns</string>
|
||||
<string>stl.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>STL</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -65,7 +52,7 @@
|
||||
<string>OBJ</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<string>OrcaSlicer.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>STL</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -82,7 +69,7 @@
|
||||
<string>AMF</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<string>OrcaSlicer.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>AMF</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -99,7 +86,7 @@
|
||||
<string>3MF</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<string>OrcaSlicer.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>3MF</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -116,7 +103,7 @@
|
||||
<string>GCODE</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>images/gcode.icns</string>
|
||||
<string>gcode.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>GCODE</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
@@ -133,7 +120,7 @@
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<!-- Disable App Transport Security. Resolves https://github.com/OrcaSlicer/OrcaSlicer/issues/791 -->
|
||||
<!-- Disable App Transport Security. Resolves https://github.com/SoftFever/OrcaSlicer/issues/791 -->
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSAllowsArbitraryLoadsInWebContent</key>
|
||||
|
||||
217
deps/Boost/Boost.cmake
vendored
217
deps/Boost/Boost.cmake
vendored
@@ -1,26 +1,203 @@
|
||||
include(ExternalProject)
|
||||
|
||||
set(_context_abi_line "")
|
||||
set(_context_arch_line "")
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
if (CMAKE_OSX_ARCHITECTURES MATCHES "x86")
|
||||
set(_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=sysv")
|
||||
elseif (CMAKE_OSX_ARCHITECTURES MATCHES "arm")
|
||||
set (_context_abi_line "-DBOOST_CONTEXT_ABI:STRING=aapcs")
|
||||
# Use boost 1.78 for Windows, to support VS2022
|
||||
if (WIN32)
|
||||
set(_boost_url "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz")
|
||||
set(_boost_hash 94CED8B72956591C4775AE2207A9763D3600B30D9D7446562C552F0A14A63BE7)
|
||||
set(_bootstrap_cmd bootstrap.bat)
|
||||
set(_build_cmd b2.exe)
|
||||
else()
|
||||
set(_boost_url "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz")
|
||||
set(_boost_hash AEB26F80E80945E82EE93E5939BAEBDCA47B9DEE80A07D3144BE1E1A6A66DD6A)
|
||||
set(_bootstrap_cmd ./bootstrap.sh)
|
||||
set(_build_cmd ./b2)
|
||||
endif()
|
||||
|
||||
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/common.jam ./tools/build/src/tools/common.jam)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam)
|
||||
set(_boost_toolset gcc)
|
||||
set(_patch_command ${_patch_command} && ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
||||
if (MSVC_VERSION EQUAL 1800)
|
||||
# 1800 = VS 12.0 (v120 toolset)
|
||||
set(_boost_toolset "msvc-12.0")
|
||||
elseif (MSVC_VERSION EQUAL 1900)
|
||||
# 1900 = VS 14.0 (v140 toolset)
|
||||
set(_boost_toolset "msvc-14.0")
|
||||
elseif (MSVC_VERSION LESS 1920)
|
||||
# 1910-1919 = VS 15.0 (v141 toolset)
|
||||
set(_boost_toolset "msvc-14.1")
|
||||
elseif (MSVC_VERSION LESS 1930)
|
||||
# 1920-1929 = VS 16.0 (v142 toolset)
|
||||
set(_boost_toolset "msvc-14.2")
|
||||
elseif (MSVC_VERSION LESS 1940)
|
||||
# 1930-1939 = VS 17.0 (v143 toolset)
|
||||
set(_boost_toolset "msvc-14.3")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported MSVC version")
|
||||
endif ()
|
||||
set(_context_arch_line "-DBOOST_CONTEXT_ARCHITECTURE:STRING=${CMAKE_OSX_ARCHITECTURES}")
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if (WIN32)
|
||||
set(_boost_toolset "clang-win")
|
||||
else()
|
||||
set(_boost_toolset "clang")
|
||||
endif()
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(_boost_toolset "intel")
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(_boost_toolset "clang")
|
||||
endif()
|
||||
|
||||
message(STATUS "Deduced boost toolset: ${_boost_toolset} based on ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||
|
||||
set(_libs "")
|
||||
foreach(_comp ${DEP_Boost_COMPONENTS})
|
||||
list(APPEND _libs "--with-${_comp}")
|
||||
endforeach()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(_link shared)
|
||||
else()
|
||||
set(_link static)
|
||||
endif()
|
||||
|
||||
set(_bits "")
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(_bits 32)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(Boost
|
||||
URL "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz"
|
||||
URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS
|
||||
-DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|stacktrace|wave|test
|
||||
-DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros
|
||||
-DBUILD_TESTING:BOOL=OFF
|
||||
-DBOOST_IOSTREAMS_ENABLE_ZSTD:BOOL=OFF
|
||||
"${_context_abi_line}"
|
||||
"${_context_arch_line}"
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NPROC)
|
||||
file(TO_NATIVE_PATH ${DESTDIR}/usr/local/ _prefix)
|
||||
|
||||
|
||||
set(_boost_variants "")
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
list(APPEND CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
|
||||
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
||||
endif()
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Release" _cfg_rel)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" _cfg_relwdeb)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "MinSizeRel" _cfg_minsizerel)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _cfg_deb)
|
||||
|
||||
if (_cfg_rel GREATER -1 OR _cfg_relwdeb GREATER -1 OR _cfg_minsizerel GREATER -1)
|
||||
list(APPEND _boost_variants release)
|
||||
endif()
|
||||
|
||||
if (MSVC AND ${DEP_DEBUG} )
|
||||
list(APPEND _boost_variants debug)
|
||||
endif()
|
||||
|
||||
if (NOT _boost_variants)
|
||||
set(_boost_variants release)
|
||||
endif()
|
||||
|
||||
if (IS_CROSS_COMPILE AND APPLE)
|
||||
if (${CMAKE_OSX_ARCHITECTURES} MATCHES "arm")
|
||||
message(STATUS "Compiling Boost for arm64.")
|
||||
message(STATUS "Compiling Boost with toolset ${_boost_toolset}.")
|
||||
message(STATUS "Compiling Boost with libs ${_libs}.")
|
||||
message(STATUS "Compiling Boost with variant ${_boost_variants}.")
|
||||
message(STATUS "Compiling Boost with _bootstrap_cmd ${_bootstrap_cmd}.")
|
||||
message(STATUS "_boost_linkflags = ${_boost_linkflags}")
|
||||
set(_arch_flags "-arch arm64")
|
||||
set(_boost_linkflags "linkflags=${_arch_flags}")
|
||||
message(STATUS "_cmake_args_osx_arch = '${_cmake_args_osx_arch}'")
|
||||
elseif (${CMAKE_OSX_ARCHITECTURES} MATCHES "x86_64")
|
||||
message(STATUS "Compiling Boost for x86_64.")
|
||||
set(_arch_flags "-arch x86_64")
|
||||
endif()
|
||||
set(_boost_linkflags "linkflags=${_arch_flags}")
|
||||
endif ()
|
||||
|
||||
set(_boost_flags "")
|
||||
if(APPLE)
|
||||
set(_boost_flags
|
||||
"cflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"cxxflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"mflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"mmflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}")
|
||||
elseif (UNIX)
|
||||
set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC")
|
||||
endif()
|
||||
|
||||
set(_build_cmd ${_build_cmd}
|
||||
${_boost_flags}
|
||||
${_boost_linkflags}
|
||||
-j${NPROC}
|
||||
${_libs}
|
||||
--layout=versioned
|
||||
--debug-configuration
|
||||
toolset=${_boost_toolset}
|
||||
address-model=${_bits}
|
||||
link=${_link}
|
||||
threading=multi
|
||||
boost.locale.icu=off
|
||||
--disable-icu
|
||||
${_boost_variants}
|
||||
stage)
|
||||
|
||||
set(_install_cmd ${_build_cmd} --prefix=${_prefix} install)
|
||||
|
||||
if (NOT IS_CROSS_COMPILE OR NOT APPLE OR BUILD_SHARED_LIBS)
|
||||
message(STATUS "Standard boost build with bootstrap command '${_bootstrap_cmd}'")
|
||||
message(STATUS "Standard boost build with patch command '${_patch_command}'")
|
||||
message(STATUS "Standard boost build with build command '${_build_cmd}'")
|
||||
message(STATUS "Standard boost build with install command '${_install_cmd}'")
|
||||
ExternalProject_Add(
|
||||
dep_Boost
|
||||
URL ${_boost_url}
|
||||
URL_HASH SHA256=${_boost_hash}
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
|
||||
CONFIGURE_COMMAND "${_bootstrap_cmd}"
|
||||
PATCH_COMMAND ${_patch_command}
|
||||
BUILD_COMMAND "${_build_cmd}"
|
||||
BUILD_IN_SOURCE ON
|
||||
INSTALL_COMMAND "${_install_cmd}"
|
||||
)
|
||||
|
||||
set(DEP_Boost_DEPENDS ZLIB)
|
||||
else()
|
||||
|
||||
ExternalProject_Add(
|
||||
dep_Boost
|
||||
URL ${_boost_url}
|
||||
URL_HASH SHA256=${_boost_hash}
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
|
||||
CONFIGURE_COMMAND ./bootstrap.sh
|
||||
--with-toolset=clang
|
||||
--with-libraries=date_time,filesystem,iostreams,locale,log,regex,system,thread
|
||||
"--prefix=${DESTDIR}/usr/local"
|
||||
# PATCH_COMMAND ${_patch_command}
|
||||
BUILD_COMMAND "${_build_cmd}"
|
||||
BUILD_IN_SOURCE ON
|
||||
INSTALL_COMMAND "${_install_cmd}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
message(STATUS "Patch the boost::polygon library with a custom one.")
|
||||
# Patch the boost::polygon library with a custom one.
|
||||
ExternalProject_Add(dep_boost_polygon
|
||||
EXCLUDE_FROM_ALL ON
|
||||
# GIT_REPOSITORY "https://github.com/prusa3d/polygon"
|
||||
# GIT_TAG prusaslicer_gmp
|
||||
URL https://github.com/prusa3d/polygon/archive/refs/heads/prusaslicer_gmp.zip
|
||||
URL_HASH SHA256=abeb9710f0a7069fb9b22181ae5c56f6066002f125db210e7ffb27032aed6824
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/boost_polygon
|
||||
DEPENDS dep_Boost
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
${_cmake_args_osx_arch}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon"
|
||||
"${DESTDIR}/usr/local/include/boost/polygon"
|
||||
)
|
||||
# Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms.
|
||||
list(APPEND _dep_list "dep_boost_polygon")
|
||||
endif ()
|
||||
10
deps/CGAL/CGAL.cmake
vendored
10
deps/CGAL/CGAL.cmake
vendored
@@ -1,14 +1,10 @@
|
||||
if (IN_GIT_REPO)
|
||||
set(CGAL_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_CGAL-prefix/src/dep_CGAL)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(
|
||||
CGAL
|
||||
# GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
||||
# GIT_TAG 3654f780ae0c64675cabaef0e5ddaf904c48b4b7 # releases/CGAL-5.6.3
|
||||
# GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
|
||||
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
|
||||
URL https://github.com/CGAL/cgal/releases/download/v5.6.3/CGAL-5.6.3.zip
|
||||
URL_HASH SHA256=5d577acb4a9918ccb960491482da7a3838f8d363aff47e14d703f19fd84733d4
|
||||
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
|
||||
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
|
||||
DEPENDS dep_Boost dep_GMP dep_MPFR
|
||||
)
|
||||
|
||||
|
||||
264
deps/CMakeLists.txt
vendored
264
deps/CMakeLists.txt
vendored
@@ -1,7 +1,3 @@
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0")
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
#
|
||||
# This CMake project downloads, configures and builds OrcaSlicer dependencies on Unix and Windows.
|
||||
#
|
||||
@@ -20,31 +16,20 @@ endif()
|
||||
# On Windows, architecture (64 vs 32 bits) is judged based on the compiler variant.
|
||||
# To build dependencies for either 64 or 32 bit OS, use the respective compiler command line.
|
||||
#
|
||||
# WARNING: On UNIX platforms wxWidgets hardcode the destdir path into its `wx-config` utility,
|
||||
# therefore, unfortunately, the installation cannot be copied/moved elsewhere without re-installing wxWidgets.
|
||||
# WARNING: On UNIX platforms wxWidgets hardcode the destdir path into its `wx-conffig` utility,
|
||||
# therefore, unfortunatelly, the installation cannot be copied/moved elsewhere without re-installing wxWidgets.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
if (APPLE)
|
||||
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
|
||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version")
|
||||
endif ()
|
||||
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
|
||||
endif ()
|
||||
|
||||
if(POLICY CMP0135) # DOWNLOAD_EXTRACT_TIMESTAMP
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
endif()
|
||||
|
||||
project(OrcaSlicer-deps)
|
||||
|
||||
# Backward compatibility for old CMake versions
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_VERSION VERSION_LESS "3.25")
|
||||
set(LINUX ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
include(ExternalProject)
|
||||
include(ProcessorCount)
|
||||
|
||||
@@ -53,71 +38,22 @@ if (NPROC EQUAL 0)
|
||||
set(NPROC 1)
|
||||
endif ()
|
||||
|
||||
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DL_CACHE CACHE PATH "Path for downloaded source packages.")
|
||||
set(FLATPAK FALSE CACHE BOOL "Toggles various build settings for flatpak, like /usr/local in DESTDIR or not building wxwidgets")
|
||||
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
|
||||
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../DL_CACHE CACHE PATH "Path for downloaded source packages.")
|
||||
|
||||
if ("${DESTDIR}" STREQUAL "" OR "${DESTDIR}" STREQUAL "${AUTOGENERATED_DESTDIR}")
|
||||
if (LINUX AND (NOT DEFINED USE_OLD_DESTDIR_PREV OR USE_OLD_DESTDIR_PREV) AND EXISTS "${CMAKE_BINARY_DIR}/destdir/usr/local" AND NOT EXISTS "${CMAKE_BINARY_DIR}/OrcaSlicer_dep/usr/local")
|
||||
set(USE_OLD_DESTDIR TRUE)
|
||||
message(WARNING "You are using an old directory name for dependencies that is being deprecated. "
|
||||
"Please remove the \"destdir\" directory and rebuild to update to the new name. "
|
||||
"The current \"destdir\" directory will be used until then.")
|
||||
endif ()
|
||||
if (NOT USE_OLD_DESTDIR AND USE_OLD_DESTDIR_PREV)
|
||||
set(REGEN_DESTDIR TRUE)
|
||||
endif ()
|
||||
else ()
|
||||
unset(AUTOGENERATED_DESTDIR CACHE)
|
||||
endif ()
|
||||
|
||||
if ("${DESTDIR}" STREQUAL "" OR REGEN_DESTDIR)
|
||||
if (USE_OLD_DESTDIR) # backward compatibility for old directory name
|
||||
set(DESTDIR "${CMAKE_BINARY_DIR}/destdir" CACHE PATH "Path to dependencies install directory" FORCE)
|
||||
else ()
|
||||
set(DESTDIR "${CMAKE_BINARY_DIR}/OrcaSlicer_dep" CACHE PATH "Path to dependencies install directory" FORCE)
|
||||
endif ()
|
||||
set(DESTDIR_MSG "(generated automatically and saved to cache)")
|
||||
set(AUTOGENERATED_DESTDIR ${DESTDIR} CACHE STRING "Provides the last autogenerated destdir" FORCE)
|
||||
unset(REGEN_DESTDIR CACHE)
|
||||
else ()
|
||||
set(DESTDIR_MSG "(from cache or command line)")
|
||||
endif ()
|
||||
|
||||
if (NOT FLATPAK)
|
||||
set(DESTDIR "${DESTDIR}/usr/local/")
|
||||
endif()
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
if (_is_multi)
|
||||
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" OFF)
|
||||
option(ORCA_INCLUDE_DEBUG_INFO "Includes debug information in a release build (like RelWithDebInfo) in a way that works with multi-configuration generators and incompatible dependencies. DEP_DEBUG option takes priority over this." OFF)
|
||||
option(AUTO_DEBUG_WORKAROUND "Automatically sets DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO based on CMAKE_BUILD_TYPE" ON)
|
||||
|
||||
if (AUTO_DEBUG_WORKAROUND)
|
||||
set(DEP_DEBUG OFF)
|
||||
set(ORCA_INCLUDE_DEBUG_INFO OFF)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(DEP_DEBUG ON)
|
||||
message(STATUS "DEP_DEBUG has been automatically turned ON due to CMAKE_BUILD_TYPE being set to Debug")
|
||||
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
set(ORCA_INCLUDE_DEBUG_INFO ON)
|
||||
message(STATUS "ORCA_INCLUDE_DEBUG_INFO has been automatically turned ON due to CMAKE_BUILD_TYPE being set to RelWithDebInfo")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" OFF)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" ON)
|
||||
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
|
||||
else()
|
||||
if(POLICY CMP0135) # DOWNLOAD_EXTRACT_TIMESTAMP
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(IS_CROSS_COMPILE FALSE)
|
||||
|
||||
if (APPLE)
|
||||
list(LENGTH CMAKE_OSX_ARCHITECTURES _arch_len)
|
||||
if (_arch_len GREATER 1)
|
||||
message(FATAL_ERROR "OrcaSlicer only supports building for one architecture at a time. Please make sure only one architecture is specified in CMAKE_OSX_ARCHITECTURES")
|
||||
endif ()
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
set(CMAKE_FIND_APPBUNDLE LAST)
|
||||
list(FIND CMAKE_OSX_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR} _arch_idx)
|
||||
@@ -140,8 +76,8 @@ endif ()
|
||||
# Slic3r compiles with a different version which will cause runtime errors.
|
||||
# option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF)
|
||||
|
||||
message(STATUS "OrcaSlicer deps DESTDIR: ${DESTDIR} ${DESTDIR_MSG}")
|
||||
message(STATUS "OrcaSlicer download dir for source packages: ${DEP_DOWNLOAD_DIR}")
|
||||
message(STATUS "OrcaSlicer deps DESTDIR: ${DESTDIR}")
|
||||
message(STATUS "OrcaSlicer dowload dir for source packages: ${DEP_DOWNLOAD_DIR}")
|
||||
message(STATUS "OrcaSlicer deps debug build: ${DEP_DEBUG}")
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
@@ -149,6 +85,8 @@ find_package(Git REQUIRED)
|
||||
# The default command line for patching. Only works for newer
|
||||
set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
||||
@@ -159,11 +97,7 @@ function(orcaslicer_add_cmake_project projectname)
|
||||
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
if (_is_multi OR MSVC)
|
||||
if (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG)
|
||||
set(_configs_line "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
else ()
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
|
||||
set(_gen "")
|
||||
@@ -177,22 +111,36 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}
|
||||
INSTALL_DIR ${DESTDIR}/usr/local
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DCMAKE_IGNORE_PREFIX_PATH:STRING=${CMAKE_IGNORE_PREFIX_PATH}
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
|
||||
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
|
||||
-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
else()
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}/usr/local
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
@@ -203,66 +151,26 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
if (FLATPAK)
|
||||
# Free up space during flatpak builds to prevent running out of space during CI/CD
|
||||
|
||||
# note for future devs: shared libs may actually create a size reduction
|
||||
# but orcaslicer_deps tends to get really funny regarding linking after that (notably boost)
|
||||
# so, as much as I would like to use that, it's not happening
|
||||
ExternalProject_Add_Step(dep_${projectname} free_download_space
|
||||
DEPENDEES download # do after download
|
||||
COMMENT "Freeing Space: Removing source archive"
|
||||
WORKING_DIRECTORY ${DEP_DOWNLOAD_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -r ${projectname}
|
||||
)
|
||||
ExternalProject_Add_Step(dep_${projectname} free_build_space
|
||||
DEPENDEES install # do after install
|
||||
COMMENT "Freeing Space: Removing source and build files"
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dep_${projectname}-prefix/src
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -rf dep_${projectname} dep_${projectname}-build
|
||||
)
|
||||
endif ()
|
||||
else()
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
|
||||
-DCMAKE_IGNORE_PREFIX_PATH:STRING=${CMAKE_IGNORE_PREFIX_PATH}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
${_cmake_osx_arch}
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
endfunction(orcaslicer_add_cmake_project)
|
||||
|
||||
|
||||
if (MSVC)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
|
||||
message(STATUS "\nDetected X64 compiler => building X64 deps bundle\n")
|
||||
set(DEPS_ARCH "x64")
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
message(STATUS "\nDetected 64-bit compiler => building 64-bit deps bundle\n")
|
||||
set(DEPS_BITS 64)
|
||||
include("deps-windows.cmake")
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86")
|
||||
message(STATUS "\nDetected X86 compiler => building X86 deps bundle\n")
|
||||
set(DEPS_ARCH "x86")
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
message(STATUS "\nDetected 32-bit compiler => building 32-bit deps bundle\n")
|
||||
set(DEPS_BITS 32)
|
||||
include("deps-windows.cmake")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
endif ()
|
||||
elseif (APPLE)
|
||||
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
if (CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(DEP_OSX_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
message("OS X Deployment Target: ${DEP_OSX_TARGET}")
|
||||
@@ -287,19 +195,6 @@ else()
|
||||
include("deps-linux.cmake")
|
||||
endif()
|
||||
|
||||
if(FLATPAK)
|
||||
# flatpak bundles some deps with the layer, so attempt to find them first
|
||||
# also, yes, this reduces CI by not needing to vendor certain deps
|
||||
find_package(ZLIB)
|
||||
find_package(PNG)
|
||||
find_package(EXPAT)
|
||||
find_package(CURL)
|
||||
find_package(JPEG)
|
||||
find_package(Freetype)
|
||||
find_package(OpenSSL 1.1...<3.2)
|
||||
find_package(CURL)
|
||||
endif()
|
||||
|
||||
set(ZLIB_PKG "")
|
||||
if (NOT ZLIB_FOUND)
|
||||
include(ZLIB/ZLIB.cmake)
|
||||
@@ -311,7 +206,6 @@ if (NOT PNG_FOUND)
|
||||
set(PNG_PKG dep_PNG)
|
||||
endif ()
|
||||
set(EXPAT_PKG "")
|
||||
find_package(EXPAT)
|
||||
if (NOT EXPAT_FOUND)
|
||||
include(EXPAT/EXPAT.cmake)
|
||||
set(EXPAT_PKG dep_EXPAT)
|
||||
@@ -324,7 +218,6 @@ include(Boost/Boost.cmake)
|
||||
include(Cereal/Cereal.cmake)
|
||||
include(Qhull/Qhull.cmake)
|
||||
include(GLEW/GLEW.cmake)
|
||||
|
||||
include(GLFW/GLFW.cmake)
|
||||
include(OpenCSG/OpenCSG.cmake)
|
||||
|
||||
@@ -339,86 +232,36 @@ include(MPFR/MPFR.cmake)
|
||||
include(CGAL/CGAL.cmake)
|
||||
|
||||
include(NLopt/NLopt.cmake)
|
||||
include(libnoise/libnoise.cmake)
|
||||
|
||||
include(Draco/Draco.cmake)
|
||||
include(OpenSSL/OpenSSL.cmake)
|
||||
|
||||
|
||||
# I *think* 1.1 is used for *just* md5 hashing?
|
||||
# 3.1 has everything in the right place, but the md5 funcs used are deprecated
|
||||
# a grep across the repo shows it is used for other things
|
||||
# TODO: update openssl and everything that uses <openssl/md5.h>
|
||||
set(OPENSSL_PKG "")
|
||||
if(NOT OPENSSL_FOUND)
|
||||
include(OpenSSL/OpenSSL.cmake)
|
||||
set(OPENSSL_PKG dep_OpenSSL)
|
||||
endif()
|
||||
|
||||
# we don't want to load a "wrong" openssl when loading curl
|
||||
# so, just don't even bother
|
||||
# ...i think this is how it works? change if wrong
|
||||
set(CURL_PKG "")
|
||||
if (NOT OPENSSL_FOUND OR NOT CURL_FOUND)
|
||||
if (NOT CURL_FOUND)
|
||||
include(CURL/CURL.cmake)
|
||||
set(CURL_PKG dep_CURL)
|
||||
endif ()
|
||||
|
||||
set(JPEG_PKG "")
|
||||
if (NOT JPEG_FOUND)
|
||||
include(JPEG/JPEG.cmake)
|
||||
set(JPEG_PKG dep_JPEG)
|
||||
endif()
|
||||
|
||||
# flatpak builds wxwidgets separately, so it is not included in the deps target
|
||||
set(WXWIDGETS_PKG "")
|
||||
include(JPEG/JPEG.cmake)
|
||||
include(TIFF/TIFF.cmake)
|
||||
include(wxWidgets/wxWidgets.cmake)
|
||||
if (NOT FLATPAK)
|
||||
set(WXWIDGETS_PKG "dep_wxWidgets")
|
||||
endif()
|
||||
|
||||
set(FREETYPE_PKG "")
|
||||
if(NOT FREETYPE_FOUND)
|
||||
include(FREETYPE/FREETYPE.cmake)
|
||||
set(FREETYPE_PKG "dep_FREETYPE")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
|
||||
RESULT_VARIABLE REV_PARSE_RESULT
|
||||
OUTPUT_VARIABLE REV_PARSE_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Will output "true" and have a 0 return code if within a git repo
|
||||
if((REV_PARSE_RESULT EQUAL 0) AND (REV_PARSE_OUTPUT STREQUAL "true"))
|
||||
set(IN_GIT_REPO TRUE)
|
||||
# Find relative path from root to source used for adjusting patch command
|
||||
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
|
||||
endif ()
|
||||
|
||||
include(OCCT/OCCT.cmake)
|
||||
include(OpenCV/OpenCV.cmake)
|
||||
include(FREETYPE/FREETYPE.cmake)
|
||||
|
||||
set(_dep_list
|
||||
dep_Boost
|
||||
dep_TBB
|
||||
${OPENSSL_PKG}
|
||||
${CURL_PKG}
|
||||
${WXWIDGETS_PKG}
|
||||
dep_wxWidgets
|
||||
dep_Cereal
|
||||
dep_Draco
|
||||
dep_NLopt
|
||||
dep_OpenVDB
|
||||
dep_OpenCSG
|
||||
dep_OpenCV
|
||||
dep_CGAL
|
||||
dep_OpenSSL
|
||||
dep_GLFW
|
||||
dep_OCCT
|
||||
${FREETYPE_PKG}
|
||||
${PNG_PKG}
|
||||
${ZLIB_PKG}
|
||||
${EXPAT_PKG}
|
||||
dep_libnoise
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
@@ -430,6 +273,9 @@ else()
|
||||
#list(APPEND _dep_list "dep_libigl")
|
||||
endif()
|
||||
|
||||
list(APPEND _dep_list "dep_OCCT")
|
||||
list(APPEND _dep_list "dep_FREETYPE")
|
||||
|
||||
add_custom_target(deps ALL DEPENDS ${_dep_list})
|
||||
|
||||
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands
|
||||
|
||||
7
deps/CURL/CURL.cmake
vendored
7
deps/CURL/CURL.cmake
vendored
@@ -72,10 +72,9 @@ orcaslicer_add_cmake_project(CURL
|
||||
${_curl_platform_flags}
|
||||
)
|
||||
|
||||
if(NOT OPENSSL_FOUND)
|
||||
# (openssl may or may not be built)
|
||||
add_dependencies(dep_CURL ${OPENSSL_PKG})
|
||||
endif()
|
||||
# if (APPLE OR (CMAKE_SYSTEM_NAME STREQUAL "Linux"))
|
||||
add_dependencies(dep_CURL dep_OpenSSL)
|
||||
# endif ()
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_CURL)
|
||||
|
||||
4
deps/Draco/Draco.cmake
vendored
4
deps/Draco/Draco.cmake
vendored
@@ -1,4 +0,0 @@
|
||||
orcaslicer_add_cmake_project(Draco
|
||||
URL https://github.com/google/draco/archive/refs/tags/1.5.7.zip
|
||||
URL_HASH SHA256=27b72ba2d5ff3d0a9814ad40d4cb88f8dc89a35491c0866d952473f8f9416b77
|
||||
)
|
||||
2
deps/FREETYPE/FREETYPE.cmake
vendored
2
deps/FREETYPE/FREETYPE.cmake
vendored
@@ -11,7 +11,7 @@ else()
|
||||
endif()
|
||||
|
||||
orcaslicer_add_cmake_project(FREETYPE
|
||||
URL https://github.com/SoftFever/orca_deps/releases/download/freetype-2.12.1.tar.gz/freetype-2.12.1.tar.gz
|
||||
URL https://mirror.ossplanet.net/nongnu/freetype/freetype-2.12.1.tar.gz
|
||||
URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938
|
||||
#DEPENDS ${ZLIB_PKG}
|
||||
#"${_patch_step}"
|
||||
|
||||
2
deps/GLEW/GLEW.cmake
vendored
2
deps/GLEW/GLEW.cmake
vendored
@@ -5,8 +5,6 @@ find_package(OpenGL QUIET REQUIRED)
|
||||
orcaslicer_add_cmake_project(
|
||||
GLEW
|
||||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/glew
|
||||
CMAKE_ARGS
|
||||
-DGLEW_USE_EGL=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
|
||||
12
deps/GLEW/glew/CMakeLists.txt
vendored
12
deps/GLEW/glew/CMakeLists.txt
vendored
@@ -3,17 +3,9 @@ project(GLEW)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
# Allow parent project to control EGL usage.
|
||||
# Default to OFF since OrcaSlicer forces GDK_BACKEND=x11 (using GLX contexts).
|
||||
# GLEW must use glXGetProcAddressARB (GLX) to match wxWidgets GL canvas.
|
||||
# Using EGL function loading with GLX contexts causes rendering failures.
|
||||
option(GLEW_USE_EGL "Use EGL instead of GLX for OpenGL function loading" OFF)
|
||||
|
||||
if(GLEW_USE_EGL)
|
||||
message(STATUS "Building GLEW with EGL support")
|
||||
if(OpenGL_EGL_FOUND)
|
||||
message(STATUS "building GLEW for EGL (hope that wxWidgets agrees, otherwise you won't have any output!)")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGLEW_EGL")
|
||||
else()
|
||||
message(STATUS "Building GLEW with GLX support")
|
||||
endif()
|
||||
|
||||
add_library(GLEW src/glew.c)
|
||||
|
||||
7
deps/GLEW/glew/README.md
vendored
7
deps/GLEW/glew/README.md
vendored
@@ -22,6 +22,7 @@ https://github.com/nigels-com/glew
|
||||
* [Install build tools](#install-build-tools)
|
||||
* [Build](#build-1)
|
||||
* [Linux EGL](#linux-egl)
|
||||
* [Linux OSMesa](#linux-osmesa)
|
||||
* [Linux mingw-w64](#linux-mingw-w64)
|
||||
* [Using cmake](#using-cmake)
|
||||
* [Install build tools](#install-build-tools-1)
|
||||
@@ -94,6 +95,11 @@ _Note: you may need to call `make` in the **auto** folder first_
|
||||
$ sudo apt install libegl1-mesa-dev
|
||||
$ make SYSTEM=linux-egl
|
||||
|
||||
##### Linux OSMesa
|
||||
|
||||
$ sudo apt install libosmesa-dev
|
||||
$ make SYSTEM=linux-osmesa
|
||||
|
||||
##### Linux mingw-w64
|
||||
|
||||
$ sudo apt install mingw-w64
|
||||
@@ -134,6 +140,7 @@ RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel c
|
||||
| --------------- | ----------- |
|
||||
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
|
||||
| GLEW_REGAL | Build in Regal mode. |
|
||||
| GLEW_OSMESA | Build in off-screen Mesa mode. |
|
||||
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
|
||||
|
||||
### Windows
|
||||
|
||||
32
deps/GMP/0001-GMP_GCC15.patch
vendored
32
deps/GMP/0001-GMP_GCC15.patch
vendored
@@ -1,32 +0,0 @@
|
||||
--- GMP/acinclude.m4 2025-05-14 18:50:11.396354745 -0400
|
||||
+++ GMP/acinclude.m4.2 2025-05-14 18:57:20.757853503 -0400
|
||||
@@ -609,7 +609,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
|
||||
--- GMP/configure 2025-05-14 19:33:35.730593315 -0400
|
||||
+++ GMP/configure 2025-05-14 19:35:37.805619186 -0400
|
||||
@@ -6526,7 +6526,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
@@ -8145,7 +8145,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
26
deps/GMP/GMP.cmake
vendored
26
deps/GMP/GMP.cmake
vendored
@@ -1,22 +1,19 @@
|
||||
|
||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
|
||||
|
||||
if (IN_GIT_REPO)
|
||||
set(GMP_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_GMP-prefix/src/dep_GMP)
|
||||
endif ()
|
||||
set(_dstdir ${DESTDIR}/usr/local)
|
||||
|
||||
if (MSVC)
|
||||
set(_output ${DESTDIR}/include/gmp.h
|
||||
${DESTDIR}/lib/libgmp-10.lib
|
||||
${DESTDIR}/bin/libgmp-10.dll)
|
||||
set(_output ${_dstdir}/include/gmp.h
|
||||
${_dstdir}/lib/libgmp-10.lib
|
||||
${_dstdir}/bin/libgmp-10.dll)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${DESTDIR}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libgmp-10.lib ${DESTDIR}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libgmp-10.dll ${DESTDIR}/bin/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.lib ${_dstdir}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.dll ${_dstdir}/bin/
|
||||
)
|
||||
|
||||
|
||||
add_custom_target(dep_GMP SOURCES ${_output})
|
||||
|
||||
else ()
|
||||
@@ -63,10 +60,9 @@ else ()
|
||||
URL https://github.com/SoftFever/OrcaSlicer_deps/releases/download/gmp-6.2.1/gmp-6.2.1.tar.bz2
|
||||
URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
|
||||
PATCH_COMMAND git apply ${GMP_DIRECTORY_FLAG} --verbose ${CMAKE_CURRENT_LIST_DIR}/0001-GMP_GCC15.patch
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND env "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}" ${_gmp_build_tgt}
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
24
deps/MPFR/MPFR.cmake
vendored
24
deps/MPFR/MPFR.cmake
vendored
@@ -1,17 +1,18 @@
|
||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
|
||||
set(_dstdir ${DESTDIR}/usr/local)
|
||||
|
||||
if (MSVC)
|
||||
set(_output ${DESTDIR}/include/mpfr.h
|
||||
${DESTDIR}/include/mpf2mpfr.h
|
||||
${DESTDIR}/lib/libmpfr-4.lib
|
||||
${DESTDIR}/bin/libmpfr-4.dll)
|
||||
set(_output ${_dstdir}/include/mpfr.h
|
||||
${_dstdir}/include/mpf2mpfr.h
|
||||
${_dstdir}/lib/libmpfr-4.lib
|
||||
${_dstdir}/bin/libmpfr-4.dll)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${DESTDIR}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${DESTDIR}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libmpfr-4.lib ${DESTDIR}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libmpfr-4.dll ${DESTDIR}/bin/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${_dstdir}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_MPFR SOURCES ${_output})
|
||||
@@ -25,13 +26,12 @@ else ()
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(dep_MPFR
|
||||
URL https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.2.tar.bz2
|
||||
https://www.mpfr.org/mpfr-4.2.2/mpfr-4.2.2.tar.bz2
|
||||
URL_HASH SHA256=9ad62c7dc910303cd384ff8f1f4767a655124980bb6d8650fe62c815a231bb7b
|
||||
URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed
|
||||
URL_HASH SHA256=cf4f4b2d80abb79e820e78c8077b6725bbbb4e8f41896783c899087be0e94068
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND autoreconf -f -i &&
|
||||
env "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR} --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR} ${_gmp_build_tgt}
|
||||
env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
DEPENDS dep_GMP
|
||||
|
||||
24
deps/OCCT/0001-OCCT-fix.patch
vendored
24
deps/OCCT/0001-OCCT-fix.patch
vendored
@@ -195,27 +195,3 @@ index 5ae9899f..0a17372b 100644
|
||||
|
||||
if (!myFTLib->IsValid())
|
||||
{
|
||||
From 7236e83dcc1e7284e66dc61e612154617ef715d6 Mon Sep 17 00:00:00 2001
|
||||
From: dpasukhi <dpasukhi@opencascade.com>
|
||||
Date: Tue, 27 Aug 2024 11:33:29 +0100
|
||||
Subject: [PATCH] 0033808: Coding - FreeType Use unsigned point and contour
|
||||
indexing in `FT_Outline`
|
||||
|
||||
Changes to auto instead of specific type
|
||||
---
|
||||
src/StdPrs/StdPrs_BRepFont.cxx | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/StdPrs/StdPrs_BRepFont.cxx b/src/StdPrs/StdPrs_BRepFont.cxx
|
||||
index ab2d9b3c9f..cd701879b1 100644
|
||||
--- a/src/StdPrs/StdPrs_BRepFont.cxx
|
||||
+++ b/src/StdPrs/StdPrs_BRepFont.cxx
|
||||
@@ -457,7 +457,7 @@ Standard_Boolean StdPrs_BRepFont::renderGlyph (const Standard_Utf32Char theChar,
|
||||
for (short aContour = 0, aStartIndex = 0; aContour < anOutline->n_contours; ++aContour)
|
||||
{
|
||||
const FT_Vector* aPntList = &anOutline->points[aStartIndex];
|
||||
- const char* aTags = &anOutline->tags[aStartIndex];
|
||||
+ const auto* aTags = &anOutline->tags[aStartIndex];
|
||||
const short anEndIndex = anOutline->contours[aContour];
|
||||
const short aPntsNb = (anEndIndex - aStartIndex) + 1;
|
||||
aStartIndex = anEndIndex + 1;
|
||||
|
||||
14
deps/OCCT/OCCT.cmake
vendored
14
deps/OCCT/OCCT.cmake
vendored
@@ -4,26 +4,24 @@ else()
|
||||
set(library_build_type "Static")
|
||||
endif()
|
||||
|
||||
if (IN_GIT_REPO)
|
||||
set(OCCT_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT)
|
||||
endif ()
|
||||
|
||||
# get relative path of CMAKE_BINARY_DIR against root source directory
|
||||
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
|
||||
|
||||
orcaslicer_add_cmake_project(OCCT
|
||||
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
|
||||
URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
|
||||
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
||||
PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
||||
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
|
||||
#DEPENDS dep_Boost
|
||||
DEPENDS ${FREETYPE_PKG}
|
||||
#DEPENDS dep_FREETYPE
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_CXX_STANDARD=17
|
||||
-DBUILD_LIBRARY_TYPE=${library_build_type}
|
||||
-DUSE_TK=OFF
|
||||
-DUSE_TBB=OFF
|
||||
#-DUSE_FREETYPE=OFF
|
||||
-DUSE_FFMPEG=OFF
|
||||
-DUSE_VTK=OFF
|
||||
-DBUILD_DOC_Overview=OFF
|
||||
-DBUILD_MODULE_ApplicationFramework=OFF
|
||||
#-DBUILD_MODULE_DataExchange=OFF
|
||||
-DBUILD_MODULE_Draw=OFF
|
||||
@@ -33,4 +31,4 @@ orcaslicer_add_cmake_project(OCCT
|
||||
-DBUILD_MODULE_Visualization=OFF
|
||||
)
|
||||
|
||||
# add_dependencies(dep_OCCT ${FREETYPE_PKG})
|
||||
add_dependencies(dep_OCCT dep_FREETYPE)
|
||||
|
||||
54
deps/OpenCV/0001-vs.patch
vendored
54
deps/OpenCV/0001-vs.patch
vendored
@@ -1,54 +0,0 @@
|
||||
diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake
|
||||
index 7f229cde96..d8e20f8fe9 100644
|
||||
--- a/cmake/OpenCVDetectCXXCompiler.cmake
|
||||
+++ b/cmake/OpenCVDetectCXXCompiler.cmake
|
||||
@@ -171,8 +171,10 @@ elseif(MSVC)
|
||||
set(OpenCV_RUNTIME vc15)
|
||||
elseif(MSVC_VERSION MATCHES "^192[0-9]$")
|
||||
set(OpenCV_RUNTIME vc16)
|
||||
- elseif(MSVC_VERSION MATCHES "^193[0-9]$")
|
||||
+ elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
|
||||
set(OpenCV_RUNTIME vc17)
|
||||
+ elseif(MSVC_VERSION MATCHES "^195[0-9]$")
|
||||
+ set(OpenCV_RUNTIME vc18)
|
||||
else()
|
||||
message(WARNING "OpenCV does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set OpenCV_RUNTIME")
|
||||
endif()
|
||||
diff --git a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
|
||||
index b0f254ebe8..8f0178b0ae 100644
|
||||
--- a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
|
||||
+++ b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
|
||||
@@ -137,7 +137,7 @@ elseif(MSVC)
|
||||
set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version
|
||||
endif()
|
||||
endif()
|
||||
- elseif(MSVC_VERSION MATCHES "^193[0-9]$")
|
||||
+ elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
|
||||
set(OpenCV_RUNTIME vc17)
|
||||
check_one_config(has_VS2022)
|
||||
if(NOT has_VS2022)
|
||||
@@ -151,6 +151,24 @@ elseif(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
+ elseif(MSVC_VERSION MATCHES "^195[0-9]$")
|
||||
+ set(OpenCV_RUNTIME vc18)
|
||||
+ check_one_config(has_VS2026)
|
||||
+ if(NOT has_VS2026)
|
||||
+ set(OpenCV_RUNTIME vc17)
|
||||
+ check_one_config(has_VS2022)
|
||||
+ if(NOT has_VS2022)
|
||||
+ set(OpenCV_RUNTIME vc16)
|
||||
+ check_one_config(has_VS2019)
|
||||
+ if(NOT has_VS2019)
|
||||
+ set(OpenCV_RUNTIME vc15) # selecting previous compatible runtime version
|
||||
+ check_one_config(has_VS2017)
|
||||
+ if(NOT has_VS2017)
|
||||
+ set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version
|
||||
+ endif()
|
||||
+ endif()
|
||||
+ endif()
|
||||
+ endif()
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
54
deps/OpenCV/0002-clang19-macos.patch
vendored
54
deps/OpenCV/0002-clang19-macos.patch
vendored
@@ -1,54 +0,0 @@
|
||||
From 893b8113f04d408cc6177c6de19c9889a48faa24 Mon Sep 17 00:00:00 2001
|
||||
From: Zixu Wang <zixu_wang@apple.com>
|
||||
Date: Thu, 18 Jan 2024 11:12:00 -0800
|
||||
Subject: [PATCH] Fix unused platform check and configuration for macOS
|
||||
|
||||
In a similar manner as zlib (https://github.com/madler/zlib/pull/895),
|
||||
libpng contains a header configuration that's no longer valid and
|
||||
hasn't been exercised for the macOS target.
|
||||
|
||||
- The target OS conditional macros are misused. Specifically
|
||||
`TARGET_OS_MAC` covers all Apple targets, including iOS, and it
|
||||
should not be checked with `#if defined` as they would always be
|
||||
defined (to either 1 or 0) on Apple platforms.
|
||||
- `#include <fp.h>` no longer works for the macOS target and results
|
||||
in a compilation failure. macOS ships all required functions in
|
||||
`math.h`, and clients should use `math.h` instead.
|
||||
|
||||
This problem has not been noticed until a recent extension in clang
|
||||
(https://github.com/llvm/llvm-project/pull/74676) exposed the issue
|
||||
and broke libpng builds on Apple platforms. The failure can be
|
||||
reproduced now by adding `#include <TargetConditionals.h>` before the
|
||||
block.
|
||||
|
||||
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
|
||||
---
|
||||
AUTHORS | 2 ++
|
||||
pngpriv.h | 14 ++------------
|
||||
2 files changed, 4 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
|
||||
index 6c7280cf53..190eb85cbf 100644
|
||||
--- a/3rdparty/libpng/pngpriv.h
|
||||
+++ b/3rdparty/libpng/pngpriv.h
|
||||
@@ -556,18 +556,8 @@
|
||||
*/
|
||||
# include <float.h>
|
||||
|
||||
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
|
||||
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
|
||||
- /* We need to check that <math.h> hasn't already been included earlier
|
||||
- * as it seems it doesn't agree with <fp.h>, yet we should really use
|
||||
- * <fp.h> if possible.
|
||||
- */
|
||||
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
|
||||
-# include <fp.h>
|
||||
-# endif
|
||||
-# else
|
||||
-# include <math.h>
|
||||
-# endif
|
||||
+# include <math.h>
|
||||
+
|
||||
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
|
||||
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
|
||||
* MATH=68881
|
||||
78
deps/OpenCV/OpenCV.cmake
vendored
78
deps/OpenCV/OpenCV.cmake
vendored
@@ -1,78 +0,0 @@
|
||||
if (MSVC)
|
||||
set(_use_IPP "-DWITH_IPP=ON")
|
||||
else ()
|
||||
set(_use_IPP "-DWITH_IPP=OFF")
|
||||
endif ()
|
||||
|
||||
if (IN_GIT_REPO)
|
||||
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(OpenCV
|
||||
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
|
||||
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
|
||||
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
|
||||
CMAKE_ARGS
|
||||
-DBUILD_SHARED_LIBS=0
|
||||
-DBUILD_PERE_TESTS=OFF
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_opencv_python_tests=OFF
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_JASPER=OFF
|
||||
-DBUILD_JAVA=OFF
|
||||
-DBUILD_JPEG=ON
|
||||
-DBUILD_APPS_LIST=version
|
||||
-DBUILD_opencv_apps=OFF
|
||||
-DBUILD_opencv_java=OFF
|
||||
-DBUILD_OPENEXR=OFF
|
||||
-DBUILD_PNG=ON
|
||||
-DBUILD_TBB=OFF
|
||||
-DBUILD_WEBP=OFF
|
||||
-DBUILD_ZLIB=OFF
|
||||
-DWITH_1394=OFF
|
||||
-DWITH_CUDA=OFF
|
||||
-DWITH_EIGEN=OFF
|
||||
${_use_IPP}
|
||||
-DWITH_ITT=OFF
|
||||
-DWITH_FFMPEG=OFF
|
||||
-DWITH_GPHOTO2=OFF
|
||||
-DWITH_GSTREAMER=OFF
|
||||
-DOPENCV_GAPI_GSTREAMER=OFF
|
||||
-DWITH_GTK_2_X=OFF
|
||||
-DWITH_JASPER=OFF
|
||||
-DWITH_LAPACK=OFF
|
||||
-DWITH_MATLAB=OFF
|
||||
-DWITH_MFX=OFF
|
||||
-DWITH_DIRECTX=OFF
|
||||
-DWITH_DIRECTML=OFF
|
||||
-DWITH_OPENCL=OFF
|
||||
-DWITH_OPENCL_D3D11_NV=OFF
|
||||
-DWITH_OPENCLAMDBLAS=OFF
|
||||
-DWITH_OPENCLAMDFFT=OFF
|
||||
-DWITH_OPENEXR=OFF
|
||||
-DWITH_OPENJPEG=OFF
|
||||
-DWITH_QUIRC=OFF
|
||||
-DWITH_VTK=OFF
|
||||
-DWITH_JPEG=OFF
|
||||
-DWITH_WEBP=OFF
|
||||
-DENABLE_PRECOMPILED_HEADERS=OFF
|
||||
-DINSTALL_TESTS=OFF
|
||||
-DINSTALL_C_EXAMPLES=OFF
|
||||
-DINSTALL_PYTHON_EXAMPLES=OFF
|
||||
-DOPENCV_GENERATE_SETUPVARS=OFF
|
||||
-DOPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT=OFF
|
||||
-DBUILD_opencv_python2=OFF
|
||||
-DBUILD_opencv_python3=OFF
|
||||
-DWITH_OPENVINO=OFF
|
||||
-DWITH_INF_ENGINE=OFF
|
||||
-DWITH_NGRAPH=OFF
|
||||
-DBUILD_WITH_STATIC_CRT=OFF#set /MDd /MD
|
||||
-DBUILD_LIST=core,imgcodecs,imgproc,world
|
||||
-DBUILD_opencv_highgui=OFF
|
||||
-DWITH_ADE=OFF
|
||||
-DBUILD_opencv_world=ON
|
||||
-DWITH_PROTOBUF=OFF
|
||||
-DWITH_WIN32UI=OFF
|
||||
-DHAVE_WIN32UI=FALSE
|
||||
)
|
||||
|
||||
6
deps/OpenEXR/OpenEXR.cmake
vendored
6
deps/OpenEXR/OpenEXR.cmake
vendored
@@ -15,11 +15,11 @@ if (APPLE AND IS_CROSS_COMPILE)
|
||||
EXCLUDE_FROM_ALL ON
|
||||
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
|
||||
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
|
||||
INSTALL_DIR ${DESTDIR}
|
||||
INSTALL_DIR ${DESTDIR}/usr/local
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenEXR
|
||||
${_openxr_list_sep}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
@@ -54,4 +54,4 @@ endif()
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_OpenEXR)
|
||||
endif ()
|
||||
endif ()
|
||||
10
deps/OpenSSL/OpenSSL.cmake
vendored
10
deps/OpenSSL/OpenSSL.cmake
vendored
@@ -8,7 +8,7 @@ else()
|
||||
if(WIN32)
|
||||
set(_cross_arch "VC-WIN64A")
|
||||
elseif(APPLE)
|
||||
set(_cross_arch "darwin64-${CMAKE_OSX_ARCHITECTURES}-cc")
|
||||
set(_cross_arch "darwin64-arm64-cc")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -21,7 +21,7 @@ else()
|
||||
if(APPLE)
|
||||
set(_conf_cmd export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && ./Configure -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(_conf_cmd env "CC=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" "./config")
|
||||
set(_conf_cmd "./config")
|
||||
endif()
|
||||
set(_cross_comp_prefix_line "")
|
||||
set(_make_cmd make -j${NPROC})
|
||||
@@ -46,8 +46,8 @@ ExternalProject_Add(dep_OpenSSL
|
||||
# URL_HASH SHA256=8c776993154652d0bb393f506d850b811517c8bd8d24b1008aef57fbe55d3f31
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
|
||||
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
|
||||
"--openssldir=${DESTDIR}"
|
||||
"--prefix=${DESTDIR}"
|
||||
"--openssldir=${DESTDIR}/usr/local"
|
||||
"--prefix=${DESTDIR}/usr/local"
|
||||
${_cross_comp_prefix_line}
|
||||
no-shared
|
||||
no-asm
|
||||
@@ -61,6 +61,6 @@ ExternalProject_Add(dep_OpenSSL
|
||||
ExternalProject_Add_Step(dep_OpenSSL install_cmake_files
|
||||
DEPENDEES install
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory openssl "${DESTDIR}${CMAKE_INSTALL_LIBDIR}/cmake/openssl"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory openssl "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/openssl"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
|
||||
)
|
||||
|
||||
29
deps/OpenVDB/0001-clang19.patch
vendored
29
deps/OpenVDB/0001-clang19.patch
vendored
@@ -1,29 +0,0 @@
|
||||
--- a/openvdb/openvdb/tree/NodeManager.h 2023-11-01 20:31:11 UTC
|
||||
+++ b/openvdb/openvdb/tree/NodeManager.h
|
||||
@@ -327,7 +327,7 @@ class NodeList (private)
|
||||
void operator()(const NodeRange& range) const
|
||||
{
|
||||
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
|
||||
- OpT::template eval(mNodeOp, it);
|
||||
+ OpT::eval(mNodeOp, it);
|
||||
}
|
||||
}
|
||||
const NodeOp mNodeOp;
|
||||
@@ -347,7 +347,7 @@ class NodeList (private)
|
||||
void operator()(const NodeRange& range) const
|
||||
{
|
||||
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
|
||||
- OpT::template eval(mNodeOp, it);
|
||||
+ OpT::eval(mNodeOp, it);
|
||||
}
|
||||
}
|
||||
const NodeOp& mNodeOp;
|
||||
@@ -372,7 +372,7 @@ class NodeList (private)
|
||||
void operator()(const NodeRange& range)
|
||||
{
|
||||
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
|
||||
- OpT::template eval(*mNodeOp, it);
|
||||
+ OpT::eval(*mNodeOp, it);
|
||||
}
|
||||
}
|
||||
void join(const NodeReducer& other)
|
||||
5
deps/OpenVDB/OpenVDB.cmake
vendored
5
deps/OpenVDB/OpenVDB.cmake
vendored
@@ -6,15 +6,10 @@ else()
|
||||
set(_build_static ON)
|
||||
endif()
|
||||
|
||||
if (IN_GIT_REPO)
|
||||
set(OPENVDB_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenVDB-prefix/src/dep_OpenVDB)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(OpenVDB
|
||||
# support vs2022, update to 8.2
|
||||
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
|
||||
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
|
||||
PATCH_COMMAND git apply ${OPENVDB_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-clang19.patch
|
||||
DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
|
||||
29
deps/PNG/0002-clang19-macos.patch
vendored
29
deps/PNG/0002-clang19-macos.patch
vendored
@@ -1,29 +0,0 @@
|
||||
--- a/pngpriv.h 2025-04-20 19:36:04.000000000
|
||||
+++ b/pngpriv.h 2025-04-20 19:35:55.000000000
|
||||
@@ -511,24 +511,14 @@
|
||||
* DBL_DIG Maximum number of decimal digits (can be set to any constant)
|
||||
* DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
|
||||
* DBL_MAX Maximum floating point number (can be set to an arbitrary value)
|
||||
*/
|
||||
# include <float.h>
|
||||
|
||||
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
|
||||
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
|
||||
- /* We need to check that <math.h> hasn't already been included earlier
|
||||
- * as it seems it doesn't agree with <fp.h>, yet we should really use
|
||||
- * <fp.h> if possible.
|
||||
- */
|
||||
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
|
||||
-# include <fp.h>
|
||||
-# endif
|
||||
-# else
|
||||
-# include <math.h>
|
||||
-# endif
|
||||
+# include <math.h>
|
||||
+
|
||||
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
|
||||
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
|
||||
* MATH=68881
|
||||
*/
|
||||
# include <m68881.h>
|
||||
# endif
|
||||
4
deps/PNG/PNG.cmake
vendored
4
deps/PNG/PNG.cmake
vendored
@@ -12,7 +12,7 @@ if(APPLE AND IS_CROSS_COMPILE)
|
||||
GIT_TAG v1.6.35
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
|
||||
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
|
||||
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch
|
||||
CMAKE_ARGS
|
||||
-DPNG_SHARED=OFF
|
||||
-DPNG_STATIC=ON
|
||||
@@ -24,7 +24,7 @@ if(APPLE AND IS_CROSS_COMPILE)
|
||||
else ()
|
||||
set(_patch_step "")
|
||||
if (APPLE)
|
||||
set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch)
|
||||
set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
|
||||
endif ()
|
||||
orcaslicer_add_cmake_project(PNG
|
||||
# GIT_REPOSITORY https://github.com/glennrp/libpng.git
|
||||
|
||||
6
deps/Qhull/Qhull.cmake
vendored
6
deps/Qhull/Qhull.cmake
vendored
@@ -1,11 +1,11 @@
|
||||
include(GNUInstallDirs)
|
||||
orcaslicer_add_cmake_project(Qhull
|
||||
URL "https://github.com/qhull/qhull/archive/v8.0.2.zip"
|
||||
URL_HASH SHA256=a378e9a39e718e289102c20d45632f873bfdc58a7a5f924246ea4b176e185f1e
|
||||
URL "https://github.com/qhull/qhull/archive/v8.0.1.zip"
|
||||
URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
|
||||
CMAKE_ARGS
|
||||
-DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_Qhull)
|
||||
endif ()
|
||||
endif ()
|
||||
79
deps/TBB/GNU.cmake
vendored
79
deps/TBB/GNU.cmake
vendored
@@ -1,79 +0,0 @@
|
||||
# Copyright (c) 2020-2021 Intel Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if (MINGW)
|
||||
set(TBB_LINK_DEF_FILE_FLAG "")
|
||||
set(TBB_DEF_FILE_PREFIX "")
|
||||
elseif (APPLE)
|
||||
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
|
||||
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
|
||||
|
||||
# For correct ucontext.h structures layout
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -D_XOPEN_SOURCE)
|
||||
else()
|
||||
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
|
||||
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
|
||||
endif()
|
||||
|
||||
# Add -Wno-error=stringop-overflow to fix GCC 12+ build as suggested on https://github.com/oneapi-src/oneTBB/issues/843#issuecomment-1152646035
|
||||
set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors -Wno-error=stringop-overflow)
|
||||
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
|
||||
|
||||
# Depfile options (e.g. -MD) are inserted automatically in some cases.
|
||||
# Don't add -MMD to avoid conflicts in such cases.
|
||||
if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER)
|
||||
set(TBB_MMD_FLAG -MMD)
|
||||
endif()
|
||||
|
||||
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
|
||||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
|
||||
endif()
|
||||
|
||||
if (NOT MINGW)
|
||||
set(TBB_COMMON_LINK_LIBS dl)
|
||||
endif()
|
||||
|
||||
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
|
||||
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
tbb_remove_compile_flag(-Werror)
|
||||
endif()
|
||||
|
||||
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
|
||||
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
|
||||
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
|
||||
endif()
|
||||
|
||||
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
|
||||
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-mxgot>)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
|
||||
endif()
|
||||
|
||||
# For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
|
||||
if (NOT TBB_SANITIZE MATCHES "thread")
|
||||
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
|
||||
endif()
|
||||
|
||||
# Disable lto flag
|
||||
set(TBB_IPO_COMPILE_FLAGS "")
|
||||
set(TBB_IPO_LINK_FLAGS "")
|
||||
|
||||
# TBB malloc settings
|
||||
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
|
||||
set(TBB_OPENMP_FLAG -fopenmp)
|
||||
8
deps/TBB/TBB.cmake
vendored
8
deps/TBB/TBB.cmake
vendored
@@ -1,14 +1,8 @@
|
||||
if (FLATPAK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake ./cmake/compilers/GNU.cmake)
|
||||
else()
|
||||
set(_patch_command "")
|
||||
endif()
|
||||
|
||||
orcaslicer_add_cmake_project(
|
||||
TBB
|
||||
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
|
||||
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
|
||||
PATCH_COMMAND ${_patch_command}
|
||||
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch
|
||||
CMAKE_ARGS
|
||||
-DTBB_BUILD_SHARED=OFF
|
||||
-DTBB_BUILD_TESTS=OFF
|
||||
|
||||
32
deps/TIFF/TIFF.cmake
vendored
Normal file
32
deps/TIFF/TIFF.cmake
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
find_package(OpenGL QUIET REQUIRED)
|
||||
|
||||
if (APPLE)
|
||||
message(STATUS "Compiling TIFF for macos ${CMAKE_SYSTEM_VERSION}.")
|
||||
orcaslicer_add_cmake_project(TIFF
|
||||
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
|
||||
URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
|
||||
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
|
||||
CMAKE_ARGS
|
||||
-Dlzma:BOOL=OFF
|
||||
-Dwebp:BOOL=OFF
|
||||
-Djbig:BOOL=OFF
|
||||
-Dzstd:BOOL=OFF
|
||||
-Dpixarlog:BOOL=OFF
|
||||
)
|
||||
else()
|
||||
orcaslicer_add_cmake_project(TIFF
|
||||
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip
|
||||
URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32
|
||||
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
|
||||
CMAKE_ARGS
|
||||
-Dlzma:BOOL=OFF
|
||||
-Dwebp:BOOL=OFF
|
||||
-Djbig:BOOL=OFF
|
||||
-Dzstd:BOOL=OFF
|
||||
-Dpixarlog:BOOL=OFF
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
44441
deps/WebView2/include/WebView2.h
vendored
44441
deps/WebView2/include/WebView2.h
vendored
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user