moved from file(GLOB); added CMAKE_CURRENT_LIST_DIR to support include syntax (#4582)

This commit is contained in:
Max Kareta 2018-06-18 14:24:20 +01:00 committed by GitHub
parent 408c54565e
commit 4b8d7f0c53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 32 deletions

View File

@ -7,8 +7,10 @@
# You may select, at your option, one of the above-listed licenses.
ADD_OSQUERY_LIBRARY_ADDITIONAL(osquery_carver
carver.cpp
"${CMAKE_CURRENT_LIST_DIR}/carver.cpp"
"${CMAKE_CURRENT_LIST_DIR}/carver.h"
)
file(GLOB OSQUERY_CARVER_TESTS "tests/*.cpp")
ADD_OSQUERY_TEST(FALSE ${OSQUERY_CARVER_TESTS})
ADD_OSQUERY_TEST(FALSE
"${CMAKE_CURRENT_LIST_DIR}/tests/carver_tests.cpp"
)

View File

@ -7,33 +7,53 @@
# You may select, at your option, one of the above-listed licenses.
ADD_OSQUERY_LIBRARY(TRUE osquery_config
config.cpp
packs.cpp
"${CMAKE_CURRENT_LIST_DIR}/config.cpp"
"${CMAKE_CURRENT_LIST_DIR}/packs.cpp"
)
file(GLOB OSQUERY_CONFIG_PLUGINS "plugins/*.cpp")
ADD_OSQUERY_LIBRARY(FALSE osquery_config_plugins
${OSQUERY_CONFIG_PLUGINS}
update.cpp
"${CMAKE_CURRENT_LIST_DIR}/plugins/filesystem_config.cpp"
"${CMAKE_CURRENT_LIST_DIR}/plugins/tls_config.cpp"
"${CMAKE_CURRENT_LIST_DIR}/plugins/tls_config.h"
"${CMAKE_CURRENT_LIST_DIR}/update.cpp"
)
file(GLOB OSQUERY_CONFIG_PARSERS "parsers/*.cpp")
ADD_OSQUERY_LIBRARY(TRUE osquery_config_parsers
${OSQUERY_CONFIG_PARSERS}
"${CMAKE_CURRENT_LIST_DIR}/parsers/decorators.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/decorators.h"
"${CMAKE_CURRENT_LIST_DIR}/parsers/events_parser.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/feature_vectors.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/feature_vectors.h"
"${CMAKE_CURRENT_LIST_DIR}/parsers/file_paths.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/kafka_topics.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/kafka_topics.h"
"${CMAKE_CURRENT_LIST_DIR}/parsers/logger.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/logger.h"
"${CMAKE_CURRENT_LIST_DIR}/parsers/options.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/prometheus_targets.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/prometheus_targets.h"
"${CMAKE_CURRENT_LIST_DIR}/parsers/views.cpp"
)
file(GLOB OSQUERY_ADDITIONAL_CONFIG_PARSERS "additional_parsers/*.cpp")
ADD_OSQUERY_LIBRARY(FALSE osquery_additional_config_parsers
${OSQUERY_ADDITIONAL_CONFIG_PARSERS}
"${CMAKE_CURRENT_LIST_DIR}/additional_parsers/auto_constructed_tables.cpp"
"${CMAKE_CURRENT_LIST_DIR}/additional_parsers/auto_constructed_tables.h"
)
file(GLOB OSQUERY_CONFIG_TESTS "tests/config_tests.cpp")
ADD_OSQUERY_TEST(TRUE ${OSQUERY_CONFIG_TESTS})
ADD_OSQUERY_TEST(TRUE
"${CMAKE_CURRENT_LIST_DIR}/tests/config_tests.cpp"
)
# The packs tests will attempt to execute SQL, they must be additional
file(GLOB OSQUERY_PACKS_TESTS "tests/packs_tests.cpp")
ADD_OSQUERY_TEST(FALSE ${OSQUERY_PACKS_TESTS})
ADD_OSQUERY_TEST(FALSE
"${CMAKE_CURRENT_LIST_DIR}/tests/packs_tests.cpp"
)
file(GLOB OSQUERY_CONFIG_PLUGIN_TESTS "*/tests/*.cpp")
ADD_OSQUERY_TEST(FALSE ${OSQUERY_CONFIG_PLUGIN_TESTS})
ADD_OSQUERY_TEST(FALSE
"${CMAKE_CURRENT_LIST_DIR}/parsers/tests/file_paths_tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/tests/views_tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/tests/options_tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/tests/decorators_tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/parsers/tests/events_tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/plugins/tests/tls_config_tests.cpp"
)

View File

@ -7,8 +7,10 @@
# You may select, at your option, one of the above-listed licenses.
ADD_OSQUERY_LIBRARY(FALSE osquery_devtools
printer.cpp
"${CMAKE_CURRENT_LIST_DIR}/printer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/devtools.h"
)
file(GLOB OSQUERY_DEVTOOLS_TESTS "tests/*.cpp")
ADD_OSQUERY_TEST(FALSE ${OSQUERY_DEVTOOLS_TESTS})
ADD_OSQUERY_TEST(FALSE
"${CMAKE_CURRENT_LIST_DIR}/tests/printer_tests.cpp"
)

View File

@ -7,20 +7,23 @@
# You may select, at your option, one of the above-listed licenses.
ADD_OSQUERY_LIBRARY(TRUE osquery_dispatcher
dispatcher.cpp
"${CMAKE_CURRENT_LIST_DIR}/dispatcher.cpp"
)
ADD_OSQUERY_TEST(TRUE
dispatcher/tests/dispatcher_tests.cpp
"${CMAKE_CURRENT_LIST_DIR}/tests/dispatcher_tests.cpp"
)
# The following dispatcher ("runner") implementations are additional.
ADD_OSQUERY_LIBRARY(FALSE osquery_dispatcher_runners
scheduler.cpp
distributed.cpp
io_service.cpp
"${CMAKE_CURRENT_LIST_DIR}/scheduler.cpp"
"${CMAKE_CURRENT_LIST_DIR}/scheduler.h"
"${CMAKE_CURRENT_LIST_DIR}/distributed_runner.cpp"
"${CMAKE_CURRENT_LIST_DIR}/distributed_runner.h"
"${CMAKE_CURRENT_LIST_DIR}/io_service.cpp"
"${CMAKE_CURRENT_LIST_DIR}/io_service.h"
)
ADD_OSQUERY_TEST(FALSE
dispatcher/tests/scheduler_tests.cpp
"${CMAKE_CURRENT_LIST_DIR}/tests/scheduler_tests.cpp"
)

View File

@ -14,7 +14,7 @@
#include <osquery/system.h>
#include "osquery/core/conversions.h"
#include "osquery/dispatcher/distributed.h"
#include "osquery/dispatcher/distributed_runner.h"
namespace osquery {
@ -58,4 +58,4 @@ Status startDistributed() {
return Status(1, "Distributed query service not enabled.");
}
}
}
} // namespace osquery

View File

@ -26,4 +26,4 @@ class DistributedRunner : public InternalRunnable {
};
Status startDistributed();
}
} // namespace osquery

View File

@ -31,7 +31,7 @@
#include "osquery/core/utils.h"
#include "osquery/core/watcher.h"
#include "osquery/devtools/devtools.h"
#include "osquery/dispatcher/distributed.h"
#include "osquery/dispatcher/distributed_runner.h"
#include "osquery/dispatcher/io_service.h"
#include "osquery/dispatcher/scheduler.h"
#include "osquery/filesystem/fileops.h"