osquery-1/CMakeLists.txt

57 lines
1.6 KiB
CMake
Raw Normal View History

# 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.
cmake_minimum_required(VERSION 3.13.3)
project(osquery)
if(BUILD_TESTING)
enable_testing()
endif()
include(cmake/globals.cmake)
include(cmake/utilities.cmake)
include(cmake/options.cmake)
include(cmake/packaging.cmake)
function(main)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Shared libraries: ${BUILD_SHARED_LIBS}")
if(DEFINED PLATFORM_MACOS)
if((NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") OR
(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang"))
message(STATUS "Warning: the selected C or C++ compiler is not clang/clang++. Compilation may fail")
endif()
elseif(NOT DEFINED PLATFORM_WINDOWS)
if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(STATUS "Warning: the selected C or C++ compiler is not clang/clang++. Compilation may fail")
endif()
endif()
generateGlobalSettingsTargets()
findPythonExecutablePath()
generateSpecialTargets()
add_subdirectory("third-party")
add_subdirectory("osquery")
add_subdirectory("plugins")
add_subdirectory("tools")
add_subdirectory("specs")
if(BUILD_TESTING)
add_subdirectory("tests")
endif()
identifyPackagingSystem()
generateInstallTargets()
generatePackageTarget()
endfunction()
main()