2014-08-30 10:17:52 +00:00
|
|
|
if(APPLE)
|
|
|
|
ADD_LIBRARY(osquery_tables_objc
|
2014-09-05 14:54:41 +00:00
|
|
|
../core/darwin/NSProcessInfo+PECocoaBackports.mm
|
|
|
|
system/darwin/osx_version.mm
|
2014-08-30 10:17:52 +00:00
|
|
|
)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_objc "-framework Foundation")
|
|
|
|
SET_TARGET_PROPERTIES(osquery_tables_objc PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-arc")
|
2014-08-30 10:24:35 +00:00
|
|
|
|
2014-09-05 14:54:41 +00:00
|
|
|
ADD_LIBRARY(osquery_tables_darwin
|
2014-08-30 10:46:08 +00:00
|
|
|
networking/interfaces.cpp
|
2014-08-30 10:24:35 +00:00
|
|
|
networking/listening_ports.cpp
|
|
|
|
networking/routes.cpp
|
2014-08-30 10:46:08 +00:00
|
|
|
networking/utils.cpp
|
2014-09-05 14:54:41 +00:00
|
|
|
system/darwin/apps.cpp
|
|
|
|
system/darwin/ca_certs.cpp
|
|
|
|
system/darwin/firewall.cpp
|
|
|
|
system/darwin/kextstat.cpp
|
|
|
|
system/darwin/launchd.cpp
|
|
|
|
system/darwin/nvram.cpp
|
2014-08-30 10:46:08 +00:00
|
|
|
system/processes.cpp
|
2014-09-04 22:20:28 +00:00
|
|
|
system/last.cpp
|
2014-08-30 10:24:35 +00:00
|
|
|
)
|
2014-09-05 14:54:41 +00:00
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_darwin boost_filesystem)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_darwin osquery_database)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_darwin osquery_filesystem)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_darwin "-framework IOKit -framework CoreFoundation -framework Security")
|
|
|
|
SET_TARGET_PROPERTIES(osquery_tables_darwin PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
|
|
|
else()
|
|
|
|
ADD_LIBRARY(osquery_tables_linux
|
|
|
|
system/linux/kernel_modules.cpp
|
|
|
|
)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_linux boost_filesystem)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_linux osquery_database)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables_linux osquery_filesystem)
|
|
|
|
SET_TARGET_PROPERTIES(osquery_tables_linux PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-08-30 10:17:52 +00:00
|
|
|
endif()
|
|
|
|
|
2014-08-30 10:43:02 +00:00
|
|
|
FILE(GLOB table_sources
|
|
|
|
"generated/*.cpp"
|
|
|
|
"manual/*.cpp"
|
|
|
|
)
|
|
|
|
|
2014-07-31 00:35:19 +00:00
|
|
|
ADD_LIBRARY(osquery_tables
|
2014-08-05 08:21:28 +00:00
|
|
|
registry.cpp
|
2014-08-05 09:21:24 +00:00
|
|
|
${table_sources}
|
2014-08-30 10:46:08 +00:00
|
|
|
networking/etc_hosts.cpp
|
2014-08-30 07:15:31 +00:00
|
|
|
utility/time.cpp
|
2014-07-31 00:35:19 +00:00
|
|
|
)
|
2014-08-17 08:44:22 +00:00
|
|
|
|
2014-08-04 21:12:06 +00:00
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables glog)
|
2014-08-30 21:29:45 +00:00
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_core)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_database)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_filesystem)
|
2014-07-31 00:35:19 +00:00
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_sqlite)
|
2014-08-30 10:17:52 +00:00
|
|
|
if(APPLE)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_tables_objc)
|
2014-09-05 14:54:41 +00:00
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_tables_darwin)
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables "-Wl,-all_load")
|
|
|
|
else()
|
|
|
|
TARGET_LINK_LIBRARIES(osquery_tables osquery_tables_linux)
|
2014-08-30 10:17:52 +00:00
|
|
|
endif()
|
2014-09-05 14:54:41 +00:00
|
|
|
SET_TARGET_PROPERTIES(osquery_tables PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-08-02 03:46:22 +00:00
|
|
|
|
2014-08-06 01:10:18 +00:00
|
|
|
ADD_EXECUTABLE(etc_hosts_tests networking/etc_hosts_tests.cpp)
|
2014-08-30 21:26:24 +00:00
|
|
|
TARGET_LINK_LIBRARIES(etc_hosts_tests gtest)
|
2014-08-02 03:46:22 +00:00
|
|
|
TARGET_LINK_LIBRARIES(etc_hosts_tests osquery_tables)
|
2014-09-05 14:54:41 +00:00
|
|
|
SET_TARGET_PROPERTIES(etc_hosts_tests PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-09-02 18:08:49 +00:00
|
|
|
ADD_TEST(etc_hosts_tests etc_hosts_tests)
|
2014-08-30 21:26:24 +00:00
|
|
|
|
|
|
|
if(APPLE)
|
2014-09-05 14:54:41 +00:00
|
|
|
ADD_EXECUTABLE(apps_tests system/darwin/apps_tests.cpp)
|
2014-08-30 21:26:24 +00:00
|
|
|
TARGET_LINK_LIBRARIES(apps_tests gtest)
|
|
|
|
TARGET_LINK_LIBRARIES(apps_tests osquery_tables)
|
2014-09-05 14:54:41 +00:00
|
|
|
SET_TARGET_PROPERTIES(apps_tests PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-09-02 18:08:49 +00:00
|
|
|
ADD_TEST(apps_tests apps_tests)
|
2014-08-30 21:26:24 +00:00
|
|
|
|
2014-09-05 14:54:41 +00:00
|
|
|
ADD_EXECUTABLE(ca_certs_tests system/darwin/ca_certs_tests.cpp)
|
2014-09-02 01:46:16 +00:00
|
|
|
TARGET_LINK_LIBRARIES(ca_certs_tests gtest)
|
|
|
|
TARGET_LINK_LIBRARIES(ca_certs_tests osquery_tables)
|
2014-09-05 14:54:41 +00:00
|
|
|
SET_TARGET_PROPERTIES(ca_certs_tests PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-09-02 18:08:49 +00:00
|
|
|
ADD_TEST(ca_certs_tests ca_certs_tests)
|
2014-08-30 21:26:24 +00:00
|
|
|
|
2014-09-05 14:54:41 +00:00
|
|
|
ADD_EXECUTABLE(firewall_tests system/darwin/firewall_tests.cpp)
|
2014-08-30 21:26:24 +00:00
|
|
|
TARGET_LINK_LIBRARIES(firewall_tests gtest)
|
|
|
|
TARGET_LINK_LIBRARIES(firewall_tests osquery_tables)
|
2014-09-05 14:54:41 +00:00
|
|
|
SET_TARGET_PROPERTIES(firewall_tests PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-09-02 18:08:49 +00:00
|
|
|
ADD_TEST(firewall_tests firewall_tests)
|
2014-08-30 21:26:24 +00:00
|
|
|
|
2014-09-05 14:54:41 +00:00
|
|
|
ADD_EXECUTABLE(launchd_tests system/darwin/launchd_tests.cpp)
|
2014-08-30 21:26:24 +00:00
|
|
|
TARGET_LINK_LIBRARIES(launchd_tests gtest)
|
|
|
|
TARGET_LINK_LIBRARIES(launchd_tests osquery_tables)
|
2014-09-05 14:54:41 +00:00
|
|
|
SET_TARGET_PROPERTIES(launchd_tests PROPERTIES COMPILE_FLAGS ${OS_COMPILE_FLAGS})
|
2014-09-02 18:08:49 +00:00
|
|
|
ADD_TEST(launchd_tests launchd_tests)
|
2014-08-30 21:26:24 +00:00
|
|
|
endif()
|