From 9145a835df51d3ef68d66ec57eb41458c67398e9 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Wed, 26 May 2021 00:22:28 -0700 Subject: [PATCH 1/2] make it easier to include rmm in other projects --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35f187697..cad4a0307 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(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND (BUILD_TESTS OR BUILD_BENCHMARKS)) # 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(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTS) enable_testing() add_subdirectory(tests) -endif(BUILD_TESTS) +endif() # add google benchmark -if(BUILD_BENCHMARKS) +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_BENCHMARKS) add_subdirectory(benchmarks) -endif(BUILD_BENCHMARKS) +endif() # install targets From 2ca2a42c9ffe3d0c6a638149ca2db23be715c683 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Wed, 26 May 2021 08:41:04 -0700 Subject: [PATCH 2/2] reverse if clauses --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79a28d837..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(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND (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,14 +103,14 @@ endif() # optionally build tests -if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTS) +if(BUILD_TESTS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) enable_testing() add_subdirectory(tests) endif() # add google benchmark -if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_BENCHMARKS) +if(BUILD_BENCHMARKS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) add_subdirectory(benchmarks) endif()