File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
9898endif ()
9999
100100if (BUILD_TESTS)
101+ enable_testing ()
101102 include_directories (${XTENSOR_BLAS_INCLUDE_DIR} )
102103 include_directories (${xtensor_INCLUDE_DIRS} )
103104 add_subdirectory (test )
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ cmake_minimum_required(VERSION 3.1)
1212if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
1313 project (xtensor-blas-test )
1414
15+ enable_testing ()
16+
1517 find_package (xtensor REQUIRED CONFIG)
1618 set (XTENSOR_INCLUDE_DIR ${xtensor_INCLUDE_DIRS} )
1719 find_package (xtensor-blas REQUIRED CONFIG)
@@ -103,7 +105,10 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
103105 ${CMAKE_CURRENT_BINARY_DIR} /googletest-build EXCLUDE_FROM_ALL )
104106
105107 set (GTEST_INCLUDE_DIRS "${gtest_SOURCE_DIR} /include" )
106- set (GTEST_BOTH_LIBRARIES gtest_main gtest)
108+ add_library (GTest::GTest INTERFACE IMPORTED )
109+ target_link_libraries (GTest::GTest INTERFACE gtest)
110+ add_library (GTest::Main INTERFACE IMPORTED )
111+ target_link_libraries (GTest::Main INTERFACE gtest_main)
107112else ()
108113 find_package (GTest REQUIRED)
109114endif ()
@@ -145,6 +150,7 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
145150 add_dependencies (test_xtensor_blas gtest_main)
146151endif ()
147152
148- target_link_libraries (test_xtensor_blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
153+ target_link_libraries (test_xtensor_blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} GTest::GTest GTest::Main ${CMAKE_THREAD_LIBS_INIT} )
149154
150155add_custom_target (xtest COMMAND test_xtensor_blas DEPENDS test_xtensor_blas)
156+ add_test (NAME xtest COMMAND test_xtensor_blas)
You can’t perform that action at this time.
0 commit comments