Skip to content

Commit 1c29b7f

Browse files
author
remi durand
committed
fix build
1 parent 39c95d7 commit 1c29b7f

File tree

7 files changed

+46
-31
lines changed

7 files changed

+46
-31
lines changed

.github/workflows/ccpp_mac.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ jobs:
4848
run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
4949
- name: make SuperSlicer
5050
working-directory: ./build
51-
run: make SuperSlicer
51+
run: make Slic3r
52+
- name: ls build
53+
working-directory: ./build
54+
run: |
55+
ls -al src
56+
ls -al .
5257
- name: update Info.plist
5358
working-directory: ./build/src
5459
run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist
@@ -66,15 +71,15 @@ jobs:
6671
working-directory: ./build
6772
run: |
6873
cp -Rf ../resources pack/SuperSlicer/SuperSlicer.app/Contents/Resources
69-
cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/slic3r.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns
74+
cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/SuperSlicer.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/SuperSlicer.icns
7075
cp src/Info.date.plist pack/SuperSlicer/SuperSlicer.app/Contents/Info.plist
7176
echo -n -e 'APPL????\x0a' > PkgInfo
7277
cp PkgInfo pack/SuperSlicer/SuperSlicer.app/Contents/PkgInfo
7378
# echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
7479
- name: copy bin and do not let it lower case
7580
working-directory: ./build
7681
run: |
77-
cp -f src/SuperSlicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
82+
cp -f src/superslicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
7883
chmod u+x pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
7984
tar -cvf SuperSlicer.tar pack/SuperSlicer
8085
- name: create dmg

.github/workflows/ccpp_ubuntu.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: cmake .. -DCMAKE_PREFIX_PATH="/home/runner/work/SuperSlicer/SuperSlicer/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
5050
- name: make SuperSlicer
5151
working-directory: ./build
52-
run: make SuperSlicer
52+
run: make Slic3r
5353
- name: create directory and copy into it
5454
working-directory: ./build
5555
run: |
@@ -58,6 +58,11 @@ jobs:
5858
- name: copy resources
5959
working-directory: ./build
6060
run: cp -Rf ../resources package/resources
61+
- name: ls build
62+
working-directory: ./build
63+
run: |
64+
ls -al src
65+
ls -al .
6166
- name: copy bin
6267
working-directory: ./build
6368
run: cp -f src/superslicer package/bin/superslicer
@@ -75,8 +80,8 @@ jobs:
7580
- name: build appimage
7681
working-directory: ./build/package
7782
run: |
78-
chmod +x ../../src/platform/unix/build_appimage.sh
79-
../../src/platform/unix/build_appimage.sh SuperSlicer_ubu64.AppImage
83+
chmod +x ../build_appimage.sh
84+
../build_appimage.sh
8085
- name: Upload appimage
8186
uses: actions/[email protected]
8287
with:

CMakeLists.txt

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -514,21 +514,26 @@ if(SLIC3R_BUILD_TESTS)
514514
add_subdirectory(tests)
515515
endif()
516516

517+
if (NOT WIN32 AND NOT APPLE)
518+
configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh @ONLY)
519+
endif()
517520

