project (snort)

set(snortGeneratedDest "${CMAKE_CURRENT_BINARY_DIR}/generated")

set (copyFiles
	dynamic-plugins/sf_engine/sf_snort_packet.h
	dynamic-plugins/sf_engine/sf_snort_plugin_api.h
)

foreach (srcFile ${copyFiles})
	get_filename_component(destFile ${srcFile} NAME)
	set (destFile ${snortGeneratedDest}/${destFile})

	add_custom_command(
		OUTPUT ${destFile}
		COMMAND "${CMAKE_COMMAND}" -E make_directory ${snortGeneratedDest}
		COMMAND "${CMAKE_COMMAND}" -E copy "${snortSrcRoot}/${srcFile}" "${snortGeneratedDest}"
		DEPENDS ${snortSrcRoot}/${srcFile}
	)

	set (generatedFiles ${generatedFiles} ${destFile})
endforeach (srcFile ${copyFiles})

add_custom_command(OUTPUT ${snortGeneratedDest}/sf_snort_plugin_hdropts.c
	COMMAND "${CMAKE_COMMAND}" -E make_directory ${snortGeneratedDest}
	COMMAND "${sedCommand}" -e \"s/_ded.errMsg/ErrorMessage/g\" -e \"s/sf_snort_packet.h/decode.h/g\" -e \"s/SFSnortPacket/Packet/g\" -e \"s/ip4_header/iph/g\" -e \"s/tcp_header/tcph/g\" -e \"s/proto/ip_proto/g\" -e \"s/type_service/ip_tos/g\" -e \"s/time_to_live/ip_ttl/g\" -e \"s/num_ip_options/ip_option_count/g\" -e \"s/IPOptions/Options/g\" -e \"s/option_code/code/g\" -e  \"s/acknowledgement/th_ack/g\" -e \"s/sequence/th_seq/g\" -e \"s/tcph->flags/tcph->th_flags/g\" -e \"s/tcph->window/tcph->th_win/g\" -e \"s/num_tcp_options/tcp_option_count/g\" -e \"s/icmp_header/icmph/g\" -e \"s/ICMP_ECHO_REPLY/ICMP_ECHOREPLY/g\" -e \"s/ICMP_ECHO_REQUEST/ICMP_ECHO/g\" -e \"s/icmph_union.echo.id/s_icmp_id/g\" -e \"s/icmph_union.echo.seq/s_icmp_seq/g\" "\"${snortSrcRoot}/dynamic-plugins/sf_engine/sf_snort_plugin_hdropts.c\"" > "\"${snortGeneratedDest}/sf_snort_plugin_hdropts.c\""
)

set (generatedFiles ${generatedFiles} ${snortGeneratedDest}/sf_snort_plugin_hdropts.c)

add_custom_command(
	OUTPUT ${snortGeneratedDest}/sf_attribute_table.c ${snortGeneratedDest}/sf_attribute_table.h 
	COMMAND "${CMAKE_COMMAND}" -E make_directory ${snortGeneratedDest}
	COMMAND "${bisonCommand}" -d -psfat_ -o"\"${snortGeneratedDest}/sf_attribute_table.c\"" "\"${snortSrcRoot}/target-based/sf_attribute_table.y\""
	DEPENDS ${snortSrcRoot}/target-based/sf_attribute_table.y
)

add_custom_command(
	OUTPUT ${snortGeneratedDest}/sf_attribute_table_parser.c
	COMMAND "${CMAKE_COMMAND}" -E make_directory ${snortGeneratedDest}
	COMMAND "${flexCommand}" -i -Psfat -o"\"${snortGeneratedDest}/sf_attribute_table_parser.c\"" "\"${snortSrcRoot}/target-based/sf_attribute_table_parser.l\""
	DEPENDS ${snortSrcRoot}/target-based/sf_attribute_table_parser.l
)

set (generatedFiles ${generatedFiles} ${snortGeneratedDest}/sf_attribute_table_parser.c ${snortGeneratedDest}/sf_attribute_table.c ${snortGeneratedDest}/sf_attribute_table.h)
set_source_files_properties(${generatedFiles} PROPERTIES GENERATED true)

KERIO_TARGET(snort executable)

