Skip to content

Commit 7694f6b

Browse files
committed
dependency installer script update
don't print "Installing GoogleTest" if not installing GoogleTest
1 parent 9354cc9 commit 7694f6b

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ endif()
287287
if (DEP_USE_JEMALLOC)
288288
set(DEP_OPTIONS ${DEP_OPTIONS} --jemalloc)
289289
endif()
290-
add_custom_target(install_dependencies ALL COMMAND ${CMAKE_SOURCE_DIR}/contrib/deps/install_deps.sh ${DEP_OPTIONS} "${DEP_DOWNLOAD_PREFIX}" "${DEP_BUILD_PREFIX}" "${DEP_INSTALL_PREFIX}")
290+
add_custom_target(install_dependencies ALL COMMAND ${CMAKE_SOURCE_DIR}/contrib/deps/install_deps.sh ${DEP_OPTIONS} "${DEP_DOWNLOAD_PREFIX}" "${DEP_BUILD_PREFIX}" "${DEP_INSTALL_PREFIX}" "${CMAKE_VERSION}" "${CMAKE_SYSTEM_NAME}")
291291

292292
# Find zlib
293293
pkg_search_module(ZLIB zlib)

contrib/deps/install_deps.sh

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,25 @@ if [[ "$#" -lt 3 ]]; then
118118
exit 1
119119
fi
120120

121+
if [[ "$#" -lt 5 ]]
122+
then
123+
echo "Syntax: $0 download_dir build_dir install_dir CMAKE_VERSION CMAKE_SYSTEM_NAME" >&2
124+
exit 1
125+
fi
126+
121127
# dependency download path
122-
mkdir -p "$1"
123-
DOWNLOAD_DIR=$(realpath "$1")
128+
DOWNLOAD_DIR=$(realpath -m "$1")
129+
mkdir -p "${DOWNLOAD_DIR}"
124130

125-
mkdir -p "$2"
126-
BUILD_DIR=$(realpath "$2")
131+
BUILD_DIR=$(realpath -m "$2")
132+
mkdir -p "${BUILD_DIR}"
127133

128134
# dependency install path
129-
mkdir -p "$3"
130-
INSTALL_DIR=$(realpath "$3")
135+
INSTALL_DIR=$(realpath -m "$3")
136+
mkdir -p "${INSTALL_DIR}"
137+
138+
CMAKE_VERSION="$4"
139+
CMAKE_SYSTEM_NAME="$5"
131140

132141
export SCRIPT_PATH
133142
export DOWNLOAD_DIR
@@ -147,13 +156,14 @@ if [[ "${JEMALLOC}" == "true" ]]; then
147156
source "${SCRIPT_PATH}/jemalloc.sh"
148157
fi
149158

150-
CMAKE_VERSION=$(cmake --version | head -n 1 | awk '{ print $3 }' )
151159
ACCEPTABLE_VERSION=3.5
152160
HIGHEST_VERSION=$( (echo "${CMAKE_VERSION}"; echo "${ACCEPTABLE_VERSION}") | sort -rV | head -1)
153161

154-
if [[ "${CMAKE_VERSION}" == "${HIGHEST_VERSION}" ]]; then
155-
if [[ "${BUILD_CXX}" == "true" ]]; then
156-
echo "Installing GoogleTest"
157-
source "${SCRIPT_PATH}/googletest.sh"
162+
if [[ "${CMAKE_SYSTEM_NAME}" != "CYGWIN" ]]; then
163+
if [[ "${CMAKE_VERSION}" == "${HIGHEST_VERSION}" ]]; then
164+
if [[ "${BUILD_CXX}" == "true" ]]; then
165+
echo "Installing GoogleTest"
166+
source "${SCRIPT_PATH}/googletest.sh"
167+
fi
158168
fi
159169
fi

0 commit comments

Comments
 (0)