osquery-1/tools/CMakeLists.txt
Stefano Bonicatti 46430df8c5 Restore WEL logger plugin (#6164)
- Restore the ability of osquery to log to the Windows Event Log.
- Restore the information normally shown on the Details tab
of the Properties of the osquery executable.
- Add and refactor utility functions to parse and transform
  the osquery version, needed by the Windows resource files
  and packaging.
2020-01-12 01:42:44 -05:00

49 lines
1.3 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(toolsMain)
add_subdirectory("codegen")
if(OSQUERY_BUILD_TESTS)
add_subdirectory("tests")
endif()
if(DEFINED PLATFORM_WINDOWS)
set(TOOLS_WEL_FILES_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "")
getCleanedOsqueryVersion("osquery_version")
getCleanedOsqueryVersionComponents("osquery_version_major" "osquery_version_minor" "osquery_version_patch")
set(osquery_rc_MSG "${TOOLS_WEL_FILES_ROOT_DIR}/wel/MSG00001.bin")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/wel/MSG00001.bin"
"${osquery_rc_MSG}"
COPYONLY
)
set(osquery_rc_WEVT_TEMPLATE "${TOOLS_WEL_FILES_ROOT_DIR}/wel/osqueryTEMP.BIN")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/wel/osqueryTEMP.BIN"
"${osquery_rc_WEVT_TEMPLATE}"
COPYONLY
)
set(osquery_rc "${TOOLS_WEL_FILES_ROOT_DIR}/wel/osquery.rc")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/wel/osquery.rc.in"
"${osquery_rc}"
@ONLY
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/windows_resources.rc.in"
"${TOOLS_WEL_FILES_ROOT_DIR}/windows_resources.rc"
@ONLY
)
endif()
endfunction()
toolsMain()