diff --git a/cmake/packaging/LAMMPS_DMG_Setup.scpt b/cmake/packaging/LAMMPS_DMG_Setup.scpt deleted file mode 100644 index b3da5bd094..0000000000 --- a/cmake/packaging/LAMMPS_DMG_Setup.scpt +++ /dev/null @@ -1,58 +0,0 @@ -on run argv - set image_name to item 1 of argv - - tell application "Finder" - tell disk image_name - - -- wait for the image to finish mounting - set open_attempts to 0 - repeat while open_attempts < 4 - try - open - delay 1 - set open_attempts to 5 - close - on error errStr number errorNumber - set open_attempts to open_attempts + 1 - delay 10 - end try - end repeat - delay 5 - - -- open the image the first time and save a DS_Store with just - -- background and icon setup - open - set current view of container window to icon view - set theViewOptions to the icon view options of container window - set background picture of theViewOptions to file ".background:background.png" - set arrangement of theViewOptions to not arranged - set icon size of theViewOptions to 64 - delay 5 - close - - -- next setup the position of the app and Applications symlink - -- plus hide all the window decoration - open - update without registering applications - tell container window - set sidebar width to 0 - set statusbar visible to false - set toolbar visible to false - set the bounds to { 100, 40, 868, 640 } - set position of item "LAMMPS" to { 190, 216 } - set position of item "Applications" to { 576, 216 } - set position of item "README.txt" to { 190, 400 } - end tell - update without registering applications - delay 5 - close - - -- one last open and close so you can see everything looks correct - open - delay 5 - close - - end tell - delay 1 -end tell -end run diff --git a/cmake/packaging/build-macos-dmg-with-gui.sh b/cmake/packaging/build_macos_dmg.sh similarity index 100% rename from cmake/packaging/build-macos-dmg-with-gui.sh rename to cmake/packaging/build_macos_dmg.sh diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index 6fe256a3c7..2e889f52ec 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -817,42 +817,44 @@ macOS """"" When building on macOS, the build procedure will try to manufacture a -drag-n-drop installer, LAMMPS-macOS-multiarch.dmg. To build multi-arch -executables that will run on both, arm64 and x86_64 architectures -natively, it is necessary to set the CMake variable -``-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64``. To achieve wide compatibility -with different macOS versions, you can also set -``-D CMAKE_OSX_DEPLOYMENT_TARGET=11.0`` which will set compatibility to macOS +drag-n-drop installer, LAMMPS-macOS-multiarch.dmg, when using the 'dmg' +target (i.e. `cmake --build --target dmg` or `make dmg`. + +To build multi-arch executables that will run on both, arm64 and x86_64 +architectures natively, it is necessary to set the CMake variable ``-D +CMAKE_OSX_ARCHITECTURES=arm64;x86_64``. To achieve wide compatibility +with different macOS versions, you can also set ``-D +CMAKE_OSX_DEPLOYMENT_TARGET=11.0`` which will set compatibility to macOS 11 (Big Sur) and later, even if you are compiling on a more recent macOS version. -On macOS, compiling the LAMMPS GUI will automatically create a -custom application bundle with a drag-n-drop installer in a .dmg file. - Windows """"""" -On Windows currently only compilation from within Visual Studio 2022 is supported -and tested. Compilation via CMake and Ninja is required. Qt needs to be installed, -by preference downloaded from https://www.qt.io, into the ``C:\\Qt`` folder. -There is a custom `x64-GUI-MSVC` build configuration provided that will activate -building the `lammps-gui.exe` executable in addition to LAMMPS. When requesting -an installation from the `Build` menu, it will create a compressed zip file -with the executables and required dependent .dll files. This zip file can be -uncompressed and ``lammps-gui.exe`` run directly from there. The uncompressed -folder can be added to the ``PATH`` environment and LAMMPS and LAMMPS GUI can -be launched from anywhere from the command line. +On Windows currently only compilation from within Visual Studio 2022 is +supported and tested. Using CMake and Ninja as build system is +required. Qt needs to be installed, tested was a package downloaded from +https://www.qt.io, into the ``C:\\Qt`` folder. There is a custom +`x64-GUI-MSVC` build configuration provided that will activate building +the `lammps-gui.exe` executable in addition to LAMMPS. When requesting +an installation from the `Build` menu, it will create a compressed zip +file with the executables and required dependent .dll files. This zip +file can be uncompressed and ``lammps-gui.exe`` run directly from there. +The uncompressed folder can be added to the ``PATH`` environment and +LAMMPS and LAMMPS GUI can be launched from anywhere from the command +line. Linux """"" Version 5.12 or later of the Qt library and CMake version 3.16 are -required and those are provided by, e.g., Ubuntu 20.04LTS. Thus older +required and those are provided by, e.g., Ubuntu 20.04LTS. Thus older Linux distributions are not likely to be supported, while more recent ones will work, even for pre-compiled executables (see above). After -compiling with ``cmake --build ``, the script -``cmake/packaging/build-linux-tar.sh`` needs to be run to build a tar.gz -file with the executables and their support libraries. +compiling with ``cmake --build ``, use +``cmake --build --target tgz`` or ``make tgz`` to build +a ``LAMMPS-Linux-amd64.tar.gz`` file with the executables and their +support libraries. ---------- diff --git a/tools/lammps-gui/CMakeLists.txt b/tools/lammps-gui/CMakeLists.txt index a716770126..fb0b9ad0e8 100644 --- a/tools/lammps-gui/CMakeLists.txt +++ b/tools/lammps-gui/CMakeLists.txt @@ -122,7 +122,7 @@ if(APPLE) ) # additional steps to populate the bundle tree and create the .dmg image file set(APP_CONTENTS ${CMAKE_BINARY_DIR}/lammps-gui.app/Contents) - add_custom_target(complete-bundle ALL + add_custom_target(complete-bundle ${CMAKE_COMMAND} -E make_directory ${APP_CONTENTS}/bin COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/lmp ${APP_CONTENTS}/bin/ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/msi2lmp ${APP_CONTENTS}/bin/ @@ -146,8 +146,8 @@ if(APPLE) COMMENT "Copying additional files into macOS app bundle tree" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - add_custom_target(build-dmg ALL - COMMAND ${LAMMPS_DIR}/cmake/packaging/build-macos-dmg-with-gui.sh + add_custom_target(dmg + COMMAND ${LAMMPS_DIR}/cmake/packaging/build_macos_dmg.sh DEPENDS complete-bundle COMMENT "Create Drag-n-Drop installer disk image from app bundle" BYPRODUCT LAMMPS-macOS-multiarch.dmg @@ -165,7 +165,7 @@ elseif(MSVC) get_filename_component(QT5_BIN_DIR "${Qt5Core_DIR}/../../../bin" ABSOLUTE) get_filename_component(INSTNAME ${CMAKE_INSTALL_PREFIX} NAME) install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -D INSTNAME=${INSTNAME} -D VC_INIT=\"${VC_INIT}\" -D QT5_BIN_DIR=\"${QT5_BIN_DIR}\" -P \"${CMAKE_SOURCE_DIR}/packaging/build_windows_vs.cmake\" WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/..\" COMMAND_ECHO STDOUT)") -else() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") install(TARGETS lammps-gui DESTINATION ${CMAKE_INSTALL_BINDIR}) install(CODE [[ file(GET_RUNTIME_DEPENDENCIES @@ -185,6 +185,13 @@ else() list(LENGTH _u_deps _u_length) if("${_u_length}" GREATER 0) message(WARNING "Unresolved dependencies detected: ${_u_deps}") - endif() - ]]) + endif() ]] + ) + add_custom_target(tgz + COMMAND ${LAMMPS_DIR}/cmake/packaging/build_linux_tgz.sh + DEPENDS lammps-gui + COMMENT "Create compressed tar file of LAMMPS with dependent libraries and wrapper" + BYPRODUCT LAMMPS-Linux-amd64.tar.gz + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) endif()