From 21d2158a0bf39c08af6c5a24ef9895f819cd3af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sun, 3 Sep 2017 00:42:00 +0100 Subject: [PATCH] CMake: Initial work to install headers for the benefit of plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To be continued incrementally to fix gaps and omissions. If we are willing to reorganize the source tree to have one or two header include folders this could be simplified considerably. It would also force developers to give more consideration to API issues, which is a good thing. See also e7ef19efc0e928b50644b37772ccbf176e74f766. Bug: 14062 Change-Id: I0759da2f9793cfb5cf92c9e231457bba43df4353 Reviewed-on: https://code.wireshark.org/review/23548 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- CMakeLists.txt | 20 ++ docbook/release-notes.asciidoc | 9 +- epan/CMakeLists.txt | 128 +++++++++++ epan/dfilter/CMakeLists.txt | 11 + epan/dissectors/CMakeLists.txt | 373 +++++++++++++++++++++++++++++++++ epan/ftypes/CMakeLists.txt | 10 + epan/wmem/CMakeLists.txt | 23 ++ wsutil/CMakeLists.txt | 64 ++++++ 8 files changed, 633 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7260eb6ee8..64b2b7f29f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3027,6 +3027,26 @@ install( ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME} ) +set(SHARK_PUBLIC_HEADERS + cfile.h + file.h + register.h + globals.h + log.h + ws_symbol_export.h + ws_attributes.h + ws_diag_control.h +) + +if(NOT WIN32) + install( + FILES + ${SHARK_PUBLIC_HEADERS} + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME} + ) +endif() + # Install icons and other desktop files for Freedesktop.org-compliant desktops. if(((BUILD_wireshark AND QT_FOUND) OR BUILD_wireshark_gtk) AND NOT (WIN32 OR APPLE)) install(FILES wireshark-mime-package.xml diff --git a/docbook/release-notes.asciidoc b/docbook/release-notes.asciidoc index 42918dbee9..5377fa2bb2 100644 --- a/docbook/release-notes.asciidoc +++ b/docbook/release-notes.asciidoc @@ -13,11 +13,10 @@ used for troubleshooting, analysis, development and education. == What's New - * It's now possible to build plugins out-of-tree on Unix-like systems using - autotools (i.e. building Wireshark with autotools will install the necessary - dependencies). A pkg-config file is provided to help with this. Only epan plugins - supported for now, other types will be added in the future. Note you must still - rebuild all plugins between minor releases (X.Y). +* The installation step for Wireshark will now install headers required to + build plugins. A pkg-config file is provided to help with this. Only libwireshark + plugins supported for now, other types will be added in the future. Note you + must still rebuild all plugins between minor releases (X.Y). //=== Bug Fixes diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index 0dcbc4b55a..02cfcc5fa2 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -72,6 +72,128 @@ add_custom_command( ${CMAKE_CURRENT_SOURCE_DIR}/print.ps ) +set(LIBWIRESHARK_PUBLIC_HEADERS + addr_and_mask.h + addr_resolv.h + address.h + address_types.h + afn.h + aftypes.h + app_mem_usage.h + arcnet_pids.h + arptypes.h + asn1.h + ax25_pids.h + bridged_pids.h + capture_dissectors.h + charsets.h + chdlctypes.h + circuit.h + color_filters.h + column.h + column-info.h + column-utils.h + conversation.h + conversation_debug.h + conversation_table.h + conv_id.h + crc10-tvb.h + crc16-tvb.h + crc32-tvb.h + crc6-tvb.h + crc8-tvb.h + decode_as.h + diam_dict.h + disabled_protos.h + dissector_filters.h + dtd.h + dtd_parse.h + dvb_chartbl.h + dwarf.h + eap.h + eapol_keydes_types.h + epan.h + epan_dissect.h + etypes.h + ex-opt.h + except.h + exceptions.h + expert.h + export_object.h + exported_pdu.h + plugin_if.h + filter_expressions.h + follow.h + frame_data.h + frame_data_sequence.h + funnel.h + garrayfix.h + geoip_db.h + golay.h + guid-utils.h + iana_charsets.h + iax2_codec_type.h + in_cksum.h + ip_opts.h + ipproto.h + ipv4.h + ipv6.h + lapd_sapi.h + llcsaps.h + media_params.h + next_tvb.h + nlpid.h + oids.h + osi-utils.h + oui.h + packet.h + packet_info.h + params.h + ppptypes.h + print.h + print_stream.h + prefs.h + prefs-int.h + proto.h + proto_data.h + ps.h + ptvcursor.h + range.h + reassemble.h + reedsolomon.h + req_resp_hdrs.h + rtd_table.h + rtp_pt.h + sctpppids.h + show_exception.h + slow_protocol_subtypes.h + sminmpec.h + srt_table.h + stat_tap_ui.h + stat_groups.h + stats_tree.h + stats_tree_priv.h + stream.h + strutil.h + t35.h + tap.h + tap-voip.h + timestamp.h + timestats.h + tfs.h + time_fmt.h + to_str.h + tvbparse.h + tvbuff.h + tvbuff-int.h + uat.h + uat-int.h + unit_strings.h + value_string.h + x264_prt_id.h + xdlc.h +) + set(LIBWIRESHARK_FILES addr_and_mask.c addr_resolv.c @@ -310,6 +432,12 @@ if(NOT ${ENABLE_STATIC}) ) endif() +if(NOT WIN32) + install(FILES ${LIBWIRESHARK_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/epan" + ) +endif() + add_executable(exntest EXCLUDE_FROM_ALL exntest.c except.c) target_link_libraries(exntest ${GLIB2_LIBRARIES}) set_target_properties(exntest PROPERTIES diff --git a/epan/dfilter/CMakeLists.txt b/epan/dfilter/CMakeLists.txt index b4eb5fb46d..4a2ebad0f9 100644 --- a/epan/dfilter/CMakeLists.txt +++ b/epan/dfilter/CMakeLists.txt @@ -24,6 +24,11 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) +set(DFILTER_PUBLIC_HEADERS + dfilter.h + drange.h +) + set(DFILTER_FILES dfilter.c dfilter-macro.c @@ -68,6 +73,12 @@ set_target_properties(dfilter PROPERTIES COMPILE_OPTIONS "${WS_WARNINGS_C_FLAGS}" ) +if(NOT WIN32) + install(FILES ${DFILTER_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/epan/dfilter" + ) +endif() + CHECKAPI( NAME dfilter diff --git a/epan/dissectors/CMakeLists.txt b/epan/dissectors/CMakeLists.txt index e75730dcb7..ce06e363d6 100644 --- a/epan/dissectors/CMakeLists.txt +++ b/epan/dissectors/CMakeLists.txt @@ -210,6 +210,373 @@ set(NCP2222_DISSECTOR_SRC source_group(dissectors-ncp2222 FILES ${NCP2222_DISSECTOR_SRC}) +set(DISSECTOR_PUBLIC_HEADERS + packet-6lowpan.h + packet-a21.h + packet-acp133.h + packet-acse.h + packet-actrace.h + packet-adb_service.h + packet-afp.h + packet-alcap.h + packet-ansi_a.h + packet-ansi_map.h + packet-ansi_tcap.h + packet-arp.h + packet-atalk.h + packet-atm.h + packet-atn-ulcs.h + packet-bacapp.h + packet-ber.h + packet-bfd.h + packet-bgp.h + packet-bluetooth.h + packet-bssap.h + packet-bssgp.h + packet-btatt.h + packet-btavctp.h + packet-btavdtp.h + packet-btavrcp.h + packet-bthci_acl.h + packet-bthci_cmd.h + packet-bthci_evt.h + packet-bthci_sco.h + packet-btl2cap.h + packet-btle.h + packet-btrfcomm.h + packet-btsdp.h + packet-c1222.h + packet-camel.h + packet-cdt.h + packet-cell_broadcast.h + packet-charging_ase.h + packet-chdlc.h + packet-cip.h + packet-cipsafety.h + packet-clearcase.h + packet-cmip.h + packet-cmp.h + packet-cms.h + packet-coap.h + packet-credssp.h + packet-crmf.h + packet-csn1.h + packet-dap.h + packet-dcc.h + packet-dccp.h + packet-dcerpc.h + packet-dcerpc-browser.h + packet-dcerpc-budb.h + packet-dcerpc-butc.h + packet-dcerpc-dce122.h + packet-dcerpc-dcom.h + packet-dcerpc-dnsserver.h + packet-dcerpc-frsapi.h + packet-dcerpc-frsrpc.h + packet-dcerpc-netlogon.h + packet-dcerpc-nt.h + packet-dcerpc-pnp.h + packet-dcerpc-rras.h + packet-dcerpc-samr.h + packet-dcerpc-spoolss.h + packet-dcerpc-svcctl.h + packet-dcerpc-tapi.h + packet-dcom.h + packet-dcom-dispatch.h + packet-diameter.h + packet-diameter_3gpp.h + packet-diffserv-mpls-common.h + packet-disp.h + packet-dns.h + packet-dop.h + packet-dsp.h + packet-dtls.h + packet-dtn.h + packet-dvbci.h + packet-enip.h + packet-erf.h + packet-e164.h + packet-e212.h + packet-eapol.h + packet-edonkey.h + packet-eigrp.h + packet-epl.h + packet-epmd.h + packet-ess.h + packet-eth.h + packet-fc.h + packet-fcbls.h + packet-fcct.h + packet-fcels.h + packet-fcfcs.h + packet-fcfzs.h + packet-fclctl.h + packet-fcp.h + packet-fcsb3.h + packet-fcswils.h + packet-ff.h + packet-fix.h + packet-fmp.h + packet-frame.h + packet-ftam.h + packet-giop.h + packet-gluster.h + packet-gmr1_common.h + packet-gmr1_rr.h + packet-gnutella.h + packet-gprscdr.h + packet-gre.h + packet-gsm_a_common.h + packet-gsm_a_rr.h + packet-gsm_map.h + packet-gsm_rlcmac.h + packet-gsm_sms.h + packet-gsmtap.h + packet-gssapi.h + packet-gtp.h + packet-gtpv2.h + packet-h223.h + packet-h225.h + packet-h235.h + packet-h245.h + packet-h248.h + packet-h263.h + packet-h264.h + packet-h323.h + packet-h450-ros.h + packet-hpext.h + packet-http.h + packet-http2.h + packet-iana-oui.h + packet-iax2.h + packet-icmp.h + packet-idmp.h + packet-idp.h + packet-ieee80211.h + packet-ieee80211-radio.h + packet-ieee80211-radiotap-iter.h + packet-ieee80211-radiotap-defs.h + packet-ieee802154.h + packet-ieee8023.h + packet-ieee802a.h + packet-igmp.h + packet-imf.h + packet-inap.h + packet-infiniband.h + packet-ip.h + packet-ipmi.h + packet-ipsec.h + packet-ipx.h + packet-isakmp.h + packet-isis.h + packet-isis-clv.h + packet-isl.h + packet-isup.h + packet-iwarp-ddp-rdmap.h + packet-juniper.h + packet-jxta.h + packet-kerberos.h + packet-klm.h + packet-l2tp.h + packet-lapdm.h + packet-lbm.h + packet-lbtrm.h + packet-lbtru.h + packet-lbttcp.h + packet-ldap.h + packet-lcsap.h + packet-ldp.h + packet-link16.h + packet-llc.h + packet-logotypecertextn.h + packet-lpp.h + packet-lte-rrc.h + packet-mac-lte.h + packet-mausb.h + packet-mbim.h + packet-mbtcp.h + packet-mgcp.h + packet-mle.h + packet-mms.h + packet-mount.h + packet-mp4ves.h + packet-mpeg-descriptor.h + packet-mpeg-pmt.h + packet-mpeg-sect.h + packet-mpls.h + packet-mq.h + packet-msrp.h + packet-mstp.h + packet-mtp3.h + packet-nbap.h + packet-ncp-int.h + packet-ncp-nmas.h + packet-ncp-sss.h + packet-ndmp.h + packet-ndps.h + packet-netbios.h + packet-netlink.h + packet-nfs.h + packet-nisplus.h + packet-nlm.h + packet-nsh.h + packet-ntlmssp.h + packet-ntp.h + packet-nvme.h + packet-ocsp.h + packet-opensafety.h + packet-osi.h + packet-osi-options.h + packet-p1.h + packet-p22.h + packet-p7.h + packet-p772.h + packet-pcap_pktdata.h + packet-pcnfsd.h + packet-pdcp-lte.h + packet-per.h + packet-pkcs1.h + packet-pkcs12.h + packet-pkix1explicit.h + packet-pkix1implicit.h + packet-pkixac.h + packet-pkixproxy.h + packet-pkixqualified.h + packet-pkixtsp.h + packet-pkinit.h + packet-pktc.h + packet-portmap.h + packet-ppi-geolocation-common.h + packet-ppp.h + packet-pres.h + packet-ptp.h + packet-ptpip.h + packet-pw-atm.h + packet-pw-common.h + packet-q708.h + packet-q931.h + packet-q932.h + packet-qsig.h + packet-radius.h + packet-raknet.h + packet-ranap.h + packet-rdm.h + packet-rdt.h + packet-reload.h + packet-rlc-lte.h + packet-rmi.h + packet-rmt-common.h + packet-rohc.h + packet-ros.h + packet-rpc.h + packet-rquota.h + packet-rrc.h + packet-rsvp.h + packet-rtcp.h + packet-rtp.h + packet-rtps.h + packet-rtp-events.h + packet-rtse.h + packet-rtsp.h + packet-rwall.h + packet-rx.h + packet-s1ap.h + packet-s5066sis.h + packet-s7comm.h + packet-s7comm_szl_ids.h + packet-sccp.h + packet-scsi.h + packet-scsi-mmc.h + packet-scsi-osd.h + packet-scsi-sbc.h + packet-scsi-smc.h + packet-scsi-ssc.h + packet-sctp.h + packet-sdp.h + packet-ses.h + packet-sflow.h + packet-sip.h + packet-skinny.h + packet-sll.h + packet-smb.h + packet-smb2.h + packet-smb-browse.h + packet-smb-common.h + packet-smb-mailslot.h + packet-smb-pipe.h + packet-smb-sidsnooping.h + packet-smpp.h + packet-smrse.h + packet-snmp.h + packet-socketcan.h + packet-spice.h + packet-spray.h + packet-sprt.h + packet-sscop.h + packet-ssl.h + packet-ssl-utils.h + packet-stat.h + packet-stat-notify.h + packet-sv.h + packet-t124.h + packet-t30.h + packet-t38.h + packet-tacacs.h + packet-tcap.h + packet-tcp.h + packet-tetra.h + packet-tftp.h + packet-tn3270.h + packet-tn5250.h + packet-tpkt.h + packet-tr.h + packet-tte.h + packet-ua.h + packet-uaudp.h + packet-ubertooth.h + packet-udp.h + packet-umts_fp.h + packet-umts_mac.h + packet-umts_rlc.h + packet-usb.h + packet-usb-hid.h + packet-usbip.h + packet-vxlan.h + packet-wap.h + packet-wccp.h + packet-windows-common.h + packet-wlancertextn.h + packet-wps.h + packet-wsp.h + packet-wtls.h + packet-wtp.h + packet-x11.h + packet-x11-keysymdef.h + packet-x509af.h + packet-x509ce.h + packet-x509if.h + packet-x509sat.h + packet-xml.h + packet-xmpp-conference.h + packet-xmpp-core.h + packet-xmpp-gtalk.h + packet-xmpp.h + packet-xmpp-jingle.h + packet-xmpp-other.h + packet-xmpp-utils.h + packet-ypbind.h + packet-yppasswd.h + packet-ypserv.h + packet-ypxfr.h + packet-zbee.h + packet-zbee-aps.h + packet-zbee-nwk.h + packet-zbee-security.h + packet-zbee-zcl.h + packet-zbee-zdp.h + packet-ziop.h +) + set(DISSECTOR_SRC file-btsnoop.c file-elf.c @@ -1489,6 +1856,12 @@ set_target_properties(dissectors PROPERTIES COMPILE_OPTIONS "${WS_WARNINGS_C_FLAGS}" ) +if(NOT WIN32) + install(FILES ${DISSECTOR_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/epan/dissectors" + ) +endif() + set(CHECKAPI_FILE_LIST "${CMAKE_CURRENT_BINARY_DIR}/files.txt") file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") file(WRITE "${CHECKAPI_FILE_LIST}" "${DISSECTOR_FILES}" ";" "${CORBA_IDL_DISSECTOR_SRC}") diff --git a/epan/ftypes/CMakeLists.txt b/epan/ftypes/CMakeLists.txt index 50df55c34b..1ca5e213ee 100644 --- a/epan/ftypes/CMakeLists.txt +++ b/epan/ftypes/CMakeLists.txt @@ -24,6 +24,10 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) +set(FTYPE_PUBLIC_HEADERS + ftypes.h +) + set(FTYPE_FILES ftypes.c ftype-bytes.c @@ -57,6 +61,12 @@ set_target_properties(ftypes PROPERTIES COMPILE_OPTIONS "${WS_WARNINGS_C_FLAGS}" ) +if(NOT WIN32) + install(FILES ${FTYPE_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/epan/ftypes" + ) +endif() + CHECKAPI( NAME ftypes diff --git a/epan/wmem/CMakeLists.txt b/epan/wmem/CMakeLists.txt index 70d2251f27..87a077472d 100644 --- a/epan/wmem/CMakeLists.txt +++ b/epan/wmem/CMakeLists.txt @@ -24,6 +24,23 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) +set(WMEM_PUBLIC_HEADERS + wmem.h + wmem_array.h + wmem_core.h + wmem_list.h + wmem_map.h + wmem_miscutl.h + wmem_queue.h + wmem_scopes.h + wmem_stack.h + wmem_strbuf.h + wmem_strutl.h + wmem_tree.h + wmem_interval_tree.h + wmem_user_cb.h +) + set(WMEM_FILES wmem_array.c wmem_core.c @@ -70,6 +87,12 @@ set_target_properties(wmem_test PROPERTIES COMPILE_OPTIONS "${WS_WARNINGS_C_FLAGS}" ) +if(NOT WIN32) + install(FILES ${WMEM_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/epan/wmem" + ) +endif() + CHECKAPI( NAME wmem diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 45fd307e09..9bf2b6c30b 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -21,6 +21,64 @@ include(UseABICheck) +set(WSUTIL_PUBLIC_HEADERS + adler32.h + base32.h + base64.h + bits_count_ones.h + bits_ctz.h + bitswap.h + buffer.h + clopts_common.h + cmdarg_err.h + color.h + copyright_info.h + cpu_info.h + crash_info.h + crc6.h + crc7.h + crc8.h + crc10.h + crc11.h + crc16.h + crc16-plain.h + crc32.h + eax.h + filesystem.h + frequency-utils.h + g711.h + glib-compat.h + inet_addr.h + inet_ipv6.h + interface.h + jsmn.h + mpeg-audio.h + nstime.h + os_version_info.h + pint.h + plugins.h + privileges.h + processes.h + report_message.h + sign_ext.h + sober128.h + socket.h + str_util.h + strnatcmp.h + strtoi.h + tempfile.h + time_util.h + type_util.h + unicode-utils.h + utf8_entities.h + ws_cpuid.h + ws_mempbrk.h + ws_mempbrk_int.h + ws_printf.h + wsjsmn.h + xtea.h +) + set(WSUTIL_COMMON_FILES adler32.c airpdcap_wep.c @@ -247,6 +305,12 @@ if(NOT ${ENABLE_STATIC}) ) endif() +if(NOT WIN32) + install(FILES ${WSUTIL_PUBLIC_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/wsutil" + ) +endif() + # Export build-time datadir (note: the macro "DATAFILE_DIR" is defined in # config.h and points to the install-time data directory, hence the different # name).