@@ -288,6 +288,48 @@ if(APPLE)
288288 endif ()
289289endif ()
290290
291+ # -------------------------------------------------------------
292+ # Linux .desktop + icon install (DEB/RPM) and IFW user install
293+ # -------------------------------------------------------------
294+ if (UNIX AND NOT APPLE )
295+ # Paths used in desktop files
296+ # Executable name follows your DEBUG suffix logic
297+ set (EXEC_BASENAME "${IFW_QS_TARGET_FILE_BASE} " ) # e.g. fea or fea_debug
298+
299+ # ---- Variant A: for DEB/RPM (absolute paths under CMAKE_INSTALL_PREFIX)
300+ set (DESKTOP_ABS "${CMAKE_BINARY_DIR} /${PROJECT_PACKAGE_NAME} .desktop" )
301+ set (EXEC_PATH_ABS "${CMAKE_INSTALL_PREFIX} /bin/${EXEC_BASENAME} " )
302+ set (ICON_PATH_ABS "${CMAKE_INSTALL_PREFIX} /share/icons/hicolor/256x256/apps/${PROJECT_PACKAGE_NAME} .png" )
303+
304+ configure_file (
305+ ${CMAKE_SOURCE_DIR} /range-build -tools/app.desktop.in
306+ ${DESKTOP_ABS}
307+ @ONLY
308+ )
309+
310+ # Install desktop + a 256px PNG icon for system packages
311+ install (FILES "${DESKTOP_ABS} " DESTINATION share/applications COMPONENT Application)
312+ install (FILES "${CMAKE_SOURCE_DIR} /${PROJECT_TARGET_NAME} /pixmaps/${PROJECT_PACKAGE_NAME} .png"
313+ DESTINATION share/icons/hicolor/256x256/apps COMPONENT Application)
314+
315+ # ---- Variant B: for IFW (will be copied to ~/.local/share/applications at install-time)
316+ # Keep dynamic placeholders that IFW script will replace with the real TargetDir
317+ set (DESKTOP_IFW "${CMAKE_BINARY_DIR} /${PROJECT_PACKAGE_NAME} .desktop.ifw" )
318+ set (EXEC_PATH "@EXEC_PATH@" ) # placeholder
319+ set (ICON_PATH "@ICON_PATH@" ) # placeholder
320+ configure_file (
321+ ${CMAKE_SOURCE_DIR} /range-build -tools/app.desktop.in
322+ ${DESKTOP_IFW}
323+ @ONLY
324+ )
325+
326+ # Ship the template + icon inside the IFW payload (into app dir)
327+ install (FILES "${DESKTOP_IFW} " DESTINATION . COMPONENT Application)
328+ install (FILES "${CMAKE_SOURCE_DIR} /${PROJECT_TARGET_NAME} /pixmaps/${PROJECT_PACKAGE_NAME} .png"
329+ DESTINATION ${PROJECT_TARGET_NAME} /pixmaps COMPONENT Application)
330+ endif ()
331+
332+
291333# -----------------------------------------------------------------------------
292334
293335include (CPackIFW)
0 commit comments