From 1c29b7f54171342b241f74747d6064d497bacc8a Mon Sep 17 00:00:00 2001 From: remi durand Date: Mon, 12 Apr 2021 21:37:05 +0200 Subject: [PATCH] fix build --- .github/workflows/ccpp_mac.yml | 11 ++++++-- .github/workflows/ccpp_ubuntu.yml | 11 ++++++-- CMakeLists.txt | 39 +++++++++++++++----------- src/CMakeLists.txt | 8 +++--- src/platform/msw/gcodeviewer.rc.in | 2 +- src/platform/unix/Slic3r.desktop.in | 2 +- src/platform/unix/build_appimage.sh.in | 4 +-- 7 files changed, 46 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ccpp_mac.yml b/.github/workflows/ccpp_mac.yml index 27f8f7a0b72..b6da11579ea 100644 --- a/.github/workflows/ccpp_mac.yml +++ b/.github/workflows/ccpp_mac.yml @@ -48,7 +48,12 @@ jobs: run: cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1 - name: make SuperSlicer working-directory: ./build - run: make SuperSlicer + run: make Slic3r + - name: ls build + working-directory: ./build + run: | + ls -al src + ls -al . - name: update Info.plist working-directory: ./build/src run: sed "s/+UNKNOWN/_$(date '+%F')/" Info.plist >Info.date.plist @@ -66,7 +71,7 @@ jobs: working-directory: ./build run: | cp -Rf ../resources pack/SuperSlicer/SuperSlicer.app/Contents/Resources - cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/slic3r.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/Slic3r.icns + cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/SuperSlicer.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/SuperSlicer.icns cp src/Info.date.plist pack/SuperSlicer/SuperSlicer.app/Contents/Info.plist echo -n -e 'APPL????\x0a' > PkgInfo cp PkgInfo pack/SuperSlicer/SuperSlicer.app/Contents/PkgInfo @@ -74,7 +79,7 @@ jobs: - name: copy bin and do not let it lower case working-directory: ./build run: | - cp -f src/SuperSlicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer + cp -f src/superslicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer chmod u+x pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer tar -cvf SuperSlicer.tar pack/SuperSlicer - name: create dmg diff --git a/.github/workflows/ccpp_ubuntu.yml b/.github/workflows/ccpp_ubuntu.yml index be018a1e923..5411fc113c7 100644 --- a/.github/workflows/ccpp_ubuntu.yml +++ b/.github/workflows/ccpp_ubuntu.yml @@ -49,7 +49,7 @@ jobs: run: cmake .. -DCMAKE_PREFIX_PATH="/home/runner/work/SuperSlicer/SuperSlicer/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 - name: make SuperSlicer working-directory: ./build - run: make SuperSlicer + run: make Slic3r - name: create directory and copy into it working-directory: ./build run: | @@ -58,6 +58,11 @@ jobs: - name: copy resources working-directory: ./build run: cp -Rf ../resources package/resources + - name: ls build + working-directory: ./build + run: | + ls -al src + ls -al . - name: copy bin working-directory: ./build run: cp -f src/superslicer package/bin/superslicer @@ -75,8 +80,8 @@ jobs: - name: build appimage working-directory: ./build/package run: | - chmod +x ../../src/platform/unix/build_appimage.sh - ../../src/platform/unix/build_appimage.sh SuperSlicer_ubu64.AppImage + chmod +x ../build_appimage.sh + ../build_appimage.sh - name: Upload appimage uses: actions/upload-artifact@v1.0.0 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index b405bcce96f..0e622aeff31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -514,21 +514,26 @@ if(SLIC3R_BUILD_TESTS) add_subdirectory(tests) endif() +if (NOT WIN32 AND NOT APPLE) + configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh @ONLY) +endif() # Resources install target, configure fhs.hpp on UNIX if (WIN32) install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources") elseif (SLIC3R_FHS) # CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share) - set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/Slic3r") + set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${SLIC3R_APP_KEY}") install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${SLIC3R_FHS_RESOURCES}") - install(FILES src/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications) - install(FILES src/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications) - install(FILES resources/icons/Slic3r_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME Slic3r.png) - install(FILES resources/icons/PrusaSlicer-gcodeviewer_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME Slic3r-gcodeviewer.png) + configure_file(${LIBDIR}/platform/unix/Slic3r.desktop.in ${LIBDIR_BIN}/${SLIC3R_APP_KEY}.desktop @ONLY) + configure_file(${LIBDIR}/platform/unix/Gcodeviewer.desktop.in ${LIBDIR_BIN}/${SLIC3R_APP_KEY}-Gcodeviewer.desktop @ONLY) + install(FILES ${LIBDIR_BIN}/${SLIC3R_APP_KEY}.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications) + install(FILES ${LIBDIR_BIN}/${SLIC3R_APP_KEY}-Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications) + install(FILES resources/icons/${SLIC3R_APP_KEY}_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME ${SLIC3R_APP_KEY}.png) + install(FILES resources/icons/${SLIC3R_APP_KEY}-gcodeviewer_192px.png DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps RENAME ${SLIC3R_APP_KEY}-gcodeviewer.png) else () - install(FILES src/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) - install(FILES src/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) + install(FILES ${LIBDIR}/platform/unix/Slic3r.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) + install(FILES ${LIBDIR}/platform/unix/Gcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources") endif () @@ -537,17 +542,17 @@ configure_file(${LIBDIR}/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fh if (WIN32) else () set(CPACK_GENERATOR "STGZ;TGZ;TZ") - set(CPACK_NSIS_DISPLAY_NAME "Slic3r 2.0") + set(CPACK_NSIS_DISPLAY_NAME "${SLIC3R_APP_NAME} ${SLIC3R_VERSION}") set(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/cmake/CPackConfig.cmake") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") - set(CPACK_PACKAGE_EXECUTABLES "Slic3r") - set(CPACK_PACKAGE_FILE_NAME "slic3r-2.0-Linux-x86_64") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "Slic3r 2.0") - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Slic3r 2.0.0") - set(CPACK_PACKAGE_NAME "Slic3r") - set(CPACK_PACKAGE_VENDOR "Slic3r") - set(CPACK_PACKAGE_VERSION "2.0.0") + set(CPACK_PACKAGE_EXECUTABLES "${SLIC3R_APP_CMD}") + set(CPACK_PACKAGE_FILE_NAME "${SLIC3R_APP_KEY}-${SLIC3R_VERSION}-Linux-x86_64") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${SLIC3R_APP_KEY} ${SLIC3R_VERSION}") + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${SLIC3R_BUILD_ID}") + set(CPACK_PACKAGE_NAME "${SLIC3R_APP_KEY}") + set(CPACK_PACKAGE_VENDOR "${SLIC3R_APP_NAME}") + set(CPACK_PACKAGE_VERSION "${SLIC3R_VERSION_FULL}") set(CPACK_PACKAGE_VERSION_MAJOR "2") set(CPACK_PACKAGE_VERSION_MINOR "0") set(CPACK_PACKAGE_VERSION_PATCH "0") @@ -555,9 +560,9 @@ else () set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_SOURCE_GENERATOR "TGZ;TZ") - set(CPACK_SOURCE_PACKAGE_FILE_NAME "Slic3r-2.0.0") + set(CPACK_SOURCE_PACKAGE_FILE_NAME "${SLIC3R_APP_KEY}-${SLIC3R_VERSION_FULL}") set(CPACK_SOURCE_STRIP_FILES "") - set(CPACK_STRIP_FILES "bin/Slic3r") + set(CPACK_STRIP_FILES "bin/${SLIC3R_APP_CMD}") set(CPACK_SYSTEM_NAME "Linux-x86_64") set(CPACK_TOPLEVEL_TAG "Linux-x86_64") endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0e37ef7d342..427a2534683 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -107,9 +107,9 @@ if (MINGW) set_target_properties(Slic3r PROPERTIES PREFIX "") endif (MINGW) -if (NOT WIN32 AND NOT APPLE) +if (NOT WIN32) # Binary name on unix like systems (Linux, Unix) - set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "Slic3r") + set_target_properties(Slic3r PROPERTIES OUTPUT_NAME "${SLIC3R_APP_CMD}") endif () target_link_libraries(Slic3r libslic3r cereal) @@ -160,7 +160,7 @@ if (WIN32) endif() target_compile_definitions(Slic3r_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE) add_dependencies(Slic3r_app_gui Slic3r) - set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME "slic3r") + set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME ${SLIC3R_APP_CMD}) target_link_libraries(Slic3r_app_gui PRIVATE boost_headeronly) add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc) @@ -224,7 +224,7 @@ else () COMMAND ln -sf Slic3r prusa-gcodeviewer COMMAND ln -sf Slic3r PrusaGCodeViewer WORKING_DIRECTORY "$" - COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and prusa-gcodeviewer" + COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and gcodeviewer" VERBATIM) else () add_custom_command(TARGET Slic3r POST_BUILD diff --git a/src/platform/msw/gcodeviewer.rc.in b/src/platform/msw/gcodeviewer.rc.in index e535e043ba6..272e8a6fda9 100644 --- a/src/platform/msw/gcodeviewer.rc.in +++ b/src/platform/msw/gcodeviewer.rc.in @@ -22,4 +22,4 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@ } } 2 ICON "@SLIC3R_RESOURCES_DIR@/icons/PrusaSlicer-gcodeviewer.ico" -1 24 "Slic3r.manifest" +1 24 "@SLIC3R_APP_KEY@.manifest" diff --git a/src/platform/unix/Slic3r.desktop.in b/src/platform/unix/Slic3r.desktop.in index f61a779bbc3..d3b59ea84af 100644 --- a/src/platform/unix/Slic3r.desktop.in +++ b/src/platform/unix/Slic3r.desktop.in @@ -1,5 +1,5 @@ [Desktop Entry] -Name=@SLIC3R_APP_KEY@ +Name=@SLIC3R_APP_NAME@ GenericName=3D Printing Software Comment=G-code generator for 3D printers Icon=@SLIC3R_APP_KEY@ diff --git a/src/platform/unix/build_appimage.sh.in b/src/platform/unix/build_appimage.sh.in index 90583e760d8..7572579eb4d 100644 --- a/src/platform/unix/build_appimage.sh.in +++ b/src/platform/unix/build_appimage.sh.in @@ -2,7 +2,7 @@ APPIMAGETOOLURL="https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage" -APP_IMAGE=$1 +APP_IMAGE="@SLIC3R_APP_KEY@_@SLIC3R_VERSION_FULL@_ubu64.AppImage" wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage chmod +x ../appimagetool.AppImage @@ -24,5 +24,5 @@ EOF ../appimagetool.AppImage . -mv Slic3r-x86_64.AppImage ${APP_IMAGE} +mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE} chmod +x ${APP_IMAGE}