set (detectionPluginsSrc
	detection-plugins/detection_options.c
	detection-plugins/detection_options.h
	detection-plugins/sp_asn1.c
	detection-plugins/sp_asn1.h
	detection-plugins/sp_asn1_detect.c
	detection-plugins/sp_asn1_detect.h
	detection-plugins/sp_byte_check.c
	detection-plugins/sp_byte_check.h
	detection-plugins/sp_byte_jump.c
	detection-plugins/sp_byte_jump.h
	detection-plugins/sp_clientserver.c
	detection-plugins/sp_clientserver.h
	detection-plugins/sp_cvs.c
	detection-plugins/sp_cvs.h
	detection-plugins/sp_dsize_check.c
	detection-plugins/sp_dsize_check.h
	detection-plugins/sp_flowbits.c
	detection-plugins/sp_flowbits.h
	detection-plugins/sp_ftpbounce.c
	detection-plugins/sp_ftpbounce.h
	detection-plugins/sp_hdr_opt_wrap.c
	detection-plugins/sp_hdr_opt_wrap.h
	detection-plugins/sp_icmp_code_check.c
	detection-plugins/sp_icmp_code_check.h
	detection-plugins/sp_icmp_id_check.c
	detection-plugins/sp_icmp_id_check.h
	detection-plugins/sp_icmp_seq_check.c
	detection-plugins/sp_icmp_seq_check.h
	detection-plugins/sp_icmp_type_check.c
	detection-plugins/sp_icmp_type_check.h
	detection-plugins/sp_ip_fragbits.c
	detection-plugins/sp_ip_fragbits.h
	detection-plugins/sp_ip_id_check.c
	detection-plugins/sp_ip_id_check.h
	detection-plugins/sp_ip_proto.c
	detection-plugins/sp_ip_proto.h
	detection-plugins/sp_ip_same_check.c
	detection-plugins/sp_ip_same_check.h
	detection-plugins/sp_ip_tos_check.c
	detection-plugins/sp_ip_tos_check.h
	detection-plugins/sp_ipoption_check.c
	detection-plugins/sp_ipoption_check.h
	detection-plugins/sp_isdataat.c
	detection-plugins/sp_isdataat.h
	detection-plugins/sp_pattern_match.c
	detection-plugins/sp_pattern_match.h
	detection-plugins/sp_pcre.c
	detection-plugins/sp_pcre.h
	detection-plugins/sp_react.c
	detection-plugins/sp_react.h
	detection-plugins/sp_replace.c
	detection-plugins/sp_replace.h
	detection-plugins/sp_respond.h
	detection-plugins/sp_rpc_check.c
	detection-plugins/sp_rpc_check.h
	detection-plugins/sp_session.c
	detection-plugins/sp_session.h
	detection-plugins/sp_tcp_ack_check.c
	detection-plugins/sp_tcp_ack_check.h
	detection-plugins/sp_tcp_flag_check.c
	detection-plugins/sp_tcp_flag_check.h
	detection-plugins/sp_tcp_seq_check.c
	detection-plugins/sp_tcp_seq_check.h
	detection-plugins/sp_tcp_win_check.c
	detection-plugins/sp_tcp_win_check.h
	detection-plugins/sp_ttl_check.c
	detection-plugins/sp_ttl_check.h
	detection-plugins/sp_urilen_check.c
	detection-plugins/sp_urilen_check.h
# since 2.9.5.6
	detection-plugins/sp_base64_data.c
	detection-plugins/sp_base64_data.h
	detection-plugins/sp_base64_decode.c
	detection-plugins/sp_base64_decode.h
	detection-plugins/sp_byte_extract.c
	detection-plugins/sp_byte_extract.h
	detection-plugins/sp_file_data.c
	detection-plugins/sp_file_data.h
	detection-plugins/sp_pkt_data.c
	detection-plugins/sp_pkt_data.h
	detection-plugins/sp_respond3.c
)
source_group("Detection Plugins" FILES ${detectionPluginsSrc} ${snortGeneratedDest}/sf_snort_plugin_hdropts.c)

