diff --git a/cmake/FetchMegBrainVersion.cmake b/cmake/FetchMegBrainVersion.cmake index b6f0992bcfd712c40da9a4c76ff376ae007fcaa3..5c625bb6ed8a486b5a3ac985909089262aafe529 100644 --- a/cmake/FetchMegBrainVersion.cmake +++ b/cmake/FetchMegBrainVersion.cmake @@ -7,7 +7,7 @@ # MGB_VER_STRING: Version string option(MGB_FORCE_DEV_VERSION "Force -dev tag in version stamp" OFF) -file (READ "${CMAKE_SOURCE_DIR}/src/core/include/megbrain/version.h" content) +file (READ "${CMAKE_CURRENT_SOURCE_DIR}/src/core/include/megbrain/version.h" content) string (REGEX MATCH "MGB_MAJOR +([0-9]+)" _ ${content}) set (MGB_VER_MAJOR ${CMAKE_MATCH_1}) diff --git a/scripts/cmake-build/utils/utils.sh b/scripts/cmake-build/utils/utils.sh index fae31f1f6944e2eb31b23b5391049d17051b8f08..35fe7ebf0afd222ae07b95f26665ee3cd0d026de 100755 --- a/scripts/cmake-build/utils/utils.sh +++ b/scripts/cmake-build/utils/utils.sh @@ -15,6 +15,7 @@ if [ $OS = "Darwin" ];then READLINK=greadlink fi +PROJECT_DIR=$(dirname "${BASH_SOURCE[0]}")/../../../ function cd_real_build_dir() { REAL_DIR=$($READLINK -f $1) echo "may alias dir: $1" @@ -46,7 +47,7 @@ function build_flatc() { -DFLATBUFFERS_BUILD_FLATHASH=OFF \ -DFLATBUFFERS_BUILD_FLATLIB=OFF \ -DFLATBUFFERS_LIBCXX_WITH_CLANG=OFF \ - $SRC_DIR/third_party/flatbuffers + ${PROJECT_DIR}/third_party/flatbuffers ${NINJA_BASE} all ${NINJA_BASE} install/strip