diff --git a/Help/command/install.rst b/Help/command/install.rst index b1991475b7..48194bb6d8 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -568,6 +568,7 @@ Signatures ``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``/locale`` ``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``/man`` ``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``/doc`` + ``LIBEXEC`` ``${CMAKE_INSTALL_LIBEXECDIR}`` ``libexec`` ======================= ================================== ========================= Projects wishing to follow the common practice of installing headers into a @@ -606,6 +607,9 @@ Signatures use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. + .. versionadded:: 3.31 + The ``TYPE`` argument now supports type ``LIBEXEC``. + .. signature:: install(DIRECTORY ... [...]) @@ -720,6 +724,7 @@ Signatures ``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``/locale`` ``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``/man`` ``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``/doc`` + ``LIBEXEC`` ``${CMAKE_INSTALL_LIBEXECDIR}`` ``libexec`` ======================= ================================== ========================= Note that some of the types' built-in defaults use the ``DATAROOT`` directory as @@ -743,6 +748,9 @@ Signatures The list of ``dirs...`` given to ``DIRECTORY`` may use "generator expressions" too. + .. versionadded:: 3.31 + The ``TYPE`` argument now supports type ``LIBEXEC``. + .. signature:: install(SCRIPT [...]) install(CODE [...]) diff --git a/Help/release/dev/install-type-libexec.rst b/Help/release/dev/install-type-libexec.rst new file mode 100644 index 0000000000..d77a36b49f --- /dev/null +++ b/Help/release/dev/install-type-libexec.rst @@ -0,0 +1,5 @@ +install-type-libexec +-------------------- + +* The :command:`install(FILES)` and :command:`install(DIRECTORY)` commands' + ``TYPE`` argument gained support for a ``LIBEXEC`` type. diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index f4cc4c3b33..3289f476db 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -136,6 +136,8 @@ public: const cmInstallCommandArguments* args) const; std::string GetManDestination(const cmInstallCommandArguments* args) const; std::string GetDocDestination(const cmInstallCommandArguments* args) const; + std::string GetProgramExecutablesDestination( + const cmInstallCommandArguments* args) const; std::string GetDestinationForType(const cmInstallCommandArguments* args, const std::string& type) const; @@ -291,7 +293,7 @@ void AddInstallRuntimeDependenciesGenerator( std::set const allowedTypes{ "BIN", "SBIN", "LIB", "INCLUDE", "SYSCONF", "SHAREDSTATE", "LOCALSTATE", "RUNSTATE", "DATA", "INFO", - "LOCALE", "MAN", "DOC", + "LOCALE", "MAN", "DOC", "LIBEXEC", }; template @@ -2591,6 +2593,12 @@ std::string Helper::GetDocDestination( this->GetDataRootDestination(nullptr) + "/doc"); } +std::string Helper::GetProgramExecutablesDestination( + const cmInstallCommandArguments* args) const +{ + return this->GetDestination(args, "CMAKE_INSTALL_LIBEXECDIR", "libexec"); +} + std::string Helper::GetDestinationForType( const cmInstallCommandArguments* args, const std::string& type) const { @@ -2636,6 +2644,9 @@ std::string Helper::GetDestinationForType( if (type == "DOC") { return this->GetDocDestination(nullptr); } + if (type == "LIBEXEC") { + return this->GetProgramExecutablesDestination(nullptr); + } return ""; } diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake index 03fa3c8328..17fa19140e 100644 --- a/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake +++ b/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake @@ -14,6 +14,9 @@ set(_check_files [[lib]] [[lib/dir]] [[lib/dir/empty\.txt]] + [[libexec]] + [[libexec/dir]] + [[libexec/dir/empty\.txt]] [[sbin]] [[sbin/dir]] [[sbin/dir/empty\.txt]] diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE.cmake index 53e95f8eec..cb09474714 100644 --- a/Tests/RunCMake/install/DIRECTORY-TYPE.cmake +++ b/Tests/RunCMake/install/DIRECTORY-TYPE.cmake @@ -11,3 +11,4 @@ install(DIRECTORY dir TYPE INFO) install(DIRECTORY dir TYPE LOCALE) install(DIRECTORY dir TYPE MAN) install(DIRECTORY dir TYPE DOC) +install(DIRECTORY dir TYPE LIBEXEC) diff --git a/Tests/RunCMake/install/FILES-TYPE-all-check.cmake b/Tests/RunCMake/install/FILES-TYPE-all-check.cmake index c4ec661499..a0324cfb68 100644 --- a/Tests/RunCMake/install/FILES-TYPE-all-check.cmake +++ b/Tests/RunCMake/install/FILES-TYPE-all-check.cmake @@ -9,6 +9,8 @@ set(_check_files [[include/main\.c]] [[lib]] [[lib/main\.c]] + [[libexec]] + [[libexec/main\.c]] [[sbin]] [[sbin/main\.c]] [[share]] diff --git a/Tests/RunCMake/install/FILES-TYPE.cmake b/Tests/RunCMake/install/FILES-TYPE.cmake index 2e2bfc7fa1..ed75adfbd4 100644 --- a/Tests/RunCMake/install/FILES-TYPE.cmake +++ b/Tests/RunCMake/install/FILES-TYPE.cmake @@ -11,3 +11,4 @@ install(FILES main.c TYPE INFO) install(FILES main.c TYPE LOCALE) install(FILES main.c TYPE MAN) install(FILES main.c TYPE DOC) +install(FILES main.c TYPE LIBEXEC)