set (dynamicPluginsSrc
	dynamic-plugins/sf_convert_dynamic.c
	dynamic-plugins/sf_convert_dynamic.h
	dynamic-plugins/sf_dynamic_common.h
	dynamic-plugins/sf_dynamic_detection.h
	dynamic-plugins/sf_dynamic_engine.h
	dynamic-plugins/sf_dynamic_meta.h
	dynamic-plugins/sf_dynamic_plugins.c
	dynamic-plugins/sf_dynamic_preprocessor.h
	dynamic-plugins/sp_dynamic.c
	dynamic-plugins/sp_dynamic.h
	dynamic-plugins/sp_preprocopt.c
	dynamic-plugins/sp_preprocopt.h
# since 2.9.5.6
	dynamic-plugins/sf_dynamic_side_channel.h
)
source_group("Dynamic Plugins" FILES ${dynamicPluginsSrc})

set (outputPluginsSrc
	output-plugins/spo_alert_fast.c
	output-plugins/spo_alert_fast.h
	output-plugins/spo_alert_full.c
	output-plugins/spo_alert_full.h
	output-plugins/spo_alert_sf_socket.c
	output-plugins/spo_alert_sf_socket.h
	output-plugins/spo_alert_syslog.c
	output-plugins/spo_alert_syslog.h
	output-plugins/spo_alert_test.c
	output-plugins/spo_alert_test.h
	output-plugins/spo_alert_unixsock.c
	output-plugins/spo_alert_unixsock.h
	output-plugins/spo_csv.c
	output-plugins/spo_csv.h
	output-plugins/spo_log_ascii.c
	output-plugins/spo_log_ascii.h
	output-plugins/spo_log_null.c
	output-plugins/spo_log_null.h
	output-plugins/spo_log_tcpdump.c
	output-plugins/spo_log_tcpdump.h
	output-plugins/spo_unified2.c
	output-plugins/spo_unified2.h
)
source_group("Output Plugins" FILES ${outputPluginsSrc})

set (parserSrc
	parser/IpAddrSet.c
	parser/IpAddrSet.h
)
source_group("Parser" FILES ${parserSrc})