518521
# Resources install target, configure fhs.hpp on UNIX
519522
if (WIN32)
520523
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
521524
elseif (SLIC3R_FHS)
522525
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
523-
set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/Slic3r")
526+
set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${SLIC3R_APP_KEY}")
524527
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${SLIC3R_FHS_RESOURCES}")
525-
install(FILES src/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
526-
install(FILES src/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
527-
install(FILES resources/icons/Slic3r_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME Slic3r.png)
528-
install(FILES resources/icons/PrusaSlicer-gcodeviewer_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME Slic3r-gcodeviewer.png)
528+
configure_file(${LIBDIR}/platform/unix/Slic3r.desktop.in ${LIBDIR_BIN}/${SLIC3R_APP_KEY}.desktop @ONLY)
529+
configure_file(${LIBDIR}/platform/unix/Gcodeviewer.desktop.in ${LIBDIR_BIN}/${SLIC3R_APP_KEY}-Gcodeviewer.desktop @ONLY)
530+
install(FILES ${LIBDIR_BIN}/${SLIC3R_APP_KEY}.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
531+
install(FILES ${LIBDIR_BIN}/${SLIC3R_APP_KEY}-Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications)
532+
install(FILES resources/icons/${SLIC3R_APP_KEY}_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME ${SLIC3R_APP_KEY}.png)
533+
install(FILES resources/icons/${SLIC3R_APP_KEY}-gcodeviewer_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME ${SLIC3R_APP_KEY}-gcodeviewer.png)
529534
else ()
530-
install(FILES src/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
531-
install(FILES src/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
535+
install(FILES ${LIBDIR}/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
536+
install(FILES ${LIBDIR}/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications)
532537
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
533538
endif ()
534539

@@ -537,27 +542,27 @@ configure_file(${LIBDIR}/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fh
537542
if (WIN32)
538543
else ()
539544
set(CPACK_GENERATOR "STGZ;TGZ;TZ")
540-
set(CPACK_NSIS_DISPLAY_NAME "Slic3r 2.0")
545+
set(CPACK_NSIS_DISPLAY_NAME "${SLIC3R_APP_NAME} ${SLIC3R_VERSION}")
541546
set(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/cmake/CPackConfig.cmake")
542547
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
543548
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
544-
set(CPACK_PACKAGE_EXECUTABLES "Slic3r")
545-
set(CPACK_PACKAGE_FILE_NAME "slic3r-2.0-Linux-x86_64")
546-
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Slic3r 2.0")
547-
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Slic3r 2.0.0")
548-
set(CPACK_PACKAGE_NAME "Slic3r")
549-
set(CPACK_PACKAGE_VENDOR "Slic3r")
550-
set(CPACK_PACKAGE_VERSION "2.0.0")
549+
set(CPACK_PACKAGE_EXECUTABLES "${SLIC3R_APP_CMD}")
550+
set(CPACK_PACKAGE_FILE_NAME "${SLIC3R_APP_KEY}-${SLIC3R_VERSION}-Linux-x86_64")
551+
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${SLIC3R_APP_KEY} ${SLIC3R_VERSION}")
552+
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${SLIC3R_BUILD_ID}")
553+
set(CPACK_PACKAGE_NAME "${SLIC3R_APP_KEY}")
554+
set(CPACK_PACKAGE_VENDOR "${SLIC3R_APP_NAME}")
555+
set(CPACK_PACKAGE_VERSION "${SLIC3R_VERSION_FULL}")
551556
set(CPACK_PACKAGE_VERSION_MAJOR "2")
552557
set(CPACK_PACKAGE_VERSION_MINOR "0")
553558
set(CPACK_PACKAGE_VERSION_PATCH "0")
554559
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
555560
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
556561
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
557562
set(CPACK_SOURCE_GENERATOR "TGZ;TZ")
558-
set(CPACK_SOURCE_PACKAGE_FILE_NAME "Slic3r-2.0.0")
563+
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${SLIC3R_APP_KEY}-${SLIC3R_VERSION_FULL}")
559564
set(CPACK_SOURCE_STRIP_FILES "")
560-
set(CPACK_STRIP_FILES "bin/Slic3r")
565+
set(CPACK_STRIP_FILES "bin/${SLIC3R_APP_CMD}")
561566
set(CPACK_SYSTEM_NAME "Linux-x86_64")
562567
set(CPACK_TOPLEVEL_TAG "Linux-x86_64")
563568
endif()

src/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ if (MINGW)
107107
set_target_properties(Slic3r PROPERTIES PREFIX "")
108108
endif (MINGW)
109109

110-
if (NOT WIN32 AND NOT APPLE)
110+
if (NOT WIN32)
111111
# Binary name on unix like systems (Linux, Unix)
112-
set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "Slic3r")
112+
set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "${SLIC3R_APP_CMD}")
113113
endif ()
114114

115115
target_link_libraries(Slic3r libslic3r cereal)
@@ -160,7 +160,7 @@ if (WIN32)
160160
endif()
161161
target_compile_definitions(Slic3r_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE)
162162
add_dependencies(Slic3r_app_gui Slic3r)
163-
set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME "slic3r")
163+
set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME ${SLIC3R_APP_CMD})
164164
target_link_libraries(Slic3r_app_gui PRIVATE boost_headeronly)
165165

166166
add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc)
@@ -224,7 +224,7 @@ else ()
224224
COMMAND ln -sf Slic3r prusa-gcodeviewer
225225
COMMAND ln -sf Slic3r PrusaGCodeViewer
226226
WORKING_DIRECTORY "$<TARGET_FILE_DIR:Slic3r>"
227-
COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and prusa-gcodeviewer"
227+
COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and gcodeviewer"
228228
VERBATIM)
229229
else ()
230230
add_custom_command(TARGET Slic3r POST_BUILD

src/platform/msw/gcodeviewer.rc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
2222
}
2323
}
2424
2 ICON "@SLIC3R_RESOURCES_DIR@/icons/PrusaSlicer-gcodeviewer.ico"
25-
1 24 "Slic3r.manifest"
25+
1 24 "@SLIC3R_APP_KEY@.manifest"

src/platform/unix/Slic3r.desktop.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Desktop Entry]
2-
Name=@SLIC3R_APP_KEY@
2+
Name=@SLIC3R_APP_NAME@
33
GenericName=3D Printing Software
44
Comment=G-code generator for 3D printers
55
Icon=@SLIC3R_APP_KEY@

src/platform/unix/build_appimage.sh.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
APPIMAGETOOLURL="https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage"
33

44

5-
APP_IMAGE=$1
5+
APP_IMAGE="@SLIC3R_APP_KEY@_@SLIC3R_VERSION_FULL@_ubu64.AppImage"
66

77
wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage
88
chmod +x ../appimagetool.AppImage
@@ -24,5 +24,5 @@ EOF
2424

2525

2626
../appimagetool.AppImage .
27-
mv Slic3r-x86_64.AppImage ${APP_IMAGE}
27+
mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE}
2828
chmod +x ${APP_IMAGE}

0 commit comments

Comments
 (0)