diff options
author | Kefu Chai <kchai@redhat.com> | 2018-07-07 11:10:23 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2018-07-09 15:09:18 +0200 |
commit | 423ca5764e0c2f063a7c8245608f92588cbb71f3 (patch) | |
tree | 4cca164b48a728084e3f9bff66aa9c95a99903f3 /cmake | |
parent | Merge pull request #22878 from falcon78921/wip-falcon78921-docs-install (diff) | |
download | ceph-423ca5764e0c2f063a7c8245608f92588cbb71f3.tar.xz ceph-423ca5764e0c2f063a7c8245608f92588cbb71f3.zip |
cmake: find python2 interpreter for gtest-parallel
gtest-parallel only supports python2 at this moment, so find it
a python2 interpreter if it is enabled.
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/AddCephTest.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/modules/AddCephTest.cmake b/cmake/modules/AddCephTest.cmake index d3dc81fc193..c48155b3bb7 100644 --- a/cmake/modules/AddCephTest.cmake +++ b/cmake/modules/AddCephTest.cmake @@ -25,15 +25,19 @@ endfunction() option(WITH_GTEST_PARALLEL "Enable running gtest based tests in parallel" OFF) if(WITH_GTEST_PARALLEL) + set(gtest_parallel_source_dir ${CMAKE_CURRENT_BINARY_DIR}/gtest-parallel) include(ExternalProject) ExternalProject_Add(gtest-parallel_ext - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/gtest-parallel + SOURCE_DIR "${gtest_parallel_source_dir}" GIT_REPOSITORY "https://github.com/google/gtest-parallel.git" GIT_TAG "master" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "") add_dependencies(tests gtest-parallel_ext) + find_package(PythonInterp 2.7 REQUIRED) + set(GTEST_PARALLEL_COMMAND + ${PYTHON_EXECUTABLE} ${gtest_parallel_source_dir}/gtest-parallel) endif() #sets uniform compiler flags and link libraries @@ -41,8 +45,7 @@ function(add_ceph_unittest unittest_name) set(UNITTEST "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${unittest_name}") # If the second argument is "parallel", it means we want a parallel run if(WITH_GTEST_PARALLEL AND "${ARGV1}" STREQUAL "parallel") - ExternalProject_Get_Property(gtest-parallel_ext source_dir) - set(UNITTEST ${source_dir}/gtest-parallel ${UNITTEST}) + set(UNITTEST ${GTEST_PARALLEL_COMMAND} ${UNITTEST}) endif() add_ceph_test(${unittest_name} "${UNITTEST}") target_link_libraries(${unittest_name} ${UNITTEST_LIBS}) |