set (preprocessorsSrc
# preprocessors/HttpInspect
	preprocessors/HttpInspect/anomaly_detection/hi_ad.c
	preprocessors/HttpInspect/client/hi_client.c
	preprocessors/HttpInspect/client/hi_client_norm.c
	preprocessors/HttpInspect/event_output/hi_eo_log.c
	preprocessors/HttpInspect/include/hi_ad.h
	preprocessors/HttpInspect/include/hi_client.h
	preprocessors/HttpInspect/include/hi_client_norm.h
	preprocessors/HttpInspect/include/hi_eo.h
	preprocessors/HttpInspect/include/hi_eo_events.h
	preprocessors/HttpInspect/include/hi_eo_log.h
	preprocessors/HttpInspect/include/hi_include.h
	preprocessors/HttpInspect/include/hi_mi.h
	preprocessors/HttpInspect/include/hi_norm.h
	preprocessors/HttpInspect/include/hi_return_codes.h
	preprocessors/HttpInspect/include/hi_server.h
	preprocessors/HttpInspect/include/hi_si.h
	preprocessors/HttpInspect/include/hi_ui_config.h
	preprocessors/HttpInspect/include/hi_ui_iis_unicode_map.h
	preprocessors/HttpInspect/include/hi_ui_server_lookup.h
	preprocessors/HttpInspect/include/hi_util.h
	preprocessors/HttpInspect/include/hi_util_hbm.h
	preprocessors/HttpInspect/include/hi_util_kmap.h
	preprocessors/HttpInspect/include/hi_util_xmalloc.h
	preprocessors/HttpInspect/mode_inspection/hi_mi.c
	preprocessors/HttpInspect/normalization/hi_norm.c
#	preprocessors/HttpInspect/server/hi_server.c
	preprocessors/HttpInspect/session_inspection/hi_si.c
	preprocessors/HttpInspect/user_interface/hi_ui_config.c
	preprocessors/HttpInspect/user_interface/hi_ui_iis_unicode_map.c
	preprocessors/HttpInspect/user_interface/hi_ui_server_lookup.c
	preprocessors/HttpInspect/utils/hi_util_hbm.c
	preprocessors/HttpInspect/utils/hi_util_kmap.c
	preprocessors/HttpInspect/utils/hi_util_xmalloc.c
# preprocessors/HttpInspect since 2.9.5.6
	preprocessors/HttpInspect/include/hi_client_stateful.h
	preprocessors/HttpInspect/include/hi_cmd_lookup.h
	preprocessors/HttpInspect/include/hi_paf.h
	preprocessors/HttpInspect/include/hi_reqmethod_check.h
	preprocessors/HttpInspect/include/hi_server_norm.h
	preprocessors/HttpInspect/include/hi_stateful_inspect.h
	preprocessors/HttpInspect/include/hi_uri.h
	preprocessors/HttpInspect/server/hi_server_norm.c
	preprocessors/HttpInspect/utils/hi_cmd_lookup.c
	preprocessors/HttpInspect/utils/hi_paf.c
# preprocessors/Stream5
	preprocessors/Stream5/snort_stream5_icmp.c
	preprocessors/Stream5/snort_stream5_icmp.h
	preprocessors/Stream5/snort_stream5_session.c
	preprocessors/Stream5/snort_stream5_session.h
	preprocessors/Stream5/snort_stream5_tcp.c
	preprocessors/Stream5/snort_stream5_tcp.h
	preprocessors/Stream5/snort_stream5_udp.c
	preprocessors/Stream5/snort_stream5_udp.h
	preprocessors/Stream5/stream5_common.c
	preprocessors/Stream5/stream5_common.h
# preprocessors/Stream5 since 2.9.5.6
	preprocessors/Stream5/snort_stream5_ip.c
	preprocessors/Stream5/snort_stream5_ip.h
#	preprocessors/Stream5/stream5_ha.c
	preprocessors/Stream5/stream5_ha.h
	preprocessors/Stream5/stream5_paf.c
	preprocessors/Stream5/stream5_paf.h
# preprocessors
	preprocessors/perf-base.c
	preprocessors/perf-base.h
	preprocessors/perf-event.c
	preprocessors/perf-event.h
	preprocessors/perf-flow.c
	preprocessors/perf-flow.h
	preprocessors/perf.c
	preprocessors/perf.h
	preprocessors/portscan.c
	preprocessors/portscan.h
	preprocessors/sfprocpidstats.c
	preprocessors/sfprocpidstats.h
	preprocessors/snort_httpinspect.c
	preprocessors/snort_httpinspect.h
	preprocessors/spp_arpspoof.c
	preprocessors/spp_arpspoof.h
	preprocessors/spp_bo.c
	preprocessors/spp_bo.h
	preprocessors/spp_frag3.c
	preprocessors/spp_frag3.h
	preprocessors/spp_httpinspect.c
	preprocessors/spp_httpinspect.h
	preprocessors/spp_perfmonitor.c
	preprocessors/spp_perfmonitor.h
	preprocessors/spp_rpc_decode.c
	preprocessors/spp_rpc_decode.h
	preprocessors/spp_sfportscan.c
	preprocessors/spp_sfportscan.h
	preprocessors/spp_stream5.c
	preprocessors/spp_stream5.h
	preprocessors/str_search.c
	preprocessors/str_search.h
	preprocessors/stream_api.c
	preprocessors/stream_api.h
# preprocessors since 2.9.5.6
	preprocessors/normalize.c
	preprocessors/normalize.h
	preprocessors/spp_normalize.c
	preprocessors/spp_normalize.h
	preprocessors/stream_expect.c
	preprocessors/stream_expect.h
)
source_group("Preprocessors" FILES ${preprocessorsSrc})

