Skip to content

Commit f61c7a0

Browse files
committed
Installing tests, examples and benchmarks.
1 parent eb22d5c commit f61c7a0

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if( NOT is_submodule )
2121
set( ENABLE_WARNINGS_AS_ERRORS "ON" CACHE PATH "" )
2222

2323
option( ENABLE_TESTS "Builds tests" ON )
24+
option( DISABLE_UNIT_TESTS "Disables unit tests but builds gtest." OFF )
2425
option( ENABLE_EXAMPLES "Builds examples" ON )
2526
option( ENABLE_BENCHMARKS "Builds benchmarks" ON )
2627
option( ENABLE_DOCS "Builds documentation" ON )
@@ -60,7 +61,7 @@ if( ENABLE_CALIPER )
6061
endif()
6162

6263

63-
if( ENABLE_TESTS )
64+
if( ENABLE_TESTS AND NOT DISABLE_UNIT_TESTS )
6465
add_subdirectory( unitTests )
6566
endif()
6667

benchmarks/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ foreach(benchmark ${benchmarkSources})
3333
# blt_add_target_compile_flags( TO ${benchmark_name}
3434
# FLAGS -fsave-optimization-record )
3535

36-
blt_add_benchmark( NAME ${benchmark_name}
37-
COMMAND ${benchmark_name}
38-
)
36+
blt_add_benchmark(NAME ${benchmark_name}
37+
COMMAND ${benchmark_name})
38+
39+
install(TARGETS ${benchmark_name}
40+
DESTINATION bin)
3941

4042
endforeach()

docs/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ endif()
99
if( SPHINX_FOUND )
1010
add_subdirectory(sphinx)
1111
endif()
12-

examples/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ foreach(example ${exampleSources})
2727
blt_add_test( NAME ${example_name}
2828
COMMAND ${example_name} )
2929

30+
install(TARGETS ${example_name}
31+
DESTINATION bin)
32+
3033
endforeach()

unitTests/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ foreach(test ${testSources})
7979
blt_add_test( NAME ${test_name}
8080
COMMAND ${test_name} )
8181

82+
install(TARGETS ${test_name}
83+
DESTINATION bin)
84+
8285
endforeach()
8386

8487
# Add testFloatingPointExceptions which has a dependency to prevent optimizations.
@@ -97,6 +100,9 @@ target_include_directories( testFloatingPointExceptions PUBLIC ${CMAKE_CURRENT_L
97100
blt_add_test( NAME testFloatingPointExceptions
98101
COMMAND testFloatingPointExceptions )
99102

103+
install(TARGETS testFloatingPointExceptions
104+
DESTINATION bin)
105+
100106
# Add testTensorOps which has multiple translation units to speed up compilation.
101107
blt_add_executable( NAME testTensorOps
102108
SOURCES testTensorOps.cpp
@@ -120,3 +126,6 @@ target_include_directories( testTensorOps PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../sr
120126

121127
blt_add_test( NAME testTensorOps
122128
COMMAND testTensorOps )
129+
130+
install(TARGETS testTensorOps
131+
DESTINATION bin)

0 commit comments

Comments
 (0)