2014-09-19 08:54:33 +00:00
|
|
|
if(APPLE)
|
2016-03-15 02:51:03 +00:00
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework CoreServices")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework SystemConfiguration")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework IOKit")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("-framework DiskArbitration")
|
2014-09-19 08:54:33 +00:00
|
|
|
|
2015-08-16 03:43:53 +00:00
|
|
|
|
|
|
|
file(GLOB OSQUERY_EVENTS_DARWIN "darwin/*.cpp")
|
|
|
|
ADD_OSQUERY_LIBRARY(FALSE osquery_events_darwin ${OSQUERY_EVENTS_DARWIN})
|
2014-11-07 15:33:16 +00:00
|
|
|
elseif(FREEBSD)
|
2015-08-16 03:43:53 +00:00
|
|
|
file(GLOB OSQUERY_EVENTS_FREEBSD "freebsd/*.cpp")
|
|
|
|
ADD_OSQUERY_LIBRARY(FALSE osquery_events_freebsd ${OSQUERY_EVENTS_FREEBSD})
|
2014-09-19 08:54:33 +00:00
|
|
|
else()
|
2016-03-15 02:51:03 +00:00
|
|
|
# See the root CMakeLists for SYSTEMD detection.
|
|
|
|
# The udev library link is not available without systemd-devel.
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("udev")
|
|
|
|
ADD_OSQUERY_LINK_ADDITIONAL("audit")
|
2014-12-24 04:07:12 +00:00
|
|
|
|
2015-08-16 03:43:53 +00:00
|
|
|
file(GLOB OSQUERY_EVENTS_LINUX "linux/*.cpp")
|
|
|
|
ADD_OSQUERY_LIBRARY(FALSE osquery_events_linux ${OSQUERY_EVENTS_LINUX})
|
2014-09-19 08:54:33 +00:00
|
|
|
endif()
|
|
|
|
|
2015-02-03 05:21:36 +00:00
|
|
|
ADD_OSQUERY_LIBRARY(TRUE osquery_events
|
2014-09-19 08:54:33 +00:00
|
|
|
events.cpp
|
2015-06-30 21:16:43 +00:00
|
|
|
)
|
|
|
|
|
2015-06-30 21:20:04 +00:00
|
|
|
file(GLOB OSQUERY_EVENTS_TESTS "tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TEST(TRUE ${OSQUERY_EVENTS_TESTS})
|
|
|
|
|
2015-07-28 09:02:31 +00:00
|
|
|
file(GLOB OSQUERY_EVENTS_BENCHMARKS "benchmarks/*.cpp")
|
|
|
|
ADD_OSQUERY_BENCHMARK(${OSQUERY_EVENTS_BENCHMARKS})
|
|
|
|
|
2015-07-16 22:23:29 +00:00
|
|
|
# Kernel-related userland code.
|
|
|
|
file(GLOB OSQUERY_EVENTS_KERNEL "kernel/*.cpp")
|
|
|
|
ADD_OSQUERY_LIBRARY(FALSE osquery_events_kernel
|
2015-06-30 21:16:43 +00:00
|
|
|
kernel.cpp
|
2015-07-16 22:23:29 +00:00
|
|
|
${OSQUERY_EVENTS_KERNEL}
|
2014-09-19 08:54:33 +00:00
|
|
|
)
|
|
|
|
|
2015-07-17 20:32:40 +00:00
|
|
|
# Special kernel test define when building non-SDK and non-Release.
|
|
|
|
if(NOT OSQUERY_BUILD_RELEASE AND NOT OSQUERY_BUILD_SDK_ONLY)
|
2015-07-16 22:23:29 +00:00
|
|
|
set_target_properties(osquery_events_kernel
|
|
|
|
PROPERTIES COMPILE_DEFINITIONS "KERNEL_TEST=1")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(GLOB OSQUERY_EVENTS_KERNEL_TESTS "kernel/tests/*.cpp")
|
|
|
|
ADD_OSQUERY_KERNEL_TEST(${OSQUERY_EVENTS_KERNEL_TESTS})
|
2014-09-19 08:54:33 +00:00
|
|
|
|
2015-07-23 23:42:46 +00:00
|
|
|
file(GLOB OSQUERY_EVENTS_KERNEL_BENCHMARKS "kernel/benchmarks/*.cpp")
|
|
|
|
ADD_OSQUERY_KERNEL_BENCHMARK(${OSQUERY_EVENTS_KERNEL_BENCHMARKS})
|
|
|
|
|
2014-09-19 08:54:33 +00:00
|
|
|
if(APPLE)
|
2015-04-27 09:12:58 +00:00
|
|
|
file(GLOB OSQUERY_DARWIN_EVENTS_TESTS "darwin/tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TEST(FALSE ${OSQUERY_DARWIN_EVENTS_TESTS})
|
2014-11-16 20:27:45 +00:00
|
|
|
elseif(LINUX)
|
2015-04-27 09:12:58 +00:00
|
|
|
file(GLOB OSQUERY_LINUX_EVENTS_TESTS "linux/tests/*.cpp")
|
|
|
|
ADD_OSQUERY_TEST(FALSE ${OSQUERY_LINUX_EVENTS_TESTS})
|
2014-09-19 08:54:33 +00:00
|
|
|
endif()
|