mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
Changes to allow source packaging via CPack
- 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
This commit is contained in:
parent
edfdd9d436
commit
fa07bcd233
7 changed files with 186 additions and 138 deletions
21
cmake/CheckOptionalBuildSources.cmake
Normal file
21
cmake/CheckOptionalBuildSources.cmake
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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)
|
Loading…
Add table
Add a link
Reference in a new issue