From: Ben Ashbaugh Date: Tue, 8 Sep 2020 16:53:17 +0000 (-0700) Subject: skip testing except for icd loader project (#117) X-Git-Tag: upstream/v2022.01.04~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d12be05763dd231ab14a63f6b52895ed7b876e7;p=platform%2Fupstream%2FOpenCL-ICD-Loader.git skip testing except for icd loader project (#117) * skip testing except for icd loader project * add option for testing when embedding the loader in other projects --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 63cad9d..a0da4d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,8 +148,12 @@ endif() target_include_directories (OpenCL PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader) target_link_libraries (OpenCL ${CMAKE_DL_LIBS}) -include (CTest) -if (BUILD_TESTING) +option (OPENCL_ICD_LOADER_BUILD_TESTING "Enable support for OpenCL ICD Loader testing." OFF) + +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR OPENCL_ICD_LOADER_BUILD_TESTING) + include(CTest) +endif() +if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR OPENCL_ICD_LOADER_BUILD_TESTING) AND BUILD_TESTING) add_subdirectory (test) endif()