Add template file and cmake call for zeek-path setup on Windows

This commit is contained in:
Tim Wojtulewicz 2023-04-25 14:47:07 -07:00
parent dd26990410
commit 08a039446f
3 changed files with 13 additions and 0 deletions

View file

@ -423,6 +423,10 @@ set(cmake_install_prefix "${CMAKE_INSTALL_PREFIX}")
set(cmake_source_dir "${CMAKE_SOURCE_DIR}")
set(zeek_script_install_path "${ZEEK_SCRIPT_INSTALL_PATH}")
if ( MSVC )
# This has to happen before we modify the paths below so that
# the pure Windows paths are stored in the output file.
configure_file(zeek-path-dev.bat.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev.bat)
string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_binary_dir "${cmake_binary_dir}")
string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_current_binary_dir "${cmake_current_binary_dir}")
string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_install_prefix "${cmake_install_prefix}")

8
zeek-path-dev.bat.in Normal file
View file

@ -0,0 +1,8 @@
:: Sets up the basic environment needed to run Zeek from a Windows command prompt (not bash!).
:: This is needed in order to run unit tests on Cirrus.
::
:: The ZEEKPATH line here should be kept in sync with the zeek-path-dev.in file.
::
set ZEEKPATH=.;${cmake_source_dir}/scripts;${cmake_source_dir}/scripts/policy;${cmake_source_dir}/scripts/site;${cmake_binary_dir}/scripts;${cmake_binary_dir}/scripts/builtin-plugins
set ZEEK_PLUGIN_PATH=${cmake_binary_dir}/src}

View file

@ -9,5 +9,6 @@
#
# ZEEKPATH=`./zeek-path-dev` ./src/zeek
#
# This file should be kept in sync with the ZEEKPATH line in zeek-path-dev.bat.in.
echo .:${cmake_source_dir}/scripts:${cmake_source_dir}/scripts/policy:${cmake_source_dir}/scripts/site:${cmake_binary_dir}/scripts:${cmake_binary_dir}/scripts/builtin-plugins