set (sfUtilSrc
	sfutil/acsmx.c
	sfutil/acsmx.h
	sfutil/acsmx2.c
	sfutil/acsmx2.h
	sfutil/asn1.c
	sfutil/asn1.h
	sfutil/bitop.h
	sfutil/bitop_funcs.h
	sfutil/bnfa_search.c
	sfutil/bnfa_search.h
	event_queue.c
	event_queue.h
	sfutil/getopt.h
	sfutil/getopt1.h
	sfutil/getopt_long.c
	sfutil/ipobj.c
	sfutil/ipobj.h
	sfutil/mpse.c
	sfutil/mpse.h
	sfutil/sf_ip.c
	sfutil/sf_ip.h
	sfutil/sf_iph.c
	sfutil/sf_ipvar.c
	sfutil/sf_ipvar.h
	sfutil/sf_textlog.c
	sfutil/sf_textlog.h
	sfutil/sf_vartable.c
	sfutil/sf_vartable.h
	sfutil/sfActionQueue.c
	sfutil/sfActionQueue.h
	sfutil/sfeventq.c
	sfutil/sfeventq.h
	sfutil/sfghash.c
	sfutil/sfghash.h
	sfutil/sfhashfcn.c
	sfutil/sfhashfcn.h
	sfutil/sfksearch.c
	sfutil/sfksearch.h
	sfutil/sflsq.c
	sfutil/sflsq.h
	sfutil/sfmemcap.c
	sfutil/sfmemcap.h
	sfutil/sfPolicy.c
	sfutil/sfPolicy.h
	sfutil/sfPolicyUserData.c
	sfutil/sfPolicyUserData.h
	sfutil/sfportobject.c
	sfutil/sfportobject.h
	sfutil/sfprimetable.c
	sfutil/sfprimetable.h
	sfutil/sfrf.c
	sfutil/sfrf.h
	sfutil/sfrim.c
	sfutil/sfrim.h
	sfutil/sfrt.c
	sfutil/sfrt.h
	sfutil/sfrt_dir.c
	sfutil/sfrt_dir.h
	sfutil/sfrt_trie.h
	sfutil/sfsnprintfappend.c
	sfutil/sfsnprintfappend.h
	sfutil/sfthd.c
	sfutil/sfthd.h
	sfutil/sfxhash.c
	sfutil/sfxhash.h
	sfutil/util_math.c
	sfutil/util_math.h
	sfutil/util_net.c
	sfutil/util_net.h
	sfutil/util_str.c
	sfutil/util_str.h
# since 2.9.5.6
#	sfutil/intel-soft-cpm.c
#	sfutil/intel-soft-cpm.h
	sfutil/segment_mem.c
	sfutil/segment_mem.h
	sfutil/sf_base64decode.c
	sfutil/sf_base64decode.h
	sfutil/sf_email_attach_decode.c
	sfutil/sf_email_attach_decode.h
	sfutil/sfPolicyData.h
	sfutil/sfrt_flat.c
	sfutil/sfrt_flat_dir.c
	sfutil/sfrt_flat_dir.h
	sfutil/sfrt_flat.h
	sfutil/sf_seqnums.h
	sfutil/strvec.c
	sfutil/strvec.h
	sfutil/Unified2_common.h
	sfutil/util_jsnorm.c
	sfutil/util_jsnorm.h
	sfutil/util_unfold.c
	sfutil/util_unfold.h
	sfutil/util_utf.c
	sfutil/util_utf.h
)
source_group("sfUtilSrc" FILES ${sfUtilSrc})

set (targetBasedSrc
	target-based/sftarget_hostentry.c
	target-based/sftarget_hostentry.h
	target-based/sftarget_protocol_reference.c
	target-based/sftarget_protocol_reference.h
	target-based/sftarget_reader.c
	target-based/sftarget_reader.h
#	target-based/sf_attribute_table.y
#	target-based/sf_attribute_table_parser.l
)

source_group("Target-Based" FILES 
	${targetBasedSrc}
	${snortGeneratedDest}/sf_attribute_table.c
	${snortGeneratedDest}/sf_attribute_table.h
	${snortGeneratedDest}/sf_attribute_table_parser.c
)

