desktop integration for Linux, embedded icons on Windows

This commit is contained in:
Axel Kohlmeyer
2023-08-12 23:30:37 -04:00
parent c11d58f7b1
commit 1991d74623
11 changed files with 21 additions and 0 deletions

View File

@ -57,6 +57,12 @@ if(LAMMPS_GUI_USE_PLUGIN)
set(PLUGIN_LOADER_SRC ${LAMMPS_PLUGINLIB_DIR}/liblammpsplugin.c) set(PLUGIN_LOADER_SRC ${LAMMPS_PLUGINLIB_DIR}/liblammpsplugin.c)
endif() endif()
# include resource compiler to embed icons into the executable on Windows
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
enable_language(RC)
set(ICON_RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lmpicons.rc)
endif()
# we require Qt 5 and at least version 5.12 at that. # we require Qt 5 and at least version 5.12 at that.
find_package(Qt5 5.12 REQUIRED COMPONENTS Widgets Charts) find_package(Qt5 5.12 REQUIRED COMPONENTS Widgets Charts)
@ -85,6 +91,7 @@ set(PROJECT_SOURCES
setvariables.h setvariables.h
stdcapture.cpp stdcapture.cpp
${PLUGIN_LOADER_SRC} ${PLUGIN_LOADER_SRC}
${ICON_RC_FILE}
) )
qt5_add_resources(PROJECT_SOURCES lammpsgui.qrc) qt5_add_resources(PROJECT_SOURCES lammpsgui.qrc)
@ -184,6 +191,8 @@ elseif((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
install(TARGETS lammps-gui DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS lammps-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/lammps-gui.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications/)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icons/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/)
install(CODE [[ install(CODE [[
file(GET_RUNTIME_DEPENDENCIES file(GET_RUNTIME_DEPENDENCIES
LIBRARIES $<TARGET_FILE:lammps> LIBRARIES $<TARGET_FILE:lammps>

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Categories=Science;Engineering;
Exec=lammps-gui %f
Name=The LAMMPS GUI
Terminal=false
GenericName=MD Simulator
Keywords=MD Simulation;LAMMPS;Molecular Dynamics;N-Body
Icon=lammps

View File

@ -0,0 +1,2 @@
id1 ICON icons/lammps.ico
id2 ICON icons/lmpfile.ico