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>
add_subdirectory( ${_plugin_src_dir} )
endforeach()
-
-# Basedir where to install guides
-set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
-message(STATUS "docdir: ${DOC_DIR}")
-
if(ENABLE_PCAP_NG_DEFAULT)
set(PCAP_NG_DEFAULT 1)
endif()
install(
FILES
${INSTALL_FILES}
+ PERMISSIONS
+ OWNER_WRITE OWNER_READ
+ GROUP_READ
+ WORLD_READ
DESTINATION
${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
)
install(
DIRECTORY
${INSTALL_DIRS}
+ DESTINATION
+ ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
+ 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
- DESTINATION
- ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
PATTERN ".git" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "Makefile.*" EXCLUDE
${CMAKE_INSTALL_MODULES_DIR}
)
-if(DOC_DIR)
- message(STATUS "Docdir install: ${DOC_DIR}")
- INSTALL(
- DIRECTORY
- ${CMAKE_BINARY_DIR}/docbook/
- DIRECTORY_PERMISSIONS
- OWNER_EXECUTE OWNER_WRITE OWNER_READ
- GROUP_EXECUTE GROUP_READ
- WORLD_EXECUTE WORLD_READ
- DESTINATION
- ${DOC_DIR}/guides
- FILES_MATCHING
- PATTERN "*.pdf"
- )
-endif()
-
# Test suite wrapper
if(ENABLE_APPLICATION_BUNDLE)
set(TEST_SH_BIN_DIR ${CMAKE_BINARY_DIR}/run)
--- /dev/null
+# 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()
# being able to build our documentation.
set(WSUG_TOOLS_HELP_FILES)
set(WSUG_TOOLS_PHONY_DEPS)
+set(GUIDE_INSTALL_DIRS)
# General help output
foreach(th_command ${WSUG_TOOLS_HELP_COMMANDS})
)
set_docbook_target_properties(user_guide_html)
add_dependencies(user_guides user_guide_html)
+ list(APPEND GUIDE_INSTALL_DIRS ${CMAKE_CURRENT_BINARY_DIR}/wsug_html_chunked)
endif()
if(ASCIIDOCTOR_EXECUTABLE)
)
set_docbook_target_properties(developer_guide_html)
add_dependencies(developer_guides developer_guide_html)
+ list(APPEND GUIDE_INSTALL_DIRS ${CMAKE_CURRENT_BINARY_DIR}/wsdg_html_chunked)
endif()
if(ASCIIDOCTOR_EXECUTABLE)
add_dependencies(developer_guides developer_guide_chm)
endif()
+if (GUIDE_INSTALL_DIRS)
+ # The installation location and DOC_DIR in ui/help_url.c must
+ # match.
+ add_custom_target(install_guides
+ COMMAND ${CMAKE_COMMAND} -P
+ ${CMAKE_SOURCE_DIR}/cmake/modules/FileInstall.cmake
+ ${GUIDE_INSTALL_DIRS}
+ ${CMAKE_INSTALL_FULL_DOCDIR}
+ DEPENDS
+ user_guide_html developer_guide_html
+ )
+ set_docbook_target_properties(install_guides)
+endif()
+
# release_notes: release-notes.html release-notes.txt
add_custom_target( release_notes_html DEPENDS release-notes.html )
target_link_libraries(ui Htmlhelp.lib)
endif()
+add_definitions(-DDOC_DIR="${CMAKE_INSTALL_FULL_DOCDIR}")
+
CHECKAPI(
NAME
ui-base
include $(top_srcdir)/Makefile.am.inc
+# The installation location and DOC_DIR in ui/help_url.c must match.
AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) -DDOC_DIR=\"$(docdir)\" \
$(GLIB_CFLAGS) $(PCAP_CFLAGS) $(LIBGCRYPT_CFLAGS) $(LIBGNUTLS_CFLAGS) $(PORTAUDIO_INCLUDES)