set (snort_SOURCES
	byte_extract.c
	byte_extract.h
	cdefs.h
	checksum.h
	debug.c
	decode.c
	decode.h
	detect.c
	detect.h
	detection_filter.c
	detection_filter.h
	event.h
	event_wrapper.c
	event_wrapper.h
	event_wrapper.h
	event_wrapper.h
	fpcreate.c
	fpcreate.h
	fpdetect.c
	fpdetect.h
	generators.h
	ipv6_port.h
	log.c
	log.h
	log_text.c
	log_text.h
	mempool.c
	mempool.h
	mstring.c
	mstring.h
	packet_time.c
	packet_time.h
	parser.c
	parser.h
	pcap_pkthdr32.h
	pcrm.c
	pcrm.h
	plugbase.c
	plugbase.h
	plugin_enum.h
	preprocids.h
	profiler.c
	profiler.h
	rate_filter.c
	rate_filter.h
	rules.h
	sf_sdlist.c
	sf_sdlist.h
	sf_types.h
	sfthreshold.c
	sfthreshold.h
	signature.c
	signature.h
	snort.c
	snort.h
	snprintf.c
	snprintf.h
	spo_plugbase.h
	strlcatu.c
	strlcatu.h
	strlcpyu.c
	strlcpyu.h
	tag.c
	tag.h
	timersub.h
	util.c
	util.h
	${detectionPluginsSrc}
	${dynamicPluginsSrc}
	${outputPluginsSrc}
	${preprocessorsSrc}
	${parserSrc}
	${sfUtilSrc}
	${targetBasedSrc}
	${resourceSrc}
	${generatedFiles}
# since 2.9.5.6
	active.c
	active.h
	detection_util.c
	detection_util.h
	encode.c
	encode.h
	file-process
	idle_processing.c
	idle_processing_funcs.h
	idle_processing.h
	obfuscation.c
	obfuscation.h
	rule_option_types.h
	sfdaq.c
	sfdaq.h
	sf_protocols.h
	sf_sdlist_types.h
	snort_bounds.h
	snort_debug.h
	treenodes.h

	dynamic-output/plugins/output_base.c
	dynamic-output/plugins/output_plugin.c
	dynamic-output/plugins/output.h
	dynamic-output/plugins/output_api.h
	dynamic-output/plugins/output_common.h
	dynamic-output/plugins/output_lib.h
	
	file-process/file_service.c
	file-process/file_service.h
	file-process/file_service_config.c
	file-process/file_service_config.h
	file-process/file_api.h
	file-process/file_mime_process.h
	file-process/file_mime_process.c
	file-process/file_resume_block.c
	file-process/file_resume_block.h
	file-process/file_mime_config.c
	file-process/file_mime_config.h
	file-process/libs/file_lib.c
	file-process/libs/file_lib.h
	file-process/libs/file_config.c
	file-process/libs/file_config.h
	file-process/libs/file_identifier.h
	file-process/libs/file_identifier.c
	file-process/libs/file_sha256.c
	file-process/libs/file_sha256.h
	
	control/sfcontrol.c
	
	preprocessors/HttpInspect/server/hi_server.c
	preprocessors/HttpInspect/server/hi_server_norm.c
)

string(REGEX REPLACE -fno-common "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
KERIO_LINK_SYSTEM_LIB(snort pcap)
KERIO_LINK_SYSTEM_LIB(snort dl)
KERIO_LINK_SYSTEM_LIB(snort nfnetlink)
KERIO_LINK_SYSTEM_LIB(snort m)
KERIO_LINK_SYSTEM_LIB(snort pthread)
KERIO_LINK_SYSTEM_LIB(snort netfilter_queue)

KERIO_ADD_INCLUDES_DIR(snort ${pcreIncludeDir})
KERIO_ADD_INCLUDES_DIR(snort .)
KERIO_ADD_INCLUDES_DIR(snort ./detection-plugins)
KERIO_ADD_INCLUDES_DIR(snort ./dynamic-plugins)
KERIO_ADD_INCLUDES_DIR(snort ./preprocessors)
KERIO_ADD_INCLUDES_DIR(snort ./preprocessors/HttpInspect/include)
KERIO_ADD_INCLUDES_DIR(snort ./preprocessors/Stream5)
KERIO_ADD_INCLUDES_DIR(snort ./sfutil)
KERIO_ADD_INCLUDES_DIR(snort ./target-based)
KERIO_ADD_INCLUDES_DIR(snort ${snortGeneratedDest})
KERIO_ADD_INCLUDES_DIR(snort ${dnetIncludeDest})
KERIO_ADD_INCLUDES_DIR(snort ${daqIncludeDest})
KERIO_ADD_INCLUDES_DIR(snort ./file-process/libs)
KERIO_ADD_INCLUDES_DIR(snort ./file-process)
KERIO_ADD_INCLUDES_DIR(snort ./control)
configHIncludeDir(${PROJECT_NAME})

add_definitions(-DPCRE_STATIC -DACTIVE_RESPONSE -DHAVE_OPENSSL_SHA -DZLIB)
KERIO_TARGET_DEP(snort daq)
KERIO_TARGET_DEP(snort dnet)
KERIO_TARGET_DEP(snort openssl)		# MaJ: snort now depends on our OpenSSL
KERIO_TARGET_DEP(snort z)			# MaJ: snort now depends on our zlib
#KERIO_TARGET_DEP(snort dynamic-output)
KERIO_TARGET_DONE (snort)
target_link_libraries(snort pcre)
