osquery-1/osquery/config/CMakeLists.txt
Stefano Bonicatti 942878854b Add CMake support
Taken from osql-experimental.

- Change CMake code license to the one present in osquery right now

- Package metadata doesn't mention Trail of Bits or osql anymore

- Set specific ACLs for the osqueryd on Windows when packaging

- Remove LLVM_INSTALL_PATH support on macOS, since we are using AppleClang

- Remove OSQUERY_SOURCE_DIR variable need and source in a submodule support

- Add targets format_check and format to check code formatting and
  format it with clang-format

- Do not warn about not using Clang on macOS when using AppleClang
2019-06-26 21:49:06 -04:00

51 lines
1.2 KiB
CMake

# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
function(osqueryConfigMain)
if(BUILD_TESTING)
add_subdirectory("tests")
endif()
generateOsqueryConfig()
endfunction()
function(generateOsqueryConfig)
add_osquery_library(osquery_config EXCLUDE_FROM_ALL
config.cpp
packs.cpp
)
enableLinkWholeArchive(osquery_config)
target_link_libraries(osquery_config PUBLIC
global_cxx_settings
osquery_headers
osquery_filesystem
osquery_hashing
osquery_utils
osquery_utils_system_time
)
set(public_header_files
config.h
)
generateIncludeNamespace(osquery_config "osquery/config" "FILE_ONLY" ${public_header_files})
add_test(NAME osquery_config_tests-test COMMAND osquery_config_tests-test)
add_test(NAME osquery_config_tests_packs-test COMMAND osquery_config_tests_packs-test)
set_tests_properties(
osquery_config_tests-test
osquery_config_tests_packs-test
PROPERTIES ENVIRONMENT "TEST_CONF_FILES_DIR=${TEST_CONFIGS_DIR}"
)
endfunction()
osqueryConfigMain()