diff --git a/CMakeLists.txt b/CMakeLists.txt index 8debfa4..4b9c134 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,8 @@ project(Cpp-Taskflow VERSION 2.3.1 LANGUAGES CXX) # build options option(TF_ENABLE_CUDA "Enables build of cuda code" OFF) option(TF_BUILD_BENCHMARKS "Enables build of benchmarks" OFF) +option(TF_BUILD_EXAMPLES "Enable build of examples" OFF) +option(TF_BUILD_TESTS "Enable build of tests" OFF) # Include additional language check include(CheckLanguage) @@ -227,6 +229,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE # Example program # ----------------------------------------------------------------------------- +if (TF_BUILD_EXAMPLES) message(STATUS "Building examples ...") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TF_EXAMPLE_DIR}) @@ -289,10 +292,12 @@ target_link_libraries( device_property ${PROJECT_NAME} Threads::Threads tf::default_settings ) endif(${TF_ENABLE_CUDA}) +endif(TF_BUILD_EXAMPLES) # ----------------------------------------------------------------------------- # Unittest # ----------------------------------------------------------------------------- +if (TF_BUILD_TESTS) enable_testing() message(STATUS "Building unit tests ...") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TF_UTEST_DIR}) @@ -516,6 +521,7 @@ add_test(cuda_matrix.transpose ${TF_UTEST_DIR}/cuda/cuda_matrix -tc=transpose) add_test(cuda_matrix.product ${TF_UTEST_DIR}/cuda/cuda_matrix -tc=product) endif(${TF_ENABLE_CUDA}) +endif(TF_BUILD_TESTS) # ----------------------------------------------------------------------------- # Benchmarking (enabled by TF_BUILD_BENCHMARKS)