aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-02-11 14:34:04 -0800
committerAnders Broman <a.broman58@gmail.com>2018-02-13 06:18:34 +0000
commit9cc4a3b9674c2b5b53bd32b54dfe863bb08b81ed (patch)
tree30618b56beb360764cdc5753e4706411d3697f85 /cmake/modules
parentd1ce1baf63c96f9bddfe8577a82568b21295fd96 (diff)
CMake: Install the HTML guides.
Add a "FileInstall.cmake" module that installs files and directories. Use it to install the chunked HTML guides. Install the guides into CMAKE_INSTALL_FULL_DOCDIR. By default this is /usr/local/share/doc/Wireshark. Define DOC_DIR to match. Add explicit file and directory permissions to the default install targets. Remove the PDF install target. Bug: 14258 Change-Id: I4712a4047a54627b7520b5bf5f191e0761d19606 Reviewed-on: https://code.wireshark.org/review/25737 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FileInstall.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/modules/FileInstall.cmake b/cmake/modules/FileInstall.cmake
new file mode 100644
index 0000000000..3358aa2a80
--- /dev/null
+++ b/cmake/modules/FileInstall.cmake
@@ -0,0 +1,33 @@
+# FileInstall - Install files and directories separately from the
+# "install" command.
+#
+# Usage:
+# cmake -P /path/to/FileInstall.cmake [source ...] [destination]
+
+# Params are
+# cmake -P /path/to/hhc.cmake "/path/to/hhc.exe" project.hhp
+math(EXPR _dest_idx "${CMAKE_ARGC} - 1")
+set(_destination ${CMAKE_ARGV${_dest_idx}})
+set(_sources)
+
+math(EXPR _last_src "${CMAKE_ARGC} - 2")
+foreach(_src_idx RANGE 3 ${_last_src})
+ set(_sources ${_sources} ${CMAKE_ARGV${_src_idx}})
+endforeach(_src_idx)
+
+if (_sources AND _destination)
+ message (STATUS "Installing ${_sources} to ${_destination}")
+ file (INSTALL ${_sources}
+ DESTINATION ${_destination}
+ FILE_PERMISSIONS
+ OWNER_WRITE OWNER_READ
+ GROUP_READ
+ WORLD_READ
+ DIRECTORY_PERMISSIONS
+ OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ GROUP_EXECUTE GROUP_READ
+ WORLD_EXECUTE WORLD_READ
+ )
+else()
+ message (FATAL_ERROR "Missing arguments. Sources: ${_sources}. Destination: ${_destination}.")
+endif()