# DAQ_FOUND, if false, do not try to link to Lua
#
# DAQ_FOUND - system has the daq
-# DAQ_INCLUDE_DIRS - the daqs include directory
+# DAQ_INCLUDE_DIR - the daqs include directory
# DAQ_LIBRARIES - the libraries needed to use the daq
#
## Copied from default CMake FindLua51.cmake
-find_path(DAQ_INCLUDE_DIRS
+find_path(DAQ_INCLUDE_DIR
NAMES daq.h
HINTS ENV DAQ_DIR
PATH_SUFFIXES daq
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DAQ
- REQUIRED_VARS DAQ_LIBRARIES DAQ_INCLUDE_DIRS
+ REQUIRED_VARS DAQ_LIBRARIES DAQ_INCLUDE_DIR
FAIL_MESSAGE "${ERROR_MESSAGE}"
)
mark_as_advanced(
- DAQ_INCLUDE_DIRS
+ DAQ_INCLUDE_DIR
DAQ_LIBRARIES
)
# The environment variable DUMBNETDIR allows to specficy where to find
# libdnet in non standard location.
#
-# DNET_INCLUDE_DIRS - where to find dnet.h, etc.
+# DNET_INCLUDE_DIR - where to find dnet.h, etc.
# DNET_LIBRARIES - List of libraries when using dnet.
# DNET_FOUND - True if dnet found.
)
-find_program(DNET_CONFIG
- NAMES dnet-config
- HINTS ENV DNET_DIR
+find_path(DNET_INCLUDE_DIR
+ NAMES dnet.h dumbnet.h
+ HINTS ENV DNETDIR
)
-# Don't search for the dnet include directories if it is already defined by the user
-if(NOT DNET_INCLUDE_DIRS)
- if(DNET_CONFIG)
- EXECUTE_PROCESS(COMMAND ${DNET_CONFIG} --cflags
- OUTPUT_VARIABLE DNET_INCLUDE_DIRS
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- else(DNET_CONFIG)
- find_path(DNET_INCLUDE_DIRS
- NAMES dnet.h dumbnet.h
- HINTS ENV DNETDIR
- )
-
- endif(DNET_CONFIG)
-endif(NOT DNET_INCLUDE_DIRS)
-
-
-# Don't search for the dnet libraries if it is already defined by the user
-if(NOT DNET_LIBRARIES)
- if(DNET_CONFIG)
- EXECUTE_PROCESS(COMMAND ${DNET_CONFIG} --libs
- OUTPUT_VARIABLE DNET_LIBRARIES
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- else(DNET_CONFIG)
- find_library(DNET_LIBRARIES
- NAMES dnet dumbnet
- HINTS ENV DNETDIR
- )
-
- endif(DNET_CONFIG)
-endif(NOT DNET_LIBRARIES)
+find_library(DNET_LIBRARIES
+ NAMES dnet dumbnet
+ HINTS ENV DNETDIR
+)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DNET
- REQUIRED_VARS DNET_INCLUDE_DIRS DNET_LIBRARIES
+ REQUIRED_VARS DNET_INCLUDE_DIR DNET_LIBRARIES
FAIL_MESSAGE "${ERROR_MESSAGE}"
)
mark_as_advanced(
- DNET_INCLUDE_DIRS
+ DNET_INCLUDE_DIR
DNET_LIBRARIES
)
-unset(DNET_CONFIG CACHE)
# This module defines
# LUAJIT_FOUND, if false, do not try to link to Lua
# LUAJIT_LIBRARIES
-# LUAJIT_INCLUDE_DIRS, where to find lua.h
+# LUAJIT_INCLUDE_DIR, where to find lua.h
# LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
## Copied from default CMake FindLua51.cmake
)
-find_path(LUAJIT_INCLUDE_DIRS
+find_path(LUAJIT_INCLUDE_DIR
NAMES luajit.h
HINTS ENV LUA_DIR
PATH_SUFFIXES include include/luajit-2.0
endif()
-if(LUAJIT_INCLUDE_DIRS AND EXISTS "${LUAJIT_INCLUDE_DIRS}/luajit.h")
- file(STRINGS "${LUAJIT_INCLUDE_DIRS}/luajit.h" luajit_version_str REGEX "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT .+\"")
+if(LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/luajit.h")
+ file(STRINGS "${LUAJIT_INCLUDE_DIR}/luajit.h" luajit_version_str REGEX "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT .+\"")
string(REGEX REPLACE "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${luajit_version_str}")
unset(luajit_version_str)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args(LuaJIT
- REQUIRED_VARS LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIRS
+ REQUIRED_VARS LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR
VERSION_VAR LUAJIT_VERSION_STRING
FAIL_MESSAGE "${ERROR_MESSAGE}"
)
mark_as_advanced(
- LUAJIT_INCLUDE_DIRS
+ LUAJIT_INCLUDE_DIR
LUAJIT_LIBRARIES
MATH_LIBRARY
)
# Variables defined by this module:
#
# PCAP_FOUND System has libpcap, include and library dirs found
-# PCAP_INCLUDE_DIRS The libpcap include directories.
+# PCAP_INCLUDE_DIR The libpcap include directories.
# PCAP_LIBRARIES The libpcap library (possibly includes a thread
# library e.g. required by pf_ring's libpcap)
# HAVE_LIBPFRING If a found version of libpcap supports PF_RING
shared library that may be installed in an unusual place"
)
-find_program(PCAP_CONFIG
- NAMES pcap-config
- HINTS ENV PCAP_DIR
-)
-
-if(NOT PCAP_INCLUDE_DIRS)
- if (PCAP_CONFIG)
- EXECUTE_PROCESS(COMMAND ${PCAP_CONFIG} --cflags
- OUTPUT_VARIABLE PCAP_INCLUDE_DIRS
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- else()
- find_path(PCAP_INCLUDE_DIRS
- NAMES pcap.h
- )
-
- endif()
-endif()
-
-if(NOT PCAP_LIBRARIES)
- if (PCAP_CONFIG)
- EXECUTE_PROCESS(
- COMMAND pcap-config --libs
- RESULT_VARIABLE exit_code
- OUTPUT_VARIABLE PCAP_LIBRARIES
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- else()
-
- find_library(PCAP_LIBRARIES
- NAMES pcap
- )
- endif()
+find_path(PCAP_INCLUDE_DIR
+ NAMES pcap.h
+)
- set (PCAP_LIBRARIES "${PCAP_LIBRARIES}" CACHE PATH "libpcap library directory")
-endif()
+find_library(PCAP_LIBRARIES
+ NAMES pcap
+)
# foo to ensure PCAP compiles
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCAP
- REQUIRED_VARS PCAP_LIBRARIES PCAP_INCLUDE_DIRS
+ REQUIRED_VARS PCAP_LIBRARIES PCAP_INCLUDE_DIR
FAIL_MESSAGE ${ERROR_MESSAGE}
)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(
- PCAP_INCLUDE_DIRS
+ PCAP_INCLUDE_DIR
PCAP_LIBRARIES
)
unset(PCAP_CONFIG CACHE)
# - Find pcre
# Find the native PCRE includes and library
#
-# PCRE_INCLUDE_DIRS - where to find pcre.h, etc.
+# PCRE_INCLUDE_DIR - where to find pcre.h, etc.
# PCRE_LIBRARIES - List of libraries when using pcre.
# PCRE_FOUND - True if pcre found.
\tGet it from http://www.pcre.org\n"
)
-find_program(PCRE_CONFIG
- NAMES pcre-config
- HINTS ENV PCRE_DIR
+find_path(PCRE_INCLUDE_DIR
+ NAMES pcre.h
)
-
-
-if (NOT PCRE_INCLUDE_DIRS)
- if(PCRE_CONFIG)
- execute_process(COMMAND ${PCRE_CONFIG} --cflags
- OUTPUT_VARIABLE PCRE_INCLUDE_DIRS
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- else(PCRE_CONFIG)
- find_path(PCRE_INCLUDE_DIRS
- NAMES pcre.h
- )
-
- endif(PCRE_CONFIG)
-endif(NOT PCRE_INCLUDE_DIRS)
-
-
-if (NOT PCRE_LIBRARIES)
- if(PCRE_CONFIG)
- execute_process(COMMAND ${PCRE_CONFIG} --libs
- OUTPUT_VARIABLE PCRE_LIBRARIES
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- else(PCRE_CONFIG)
- find_path(PCRE_LIBRARIES
- NAMES pcre
- )
-
- endif(PCRE_CONFIG)
-endif(NOT PCRE_LIBRARIES)
-
+find_library(PCRE_LIBRARIES
+ NAMES pcre
+)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCRE
- REQUIRED_VARS PCRE_LIBRARIES PCRE_INCLUDE_DIRS
+ REQUIRED_VARS PCRE_INCLUDE_DIR PCRE_LIBRARIES
FAIL_MESSAGE "${ERROR_MESSAGE}"
)
-
-
-include (CheckLibraryExists)
-check_library_exists(pcre pcre_compile ${PCRE_LIBRARIES} MIN_VERSION_SIX)
-
message(STATUS "MUST BE AT LEAST VERSION SIX")
message(STATUS "Create test to check PCRE version")
mark_as_advanced(
PCRE_LIBRARIES
- PCRE_INCLUDE_DIRS
+ PCRE_INCLUDE_DIR
)
-unset(PCRE_CONFIG CACHE)
set(MAKE_PDF_DOC "OFF" CACHE BOOL ${MAKE_PDF_DOC_HELP_STRING})
endif()
-if (${CMAKE_GENERATOR} MATCHES Xcode)
+if ("${CMAKE_GENERATOR}" MATCHES "Xcode")
get_property(MAKE_HTML_DOC_HELP_STRING CACHE "MAKE_HTML_DOC" PROPERTY HELPSTRING)
set(MAKE_HTML_DOC "OFF" CACHE BOOL ${MAKE_HTML_DOC_HELP_STRING})
get_property(MAKE_PDF_DOC_HELP_STRING CACHE "MAKE_PDF_DOC" PROPERTY HELPSTRING)
reference.lua
)
-install (FILES ${EXTRA_DIST_BINARY_PATH}
+install (FILES ${LUA_SCRIPTS}
DESTINATION "conf"
)
+set(ENV{LUA_PATH} "${CMAKE_INSTALL_PREFIX}/include/snort/lua/?.lua\;\;")
# ... include everything because I'm not correcting
# every files include
-include_directories(${DAQ_INCLUDE_DIRS})
-include_directories(${LUA_INCLUDE_DIRS})
-include_directories(${PCAP_INCLUDES})
-include_directories(${PCRE_INCLUDE_DIRS})
-include_directories(${LUAJIT_INCLUDE_DIRS})
+include_directories(${DAQ_INCLUDE_DIR})
+include_directories(${PCAP_INCLUDE_DIR})
+include_directories(${PCRE_INCLUDE_DIR})
+include_directories(${LUAJIT_INCLUDE_DIR})
+include_directories(${DNET_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(control)
include_directories(detection)
${OPENSSL_CRYPTO_LIBRARY}
${LUAJIT_LIBRARIES}
${DAQ_LIBRARIES}
+ ${DNET_LIBRARIES}
)
#
##############################################################################
-set(TARGET_DIR ${CMAKE_BINARY_DIR})
-set(file builtin.txt)
+if (MAKE_PDF_DOC OR MAKE_HTML_DOC)
-set(output ${TARGET_DIR}/${file})
-add_custom_command(
- OUTPUT ${output}
- COMMAND snort --markup --help-builtin > ${output}
- MAIN_DEPENDENCY snort
- COMMENT "Documents: building ${output}"
-)
-get_filename_component(file_name "${file}" NAME_WE)
-add_custom_target(doc_${file_name} ALL DEPENDS ${output} )
+ set(TARGET_DIR ${CMAKE_BINARY_DIR})
-set(file commands.txt)
-set(output ${TARGET_DIR}/${file})
-add_custom_command(
- OUTPUT ${output}
- COMMAND snort --markup --help-commands > ${output}
- MAIN_DEPENDENCY snort
- COMMENT "Documents: building ${output}"
-)
-get_filename_component(file_name "${file}" NAME_WE)
-add_custom_target(doc_${file_name} ALL DEPENDS ${output} )
+ set(file builtin.txt)
+ set(output ${TARGET_DIR}/${file})
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND snort --markup --help-builtin > ${output}
+ MAIN_DEPENDENCY snort
+ COMMENT "Documents: building ${output}"
+ )
+ get_filename_component(file_name "${file}" NAME_WE)
+ add_custom_target(doc_${file_name} ALL DEPENDS ${output} )
-set(file config.txt)
+ set(file commands.txt)
-set(output ${TARGET_DIR}/${file})
-add_custom_command(
- OUTPUT ${output}
- COMMAND snort --markup --help-config > ${output}
- MAIN_DEPENDENCY snort
- COMMENT "Documents: building ${output}"
-)
-get_filename_component(file_name "${file}" NAME_WE)
-add_custom_target(doc_${file_name} ALL DEPENDS ${output})
+ set(output ${TARGET_DIR}/${file})
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND snort --markup --help-commands > ${output}
+ MAIN_DEPENDENCY snort
+ COMMENT "Documents: building ${output}"
+ )
+ get_filename_component(file_name "${file}" NAME_WE)
+ add_custom_target(doc_${file_name} ALL DEPENDS ${output} )
-set(file options.txt)
-set(output ${TARGET_DIR}/${file})
-add_custom_command(
- OUTPUT ${output}
- COMMAND snort --markup --help > ${output}
- MAIN_DEPENDENCY snort
- COMMENT "Documents: building ${output}"
-)
-get_filename_component(file_name "${file}" NAME_WE)
-add_custom_target(doc_${file_name} ALL DEPENDS ${output})
+ set(file config.txt)
+ set(output ${TARGET_DIR}/${file})
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND snort --markup --help-config > ${output}
+ MAIN_DEPENDENCY snort
+ COMMENT "Documents: building ${output}"
+ )
+ get_filename_component(file_name "${file}" NAME_WE)
+ add_custom_target(doc_${file_name} ALL DEPENDS ${output})
-set(file gids.txt)
-set(output ${TARGET_DIR}/${file})
-add_custom_command(
- OUTPUT ${output}
- COMMAND snort --markup --help-gids > ${output}
- MAIN_DEPENDENCY snort
- COMMENT "Documents: building ${output}"
-)
-get_filename_component(file_name "${file}" NAME_WE)
-add_custom_target(doc_${file_name} ALL DEPENDS ${output})
+ set(file options.txt)
+
+ set(output ${TARGET_DIR}/${file})
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND snort --markup --help > ${output}
+ MAIN_DEPENDENCY snort
+ COMMENT "Documents: building ${output}"
+ )
+ get_filename_component(file_name "${file}" NAME_WE)
+ add_custom_target(doc_${file_name} ALL DEPENDS ${output})
+
+ set(file gids.txt)
+
+ set(output ${TARGET_DIR}/${file})
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND snort --markup --help-gids > ${output}
+ MAIN_DEPENDENCY snort
+ COMMENT "Documents: building ${output}"
+ )
+ get_filename_component(file_name "${file}" NAME_WE)
+ add_custom_target(doc_${file_name} ALL DEPENDS ${output})
+endif()
-include_directories(${LUAJIT_INCLUDE_DIRS})
+include_directories(${LUAJIT_INCLUDE_DIR})
SET( PLUGIN_LIST
ips_ack.cc
-include_directories(${LUAJIT_INCLUDE_DIRS})
+include_directories(${LUAJIT_INCLUDE_DIR})
set ( LOGGER_SOURCES
loggers.cc
-include_directories(${LUAJIT_INCLUDE_DIRS})
+include_directories(${LUAJIT_INCLUDE_DIR})
set (LUA_INCLUDES
snort_config.lua
-message("\ttest")
-
if ( TESTING_ENABLED )