mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

- Refactored all packaging related stuff into a single CMake module - Build should no longer fail when optional sources (e.g. broctl) do not exist in the source directory, instead a warning is issued - Additional configure options to change packaging behavior
21 lines
936 B
CMake
21 lines
936 B
CMake
# A macro that checks whether optional sources exist and if they do, they
|
|
# are added to the build/install process, else a warning is issued
|
|
#
|
|
# _dir: the subdir of the current source dir in which the optional
|
|
# sources are located
|
|
# _packageName: a string that identifies the package
|
|
# _varName: name of the variable indicating whether package is scheduled
|
|
# to be installed
|
|
|
|
macro(CheckOptionalBuildSources _dir _packageName _varName)
|
|
if (${_varName})
|
|
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt)
|
|
add_subdirectory(${_dir})
|
|
else ()
|
|
message(WARNING "${_packageName} source code does not exist in "
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${_dir} "
|
|
"so it will not be built or installed")
|
|
set(${_varName} false)
|
|
endif ()
|
|
endif ()
|
|
endmacro(CheckOptionalBuildSources)
|