osquery-1/osquery/events/CMakeLists.txt
2015-07-30 14:36:46 -07:00

64 lines
1.8 KiB
CMake

if(APPLE)
ADD_OSQUERY_LINK(FALSE "-framework CoreServices")
ADD_OSQUERY_LINK(FALSE "-framework SystemConfiguration")
ADD_OSQUERY_LINK(FALSE "-framework IOKit")
ADD_OSQUERY_LINK(FALSE "-framework DiskArbitration")
ADD_OSQUERY_LIBRARY(FALSE osquery_events_darwin
darwin/fsevents.cpp
darwin/iokit_hid.cpp
darwin/diskarbitration.cpp
darwin/scnetwork.cpp
darwin/kernel_util.cpp
)
elseif(FREEBSD)
ADD_OSQUERY_LIBRARY(FALSE osquery_events_freebsd
freebsd/kernel_util.cpp
)
else()
ADD_OSQUERY_LINK(FALSE "udev")
ADD_OSQUERY_LIBRARY(FALSE osquery_events_linux
linux/inotify.cpp
linux/udev.cpp
linux/kernel_util.cpp
)
endif()
ADD_OSQUERY_LIBRARY(TRUE osquery_events
events.cpp
)
file(GLOB OSQUERY_EVENTS_TESTS "tests/*.cpp")
ADD_OSQUERY_TEST(TRUE ${OSQUERY_EVENTS_TESTS})
file(GLOB OSQUERY_EVENTS_BENCHMARKS "benchmarks/*.cpp")
ADD_OSQUERY_BENCHMARK(${OSQUERY_EVENTS_BENCHMARKS})
# Kernel-related userland code.
file(GLOB OSQUERY_EVENTS_KERNEL "kernel/*.cpp")
ADD_OSQUERY_LIBRARY(FALSE osquery_events_kernel
kernel.cpp
${OSQUERY_EVENTS_KERNEL}
)
# Special kernel test define when building non-SDK and non-Release.
if(NOT OSQUERY_BUILD_RELEASE AND NOT OSQUERY_BUILD_SDK_ONLY)
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})
file(GLOB OSQUERY_EVENTS_KERNEL_BENCHMARKS "kernel/benchmarks/*.cpp")
ADD_OSQUERY_KERNEL_BENCHMARK(${OSQUERY_EVENTS_KERNEL_BENCHMARKS})
if(APPLE)
file(GLOB OSQUERY_DARWIN_EVENTS_TESTS "darwin/tests/*.cpp")
ADD_OSQUERY_TEST(FALSE ${OSQUERY_DARWIN_EVENTS_TESTS})
elseif(LINUX)
file(GLOB OSQUERY_LINUX_EVENTS_TESTS "linux/tests/*.cpp")
ADD_OSQUERY_TEST(FALSE ${OSQUERY_LINUX_EVENTS_TESTS})
endif()