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)
98
98
endif ()
99
99
100
100
if (BUILD_TESTS )
101
+ enable_testing ()
101
102
include_directories (${XTENSOR_BLAS_INCLUDE_DIR} )
102
103
include_directories (${xtensor_INCLUDE_DIRS} )
103
104
add_subdirectory (test )
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ cmake_minimum_required(VERSION 3.1)
12
12
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
13
13
project (xtensor-blas-test )
14
14
15
+ enable_testing ()
16
+
15
17
find_package (xtensor REQUIRED CONFIG )
16
18
set (XTENSOR_INCLUDE_DIR ${xtensor_INCLUDE_DIRS} )
17
19
find_package (xtensor-blas REQUIRED CONFIG )
@@ -103,7 +105,10 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
103
105
${CMAKE_CURRENT_BINARY_DIR} /googletest-build EXCLUDE_FROM_ALL )
104
106
105
107
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 )
107
112
else ()
108
113
find_package (GTest REQUIRED )
109
114
endif ()
@@ -145,6 +150,7 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
145
150
add_dependencies (test_xtensor_blas gtest_main )
146
151
endif ()
147
152
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} )
149
154
150
155
add_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