OrcaSlicer/build_release.bat
Ocraftyone 026499c5b7
Better CMake Defaults (#10294)
* Auto generate CMAKE_PREFIX_PATH/DESTDIR

* Auto set CMAKE_INSTALL_PREFIX

* Always default SLIC3R_STATIC to on

* Only allow one value for CMAKE_OSX_ARCHITECTURES

* Set arch for OpenSSL from CMAKE_OSX_ARCHITECTURES

* Set CMAKE_INSTALL_RPATH from CMAKE_PREFIX_PATH

* Default CMAKE_MACOSX_RPATH and CMAKE_MACOSX_BUNDLE to on

* Auto set BBL_RELEASE_TO_PUBLIC based on build config

* Default to GTK 3

* Fix linux debug build

Update find modules to also look for the debug variant of the libraries

* Set DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO based on CMAKE_BUILD_TYPE

* Add a fallback value for Windows SDK if the env variables are not set

* Reflect CMake changes in the build scripts

* Add missing line

* Fix auto setting DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO

* Update dep folder name for linux in GH actions

* Invert dep-folder-name conditions

`''` is considered a falsy value, which was causing the value to always be set to 'OrcaSlicer_dep'

* Properly handle finding the debug version of libnoise

* Convert FindNLopt.cmake to a config mode wrapper

* Use separate build directory for debug builds on Linux

* Move find_package for libnoise

* Cleanup and improve linux build script

- Add dry run
- Add build in RelWithDebInfo
- Add function to print and run commands

* Remove linux destdir deprecation and cleanup

* Fix flatpak build

* Disable fail fast for flatpak builds

* Flatpak improvements

- Build wxWidgets using deps cmake
- Improve handling of space freeing commands while building deps
- Allow cmake to directly download deps
- Set needed flags within cmake instead of the build manifest

* Print clean build commands

* Implement shellcheck recommendations

* Cleanup

* Fix CMakeLists.txt syntax by replacing empty elseif with else statement

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-10-25 22:05:09 +08:00

52 lines
1.4 KiB
Batchfile

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%
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
if "%1"=="deps" exit /b 0
:slicer
echo "building Orca Slicer..."
cd %WP%
mkdir %build_dir%
cd %build_dir%
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
cd ..
call scripts/run_gettext.bat
cd %build_dir%
cmake --build . --target install --config %build_type%