diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e8bea31a4..775bbecce0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -493,7 +493,7 @@ set(ZEEK_PLUGIN_INTERNAL_BUILD true CACHE INTERNAL "" FORCE) set(DEFAULT_ZEEKPATH .:${ZEEK_SCRIPT_INSTALL_PATH}:${ZEEK_SCRIPT_INSTALL_PATH}/policy:${ZEEK_SCRIPT_INSTALL_PATH}/site:${ZEEK_SCRIPT_INSTALL_PATH}/builtin-plugins) if ( NOT BINARY_PACKAGING_MODE ) - set(ZEEK_DIST ${CMAKE_SOURCE_DIR}) + set(ZEEK_DIST ${PROJECT_SOURCE_DIR}) endif () string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) @@ -650,7 +650,7 @@ message( "\n====================| Zeek Build Summary |====================" "\n" "\nBuild type: ${CMAKE_BUILD_TYPE}" - "\nBuild dir: ${CMAKE_BINARY_DIR}" + "\nBuild dir: ${PROJECT_BINARY_DIR}" "\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" "\nPlugin dir: ${BRO_PLUGIN_INSTALL_PATH}" "\nPython module dir: ${PY_MOD_INSTALL_DIR}" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 26ae9e00b9..7a2dcfedf7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -139,9 +139,9 @@ endforeach () include(BinPAC) set(BINPAC_AUXSRC - ${CMAKE_SOURCE_DIR}/src/binpac.pac - ${CMAKE_SOURCE_DIR}/src/zeek.pac - ${CMAKE_SOURCE_DIR}/src/binpac_zeek.h + ${PROJECT_SOURCE_DIR}/src/binpac.pac + ${PROJECT_SOURCE_DIR}/src/zeek.pac + ${PROJECT_SOURCE_DIR}/src/binpac_zeek.h ) binpac_target(binpac-lib.pac) @@ -176,9 +176,9 @@ add_subdirectory(fuzzers) ######################################################################## ## Build in the discovered external plugins and create the autogenerated scripts. -set(PRELOAD_SCRIPT ${CMAKE_BINARY_DIR}/scripts/builtin-plugins/__preload__.zeek) +set(PRELOAD_SCRIPT ${PROJECT_BINARY_DIR}/scripts/builtin-plugins/__preload__.zeek) file(WRITE ${PRELOAD_SCRIPT} "# Warning, this is an autogenerated file!\n") -set(LOAD_SCRIPT ${CMAKE_BINARY_DIR}/scripts/builtin-plugins/__load__.zeek) +set(LOAD_SCRIPT ${PROJECT_BINARY_DIR}/scripts/builtin-plugins/__load__.zeek) file(WRITE ${LOAD_SCRIPT} "# Warning, this is an autogenerated file!\n") foreach (plugin_dir ${BUILTIN_PLUGIN_LIST}) @@ -531,13 +531,13 @@ add_dependencies(bif_loader_plugins ${bro_PLUGIN_DEPS} ${bro_SUBDIR_DEPS}) add_dependencies(zeek_objs bif_loader_plugins) # Install *.bif.zeek. -install(DIRECTORY ${CMAKE_BINARY_DIR}/scripts/base/bif DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/base) +install(DIRECTORY ${PROJECT_BINARY_DIR}/scripts/base/bif DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/base) # Create plugin directory at install time. install(DIRECTORY DESTINATION ${BRO_PLUGIN_INSTALL_PATH}) # Make clean removes the bif directory. -set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/scripts/base/bif) +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/scripts/base/bif) # Remove some stale files and scripts that previous Bro versions put in # place, yet make confuse us now. This makes upgrading easier. diff --git a/zeek-path-dev.in b/zeek-path-dev.in index fe70f6a4a1..6dcdc71c7c 100755 --- a/zeek-path-dev.in +++ b/zeek-path-dev.in @@ -10,4 +10,4 @@ # ZEEKPATH=`./zeek-path-dev` ./src/zeek # -echo .:${CMAKE_SOURCE_DIR}/scripts:${CMAKE_SOURCE_DIR}/scripts/policy:${CMAKE_SOURCE_DIR}/scripts/site:${CMAKE_BINARY_DIR}/scripts +echo .:${PROJECT_SOURCE_DIR}/scripts:${PROJECT_SOURCE_DIR}/scripts/policy:${PROJECT_SOURCE_DIR}/scripts/site:${PROJECT_BINARY_DIR}/scripts:${PROJECT_BINARY_DIR}/scripts/builtin-plugins