Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usages of cmake/FindRequiredPackage #58

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(ZeekControl C CXX)

include(GNUInstallDirs)
Expand All @@ -14,8 +14,6 @@ set(ETC "${ZEEK_ETC_INSTALL_DIR}")
########################################################################
## Dependency Configuration

include(FindRequiredPackage)

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/auxil/pysubnettree/CMakeLists.txt)
add_subdirectory(auxil/pysubnettree)
set(SUBNETTREE_FOUND true)
Expand All @@ -36,8 +34,9 @@ endif ()

find_package(Zeek)
list(APPEND Python_ADDITIONAL_VERSIONS 3)
FindRequiredPackage(PythonInterp)
FindRequiredPackage(SubnetTree)
set(ZEEKCTL_PYTHON_MIN 3.7.0)
find_package(Python ${ZEEKCTL_PYTHON_MIN} REQUIRED COMPONENTS Interpreter)
find_package(SubnetTree)
find_package(PCAP)

find_program(SENDMAIL sendmail PATHS /usr/sbin)
Expand All @@ -49,22 +48,9 @@ if (NOT SENDMAIL)
set(SENDMAIL /usr/sbin/sendmail)
endif ()

if (MISSING_PREREQS)
foreach (prereq ${MISSING_PREREQ_DESCS})
message(SEND_ERROR ${prereq})
endforeach ()
message(FATAL_ERROR "Configuration aborted due to missing prerequisites")
endif ()

set(ZEEKCTL_PYTHON_MIN 3.5.0)

if ( PYTHON_VERSION_STRING VERSION_LESS ${ZEEKCTL_PYTHON_MIN} )
message(FATAL_ERROR "Python ${ZEEKCTL_PYTHON_MIN} or greater is required.")
endif ()

if (NOT CMAKE_CROSSCOMPILING)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sqlite3"
RESULT_VARIABLE PYSQLITE3_IMPORT_RESULT)
execute_process(COMMAND "${Python_EXECUTABLE}" -c "import sqlite3"
RESULT_VARIABLE PYSQLITE3_IMPORT_RESULT)

if ( NOT PYSQLITE3_IMPORT_RESULT EQUAL 0 )
message(FATAL_ERROR "The sqlite3 python module is required to use "
Expand Down
2 changes: 1 addition & 1 deletion auxil/capstats
Submodule capstats updated 5 files
+10 −0 CHANGES
+2 −10 CMakeLists.txt
+1 −1 README
+1 −1 VERSION
+1 −1 cmake
2 changes: 1 addition & 1 deletion auxil/pysubnettree
Submodule pysubnettree updated 6 files
+10 −0 CHANGES
+12 −51 CMakeLists.txt
+1 −1 README
+1 −1 VERSION
+1 −1 cmake
+2 −6 configure
2 changes: 1 addition & 1 deletion auxil/trace-summary
Submodule trace-summary updated 6 files
+8 −0 CHANGES
+2 −6 CMakeLists.txt
+1 −1 README
+1 −1 VERSION
+1 −1 cmake
+1 −1 trace-summary
2 changes: 1 addition & 1 deletion cmake
Loading