Only include the tests if BUILD_TESTS is turned on.
This commit is contained in:
@@ -24,6 +24,8 @@ else()
|
||||
add_definitions(-DTKDNN_PATH="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endif()
|
||||
|
||||
option(BUILD_TESTS "Whether to build the tests or not." ON)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# CUDA
|
||||
@@ -72,6 +74,7 @@ target_link_libraries(tkDNN ${tkdnn_LIBS})
|
||||
#add_library(tkDNN_static STATIC ${tkdnn_SRC})
|
||||
#target_link_libraries(tkDNN_static ${tkdnn_LIBS})
|
||||
|
||||
if(BUILD_TESTS)
|
||||
# SMALL NETS
|
||||
add_executable(test_simple tests/simple/test_simple.cpp)
|
||||
target_link_libraries(test_simple tkDNN)
|
||||
@@ -128,6 +131,7 @@ target_link_libraries(map_demo tkDNN)
|
||||
|
||||
add_executable(demo demo/demo/demo.cpp)
|
||||
target_link_libraries(demo tkDNN)
|
||||
endif()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Install
|
||||
@@ -139,10 +143,14 @@ target_link_libraries(demo tkDNN)
|
||||
message("install dir:" ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY include/ DESTINATION include/)
|
||||
install(TARGETS tkDNN kernels DESTINATION lib)
|
||||
if(BUILD_TESTS)
|
||||
install(TARGETS test_simple test_mnist test_mnistRT test_rtinference demo map_demo DESTINATION bin)
|
||||
endif()
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" # source directory
|
||||
DESTINATION "share/tkDNN/cmake/" # target directory
|
||||
)
|
||||
if(BUILD_TESTS)
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/" # source directory
|
||||
DESTINATION "share/tkDNN/tests" # target directory
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user