diff --git a/CMakeLists.txt b/CMakeLists.txt index 00d143777..6b9c9fd66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,7 @@ set_property(CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS "TRACE" "DEBUG" "INFO" "WA "CRITICAL" "OFF") message(STATUS "RMM: RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'") -if(BUILD_TESTS OR BUILD_BENCHMARKS) +if((BUILD_TESTS OR BUILD_BENCHMARKS) AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) # Auto-detect available GPU compute architectures include(${RMM_SOURCE_DIR}/cmake/Modules/SetGPUArchs.cmake) # Enable the CUDA language after setting CMAKE_CUDA_ARCHITECTURES @@ -103,16 +103,16 @@ endif() # optionally build tests -if(BUILD_TESTS) +if(BUILD_TESTS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) enable_testing() add_subdirectory(tests) -endif(BUILD_TESTS) +endif() # add google benchmark -if(BUILD_BENCHMARKS) +if(BUILD_BENCHMARKS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) add_subdirectory(benchmarks) -endif(BUILD_BENCHMARKS) +endif() # install targets