diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ # set some default settings enable_testing() -set(BUILD_TESTING ON) find_package(ECM 5.15.0 NO_MODULE) @@ -104,7 +103,9 @@ check_function_exists(statvfs64 HAVE_STATVFS64) add_subdirectory(src) -add_subdirectory(testlib) +if(BUILD_TESTING) + add_subdirectory(testlib) +endif() add_subdirectory(examples) add_subdirectory(doc) diff --git a/src/datachecker/CMakeLists.txt b/src/datachecker/CMakeLists.txt --- a/src/datachecker/CMakeLists.txt +++ b/src/datachecker/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set(datachecker_HDR datacheckerthread.h diff --git a/src/dht/CMakeLists.txt b/src/dht/CMakeLists.txt --- a/src/dht/CMakeLists.txt +++ b/src/dht/CMakeLists.txt @@ -31,4 +31,6 @@ install(FILES ${dht_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libktorrent/dht COMPONENT Devel) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/src/diskio/CMakeLists.txt b/src/diskio/CMakeLists.txt --- a/src/diskio/CMakeLists.txt +++ b/src/diskio/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set(diskio_HDR cache.h diff --git a/src/download/CMakeLists.txt b/src/download/CMakeLists.txt --- a/src/download/CMakeLists.txt +++ b/src/download/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set (download_HDR chunkdownload.h diff --git a/src/magnet/CMakeLists.txt b/src/magnet/CMakeLists.txt --- a/src/magnet/CMakeLists.txt +++ b/src/magnet/CMakeLists.txt @@ -6,4 +6,6 @@ install(FILES ${magnet_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libktorrent/magnet COMPONENT Devel) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/src/mse/CMakeLists.txt b/src/mse/CMakeLists.txt --- a/src/mse/CMakeLists.txt +++ b/src/mse/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set(mse_HDR encryptedserverauthenticate.h diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt --- a/src/net/CMakeLists.txt +++ b/src/net/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set(net_HDR socks.h diff --git a/src/peer/CMakeLists.txt b/src/peer/CMakeLists.txt --- a/src/peer/CMakeLists.txt +++ b/src/peer/CMakeLists.txt @@ -21,4 +21,6 @@ install(FILES ${peer_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libktorrent/peer COMPONENT Devel) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/src/torrent/CMakeLists.txt b/src/torrent/CMakeLists.txt --- a/src/torrent/CMakeLists.txt +++ b/src/torrent/CMakeLists.txt @@ -19,4 +19,6 @@ install(FILES ${torrent_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libktorrent/torrent COMPONENT Devel) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set(util_HDR autorotatelogjob.h diff --git a/src/utp/CMakeLists.txt b/src/utp/CMakeLists.txt --- a/src/utp/CMakeLists.txt +++ b/src/utp/CMakeLists.txt @@ -13,4 +13,6 @@ ) install(FILES ${utp_HDR} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libktorrent/utp COMPONENT Devel) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif()