diff --git a/cmake/Modules/Tools.cmake b/cmake/Modules/Tools.cmake index ad7c021e6e..efb3876468 100644 --- a/cmake/Modules/Tools.cmake +++ b/cmake/Modules/Tools.cmake @@ -34,7 +34,16 @@ if(BUILD_LAMMPS_SHELL) if(NOT LAMMPS_EXCEPTIONS) message(WARNING "The LAMMPS shell needs LAMMPS_EXCEPTIONS enabled for full functionality") endif() - add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp) + + # include resource compiler to embed icons into the executable on Windows + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + enable_language(RC) + set(ICON_RC_FILE ${LAMMPS_TOOLS_DIR}/lammps-shell/lmpicons.rc) + endif() + + add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp ${ICON_RC_FILE}) + target_include_directories(lammps-shell PRIVATE ${LAMMPS_TOOLS_DIR}/lammps-shell) + # workaround for broken readline pkg-config file on FreeBSD if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) target_include_directories(lammps-shell PRIVATE /usr/local/include) diff --git a/tools/lammps-shell/icons/lammps.ico b/tools/lammps-shell/icons/lammps.ico new file mode 100644 index 0000000000..cce156bf79 Binary files /dev/null and b/tools/lammps-shell/icons/lammps.ico differ diff --git a/tools/lammps-shell/icons/lmpfile.ico b/tools/lammps-shell/icons/lmpfile.ico new file mode 100644 index 0000000000..7e1636584f Binary files /dev/null and b/tools/lammps-shell/icons/lmpfile.ico differ diff --git a/tools/lammps-shell/lmpicons.rc b/tools/lammps-shell/lmpicons.rc new file mode 100644 index 0000000000..a9da9eea17 --- /dev/null +++ b/tools/lammps-shell/lmpicons.rc @@ -0,0 +1,2 @@ +id1 ICON icons/lammps.ico +id2 ICON icons/lmpfile.ico