mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-26 08:04:13 +01:00
Take the Linux install paths from GNUInstallDirs
The install folders were written out in full, so the GNUInstallDirs variables packagers set (CMAKE_INSTALL_BINDIR, _DATADIR, _DOCDIR, ...) had no effect. On Linux and the BSDs the QET_*_PATH variables now come from them; an absolute one is made relative to the install prefix, as the paths compiled into QET put COMPIL_PREFIX in front. The install rules use QET_DATA_PATH, QET_LICENSE_PATH and QET_DESKTOP_PATH where they named share/qelectrotech, share/doc/qelectrotech and share/applications. macOS and Windows get those same values, so what they install does not change. With the GNUInstallDirs defaults nothing changes: for the prefixes /usr/local and /usr, the compiled-in paths and every installed file (with its permissions) are the same as before. Only two configure messages change, QET_LICENSE_PATH and QET_MAN_PATH, which now show where the files go (share/doc/qelectrotech, share/man). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+7
-7
@@ -388,16 +388,16 @@ if (NOT MINGW)
|
||||
install(DIRECTORY ico/breeze-icons/64x64 DESTINATION ${QET_ICONS_PATH})
|
||||
install(DIRECTORY ico/breeze-icons/128x128 DESTINATION ${QET_ICONS_PATH})
|
||||
install(DIRECTORY ico/breeze-icons/256x256 DESTINATION ${QET_ICONS_PATH})
|
||||
install(DIRECTORY elements DESTINATION share/qelectrotech)
|
||||
install(DIRECTORY examples DESTINATION share/qelectrotech)
|
||||
install(DIRECTORY titleblocks DESTINATION share/qelectrotech)
|
||||
install(DIRECTORY elements DESTINATION ${QET_DATA_PATH})
|
||||
install(DIRECTORY examples DESTINATION ${QET_DATA_PATH})
|
||||
install(DIRECTORY titleblocks DESTINATION ${QET_DATA_PATH})
|
||||
# The MCP server (misc/qet-mcp) finds this QElectroTech and its elements
|
||||
# from here: <prefix>/share/qelectrotech/mcp -> <prefix>/bin.
|
||||
install(PROGRAMS misc/qet-mcp/qet_mcp.py DESTINATION share/qelectrotech/mcp)
|
||||
install(FILES misc/qet-mcp/README.md DESTINATION share/qelectrotech/mcp)
|
||||
install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share/doc/qelectrotech)
|
||||
install(PROGRAMS misc/qet-mcp/qet_mcp.py DESTINATION ${QET_DATA_PATH}mcp)
|
||||
install(FILES misc/qet-mcp/README.md DESTINATION ${QET_DATA_PATH}mcp)
|
||||
install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION ${QET_LICENSE_PATH})
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications)
|
||||
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION ${QET_DESKTOP_PATH})
|
||||
install(FILES misc/qelectrotech.xml DESTINATION ${QET_MIME_PACKAGE_PATH})
|
||||
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
|
||||
endif()
|
||||
|
||||
@@ -18,21 +18,32 @@
|
||||
|
||||
message(" - paths_compilation_installation")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# for Linux, BSD, Solaris, Minix
|
||||
# The paths below are relative to the install prefix: COMPIL_PREFIX is
|
||||
# put in front of them for the paths compiled into QET. An absolute
|
||||
# CMAKE_INSTALL_<dir> is accepted too, made relative to the prefix here.
|
||||
file(RELATIVE_PATH QET_BINDIR "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_BINDIR}")
|
||||
file(RELATIVE_PATH QET_DATADIR "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_DATADIR}")
|
||||
file(RELATIVE_PATH QET_DATAROOTDIR "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_DATAROOTDIR}")
|
||||
file(RELATIVE_PATH QET_DOCDIR "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_DOCDIR}")
|
||||
file(RELATIVE_PATH QET_MANDIR "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_FULL_MANDIR}")
|
||||
set(COMPIL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
|
||||
set(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
|
||||
set(QET_BINARY_PATH "bin/")
|
||||
set(QET_COMMON_COLLECTION_PATH "share/qelectrotech/elements/")
|
||||
set(QET_COMMON_TBT_PATH "share/qelectrotech/titleblocks/")
|
||||
set(QET_LANG_PATH "share/qelectrotech/lang/")
|
||||
set(QET_EXAMPLES_PATH "share/qelectrotech/examples/")
|
||||
set(QET_LICENSE_PATH "doc/qelectrotech/")
|
||||
set(QET_MIME_PACKAGE_PATH "share/mime/packages/")
|
||||
set(QET_DESKTOP_PATH "share/applications/")
|
||||
set(QET_ICONS_PATH "share/icons/hicolor/")
|
||||
set(QET_MAN_PATH "man/")
|
||||
set(QET_APPDATA_PATH "share/appdata")
|
||||
set(QET_BINARY_PATH "${QET_BINDIR}/")
|
||||
set(QET_DATA_PATH "${QET_DATADIR}/qelectrotech/")
|
||||
set(QET_COMMON_COLLECTION_PATH "${QET_DATA_PATH}elements/")
|
||||
set(QET_COMMON_TBT_PATH "${QET_DATA_PATH}titleblocks/")
|
||||
set(QET_LANG_PATH "${QET_DATA_PATH}lang/")
|
||||
set(QET_EXAMPLES_PATH "${QET_DATA_PATH}examples/")
|
||||
set(QET_LICENSE_PATH "${QET_DOCDIR}/")
|
||||
set(QET_MIME_PACKAGE_PATH "${QET_DATAROOTDIR}/mime/packages/")
|
||||
set(QET_DESKTOP_PATH "${QET_DATAROOTDIR}/applications/")
|
||||
set(QET_ICONS_PATH "${QET_DATAROOTDIR}/icons/hicolor/")
|
||||
set(QET_MAN_PATH "${QET_MANDIR}/")
|
||||
set(QET_APPDATA_PATH "${QET_DATAROOTDIR}/appdata")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
@@ -43,8 +54,9 @@ if(APPLE)
|
||||
set(QET_COMMON_COLLECTION_PATH "../Resources/elements/")
|
||||
set(QET_COMMON_TBT_PATH "../Resources/titleblocks/")
|
||||
set(QET_LANG_PATH "../Resources/lang/")
|
||||
set(QET_DATA_PATH "share/qelectrotech/")
|
||||
set(QET_EXAMPLES_PATH "share/qelectrotech/examples/")
|
||||
set(QET_LICENSE_PATH "doc/qelectrotech/")
|
||||
set(QET_LICENSE_PATH "share/doc/qelectrotech/")
|
||||
set(QET_DESKTOP_PATH "share/applications/")
|
||||
set(QET_ICONS_PATH "share/icons/hicolor/")
|
||||
set(QET_MAN_PATH "man/")
|
||||
@@ -63,7 +75,10 @@ if(WIN32)
|
||||
# windows-build workflow), and what the shortcuts pass as --lang-dir.
|
||||
set(QET_LANG_PATH "lang/")
|
||||
set(QET_EXAMPLES_PATH "examples/")
|
||||
set(QET_LICENSE_PATH "./")
|
||||
# Where an MSVC "cmake --install" puts the data and the documents; the
|
||||
# Windows packagings do not use it, they lay the files out themselves.
|
||||
set(QET_DATA_PATH "share/qelectrotech/")
|
||||
set(QET_LICENSE_PATH "share/doc/qelectrotech/")
|
||||
set(QET_ICONS_PATH "icons/hicolor/")
|
||||
# Liste des ressources Windows
|
||||
#RC_FILE = qelectrotech.rc
|
||||
|
||||
Reference in New Issue
Block a user