Skip to content

Commit 88d10fb

Browse files
authored
Merge pull request #188 from SylvainCorlay/gtest-install
Prevent installation of gtest artifacts
2 parents 544a5bb + 765d1ef commit 88d10fb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ install:
2222
- conda update -q conda
2323
- conda info -a
2424
- conda install gtest cmake -c conda-forge
25-
- conda install pytest numpy pybind11==2.2.1 xtensor==0.19.0 -c conda-forge
25+
- conda install pytest numpy pybind11==2.2.1 xtensor==0.19.2 -c conda-forge
2626
- "set PYTHONHOME=%MINICONDA%"
2727
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=ON -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe .
2828
- nmake test_xtensor_python

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ install:
128128
# Useful for debugging any issues with conda
129129
- conda info -a
130130
- conda install pytest numpy -c conda-forge
131-
- conda install cmake gtest -c conda-forge
131+
- conda install cmake -c conda-forge
132132
- |
133133
if [[ "$PYBIND11_VERSION" == "master" ]]; then
134134
conda_root=$(cd $(dirname $(which conda))/.. && pwd)
@@ -147,10 +147,11 @@ install:
147147
else
148148
conda install pybind11==${PYBIND11_VERSION} -c conda-forge
149149
fi
150-
- conda install xtensor==0.19.0 -c conda-forge
151-
- cmake -D BUILD_TESTS=ON -D CMAKE_INSTALL_PREFIX=$HOME/miniconda -D PYTHON_EXECUTABLE=$PY_EXE .
150+
- conda install xtensor==0.19.2 -c conda-forge
151+
- cmake -D DOWNLOAD_GTEST=ON -D CMAKE_INSTALL_PREFIX=$HOME/miniconda -D PYTHON_EXECUTABLE=$PY_EXE .
152152
- make -j2 test_xtensor_python
153153
- make install
154+
- rm -rf test/googletest-src
154155

155156
script:
156157
- py.test -s

test/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if (DOWNLOAD_GTEST OR GTEST_SRC_DIR)
6868
# Add googletest directly to our build. This defines
6969
# the gtest and gtest_main targets.
7070
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
71-
${CMAKE_CURRENT_BINARY_DIR}/googletest-build)
71+
${CMAKE_CURRENT_BINARY_DIR}/googletest-build EXCLUDE_FROM_ALL)
7272

7373
set(GTEST_INCLUDE_DIRS "${gtest_SOURCE_DIR}/include")
7474
set(GTEST_BOTH_LIBRARIES gtest_main gtest)
@@ -87,13 +87,12 @@ set(XTENSOR_PYTHON_TESTS
8787
test_pyvectorize.cpp
8888
)
8989

90-
set(XTENSOR_PYTHON_TARGET test_xtensor_python)
91-
add_executable(${XTENSOR_PYTHON_TARGET} ${XTENSOR_PYTHON_TESTS} ${XTENSOR_PYTHON_HEADERS})
92-
target_link_libraries(${XTENSOR_PYTHON_TARGET} xtensor-python ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PYTHON_LIBRARIES})
90+
add_executable(test_xtensor_python ${XTENSOR_PYTHON_TESTS} ${XTENSOR_PYTHON_HEADERS})
91+
target_link_libraries(test_xtensor_python xtensor-python ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PYTHON_LIBRARIES})
9392

9493
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
95-
add_dependencies(${XTENSOR_PYTHON_TARGET} gtest_main)
94+
add_dependencies(test_xtensor_python gtest_main)
9695
endif()
9796

98-
add_custom_target(xtest COMMAND ./test_xtensor_python DEPENDS ${XTENSOR_PYTHON_TARGET})
97+
add_custom_target(xtest COMMAND ./test_xtensor_python DEPENDS test_xtensor_python)
9998

0 commit comments

Comments
 (0)