Skip to content

Commit e9846ef

Browse files
author
Jonas Heinle
committed
adapted template
1 parent c185f8f commit e9846ef

File tree

4 files changed

+54
-72
lines changed

4 files changed

+54
-72
lines changed

.github/workflows/linux_run.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323

2424
env:
2525
BUILD_TYPE: Debug
26+
BUILD_DIR_RELEASE: build_release
2627

2728
steps:
2829
- uses: actions/[email protected]
@@ -172,25 +173,25 @@ jobs:
172173
- name: Configure CMake for Release (Clang only)
173174
if: ${{ inputs.compiler == 'clang' }}
174175
run: |
175-
cmake -B build-release --preset linux-release-clang
176+
cmake -B ${{ env.BUILD_DIR_RELEASE }} --preset linux-release-clang
176177
177178
- name: Build Release (Clang only)
178179
if: ${{ inputs.compiler == 'clang' }}
179180
run: |
180181
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
181-
cmake --build build-release --config linux-release-clang
182+
cmake --build ${{ env.BUILD_DIR_RELEASE }} --config linux-release-clang
182183
183184
- name: Package (Clang only)
184185
if: ${{ inputs.compiler == 'clang' }}
185186
run: |
186-
cmake --build build-release --target package
187+
cmake --build ${{ env.BUILD_DIR_RELEASE }} --target package
187188
188189
- name: Upload Linux Packages (Clang only)
189190
if: ${{ inputs.compiler == 'clang' }}
190191
uses: actions/[email protected]
191192
with:
192193
name: linux-packages
193194
path: |
194-
build-release/*.tar.gz
195-
build-release/*.tgz
196-
build-release/*.deb
195+
${{ env.BUILD_DIR_RELEASE }}/*.tar.gz
196+
${{ env.BUILD_DIR_RELEASE }}/*.tgz
197+
${{ env.BUILD_DIR_RELEASE }}/*.deb

CMakePresets.json

Lines changed: 30 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"CMAKE_C_COMPILER": "clang",
6464
"CMAKE_CXX_COMPILER": "clang++",
6565
"RUST_FEATURES": "ON",
66-
"COMPILER_CACHE": "sccache"
66+
"COMPILER_CACHE": "sccache",
67+
"BUILD_TESTING": "FALSE"
6768
},
6869
"condition": {
6970
"type": "equals",
@@ -84,7 +85,8 @@
8485
"CMAKE_C_COMPILER": "clang",
8586
"CMAKE_CXX_COMPILER": "clang++",
8687
"RUST_FEATURES": "ON",
87-
"COMPILER_CACHE": "sccache"
88+
"COMPILER_CACHE": "sccache",
89+
"BUILD_TESTING": "FALSE"
8890
},
8991
"condition": {
9092
"type": "equals",
@@ -149,7 +151,8 @@
149151
"RUST_FEATURES": "ON",
150152
"CMAKE_C_COMPILER": "gcc",
151153
"CMAKE_CXX_COMPILER": "g++",
152-
"COMPILER_CACHE": "sccache"
154+
"COMPILER_CACHE": "sccache",
155+
"BUILD_TESTING": "FALSE"
153156
},
154157
"condition": {
155158
"type": "equals",
@@ -170,7 +173,8 @@
170173
"CMAKE_BUILD_TYPE": "Release",
171174
"CMAKE_C_COMPILER": "gcc",
172175
"CMAKE_CXX_COMPILER": "g++",
173-
"COMPILER_CACHE": "sccache"
176+
"COMPILER_CACHE": "sccache",
177+
"BUILD_TESTING": "FALSE"
174178
},
175179
"condition": {
176180
"type": "equals",
@@ -215,7 +219,8 @@
215219
"CMAKE_CXX_COMPILER": "cl",
216220
"RUST_FEATURES": "ON",
217221
"CMAKE_BUILD_TYPE": "Release",
218-
"COMPILER_CACHE": "sccache"
222+
"COMPILER_CACHE": "sccache",
223+
"BUILD_TESTING": "FALSE"
219224
},
220225
"condition": {
221226
"type": "equals",
@@ -239,7 +244,8 @@
239244
"CMAKE_CXX_COMPILER": "clang-cl",
240245
"RUST_FEATURES": "ON",
241246
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
242-
"COMPILER_CACHE": "sccache"
247+
"COMPILER_CACHE": "sccache",
248+
"BUILD_TESTING": "FALSE"
243249
},
244250
"condition": {
245251
"type": "equals",
@@ -280,7 +286,8 @@
280286
"CMAKE_CXX_COMPILER": "clang-cl",
281287
"RUST_FEATURES": "ON",
282288
"CMAKE_BUILD_TYPE": "Release",
283-
"COMPILER_CACHE": "sccache"
289+
"COMPILER_CACHE": "sccache",
290+
"BUILD_TESTING": "FALSE"
284291
},
285292
"condition": {
286293
"type": "equals",
@@ -300,17 +307,13 @@
300307
"CMAKE_CXX_COMPILER": "C:/Program Files/LLVM/bin/clang++.exe",
301308
"RUST_FEATURES": "OFF",
302309
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
303-
"COMPILER_CACHE": "sccache"
310+
"COMPILER_CACHE": "sccache",
311+
"BUILD_TESTING": "FALSE"
304312
},
305313
"condition": {
306314
"type": "equals",
307315
"lhs": "${hostSystemName}",
308316
"rhs": "Windows"
309-
},
310-
"vendor": {
311-
"microsoft.com/VisualStudioSettings/CMake/1.0": {
312-
"intelliSenseMode": "windows-clang-x64"
313-
}
314317
}
315318
},
316319
{
@@ -332,11 +335,6 @@
332335
"type": "equals",
333336
"lhs": "${hostSystemName}",
334337
"rhs": "Windows"
335-
},
336-
"vendor": {
337-
"microsoft.com/VisualStudioSettings/CMake/1.0": {
338-
"intelliSenseMode": "windows-clang-x64"
339-
}
340338
}
341339
},
342340
{
@@ -351,7 +349,8 @@
351349
"CMAKE_CXX_COMPILER": "C:/Program Files/LLVM/bin/clang++.exe",
352350
"RUST_FEATURES": "OFF",
353351
"CMAKE_BUILD_TYPE": "Release",
354-
"COMPILER_CACHE": "sccache"
352+
"COMPILER_CACHE": "sccache",
353+
"BUILD_TESTING": "FALSE"
355354
},
356355
"condition": {
357356
"type": "equals",
@@ -389,37 +388,6 @@
389388
"intelliSenseMode": "windows-clang-x64"
390389
}
391390
}
392-
},
393-
{
394-
"name": "x64-Clang-Windows-CI",
395-
"description": "Windows and Clang",
396-
"generator": "Visual Studio 17 2022",
397-
"binaryDir": "${sourceDir}/build/",
398-
"installDir": "${sourceDir}/build/",
399-
"cacheVariables": {
400-
"CMAKE_VERBOSE_MAKEFILE": "ON",
401-
"CMAKE_C_COMPILER": "clang-cl",
402-
"CMAKE_CXX_COMPILER": "clang-cl",
403-
"RUST_FEATURES": "OFF",
404-
"WINDOWS_CI": "ON",
405-
"COMPILER_CACHE": "sccache",
406-
"BUILD_TESTING": "TRUE"
407-
},
408-
"toolset": "ClangCL",
409-
"condition": {
410-
"type": "equals",
411-
"lhs": "${hostSystemName}",
412-
"rhs": "Windows"
413-
},
414-
"architecture": {
415-
"value": "x64",
416-
"strategy": "set"
417-
},
418-
"vendor": {
419-
"microsoft.com/VisualStudioSettings/CMake/1.0": {
420-
"intelliSenseMode": "windows-clang-x64"
421-
}
422-
}
423391
}
424392
],
425393
"buildPresets": [
@@ -443,36 +411,36 @@
443411
"jobs": 0,
444412
"configurePreset": "linux-profile-clang"
445413
},
446-
{
414+
{
447415
"name": "x64-MSVC-Windows-Debug",
448416
"jobs": 0,
449417
"configurePreset": "x64-MSVC-Windows-Debug",
450-
"configuration": "Debug"
418+
"configuration": "Debug"
451419
},
452-
{
420+
{
453421
"name": "x64-MSVC-Windows-Release",
454422
"jobs": 0,
455423
"configurePreset": "x64-MSVC-Windows-Release",
456-
"configuration": "Release"
424+
"configuration": "Release"
457425
},
458-
{
426+
{
459427
"name": "x64-Clang-Windows-Debug",
460428
"jobs": 0,
461429
"configurePreset": "x64-Clang-Windows-Debug",
462-
"configuration": "Debug"
430+
"configuration": "Debug"
463431
},
464-
{
432+
{
465433
"name": "x64-Clang-Windows-Release",
466434
"jobs": 0,
467435
"configurePreset": "x64-Clang-Windows-Release",
468-
"configuration": "Release"
469-
},
470-
{
436+
"configuration": "Release"
437+
},
438+
{
471439
"name": "x64-ClangCL-Windows-Release",
472440
"jobs": 0,
473441
"configurePreset": "x64-ClangCL-Windows-Release",
474-
"configuration": "Release"
475-
}
442+
"configuration": "Release"
443+
}
476444
],
477445
"testPresets": [
478446
{

cmake/CPackOptions.cmake

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set(CPACK_PACKAGE_HOMEPAGE_URL "${CMAKE_PROJECT_HOMEPAGE_URL}")
3232
# There is a bug in NSI that does not handle full UNIX paths properly.
3333
# Make sure there is at least one set of four backlashes.
3434
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Packaging-With-CPack
35-
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/images\\\\Engine_logo.bmp)
35+
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/images/Engine_logo.bmp)
3636
set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_CURRENT_SOURCE_DIR}/docs/packaging/WelcomeFile.txt)
3737
# try to use all cores
3838
set(CPACK_THREADS 0)
@@ -47,8 +47,8 @@ if(WIN32)
4747
set(CPACK_SOURCE_GENERATOR "ZIP")
4848

4949
# Gemeinsame Einstellungen für NSIS
50-
set(CPACK_NSIS_WELCOME_TITLE "Get ready for epic graphics.")
51-
set(CPACK_NSIS_FINISH_TITLE "Now you are ready to render :)")
50+
set(CPACK_NSIS_WELCOME_TITLE "Get ready for epic CMake template functionality.")
51+
set(CPACK_NSIS_FINISH_TITLE "Now you are ready to boost your project :)")
5252
set(CPACK_NSIS_MUI_HEADERIMAGE ${CMAKE_CURRENT_SOURCE_DIR}/images/Engine_logo.bmp)
5353
set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP ${CMAKE_CURRENT_SOURCE_DIR}/images/Engine_logo.bmp)
5454
set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP ${CMAKE_CURRENT_SOURCE_DIR}/images/Engine_logo.bmp)
@@ -65,13 +65,26 @@ if(WIN32)
6565
set(CPACK_NSIS_MUI_ICON ${CMAKE_CURRENT_SOURCE_DIR}/images/faviconNew.ico)
6666
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
6767
set(CPACK_NSIS_MODIFY_PATH "ON")
68+
69+
# Optional: If you need more control over the desktop shortcut, you can use custom NSIS commands
70+
# This ensures the shortcut has the correct working directory
71+
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
72+
SetOutPath \\\"$INSTDIR\\\\bin\\\"
73+
CreateShortCut \\\"$DESKTOP\\\\${PROJECT_NAME}.lnk\\\" \\\"$INSTDIR\\\\bin\\\\${PROJECT_NAME}.exe\\\" \\\"\\\" \\\"$INSTDIR\\\\bin\\\\${PROJECT_NAME}.exe\\\" 0 SW_SHOWNORMAL \\\"\\\" \\\"${PROJECT_NAME}\\\"
74+
")
75+
76+
# Optional: Remove the desktop shortcut on uninstall
77+
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
78+
Delete \\\"$DESKTOP\\\\${PROJECT_NAME}.lnk\\\"
79+
")
6880

6981
# WiX spezifische Einstellungen
7082
# WICHTIG: Diese Upgrade GUID MUSS STABIL BLEIBEN, sonst funktionieren Upgrades/Deinstallationen nicht korrekt.
7183
# Falls bereits ein Wert existiert, NICHT ändern. Bei erstmaliger Einführung einmalig generieren.
7284
set(CPACK_WIX_UPGRADE_GUID "A8B86F5E-5B3E-4C38-9D7F-4F4923F9E5C2")
7385
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_SOURCE_DIR}/images/faviconNew.ico)
7486
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${PROJECT_NAME}")
87+
set(CPACK_WIX_USE_LONG_FILE_NAMES ON)
7588
# Optional eigenes Banner/Logo (muss BMP 493x58 bzw. 493x312 sein, wenn gesetzt)
7689
# set(CPACK_WIX_UI_BANNER ${CMAKE_CURRENT_SOURCE_DIR}/images/your_banner.bmp)
7790
# set(CPACK_WIX_UI_DIALOG ${CMAKE_CURRENT_SOURCE_DIR}/images/your_dialog.bmp)

scripts/windows/setup_dependencies.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ winget install --accept-source-agreements --accept-package-agreements --id=Ccach
2020
Write-Host "Installing CMake, Cppcheck and NSIS via winget..."
2121
winget install --accept-source-agreements --accept-package-agreements cmake cppcheck nsis
2222
# also get wix
23-
winget install --accept-source-agreements --accept-package-agreements WiXToolset.WiXToolset
23+
winget install --accept-source-agreements --accept-package-agreements WiXToolset.WiXToolset -e
2424

2525
# Add NSIS to PATH (in case it's under Program Files (x86))
2626
$nsisPath = 'C:\Program Files (x86)\NSIS'

0 commit comments

Comments
 (0)