Update NVBench build system with initial standalone support.

This commit is contained in:
Allison Vacanti
2021-03-03 13:54:13 -05:00
parent 2ce12d2201
commit cf71f6ee15
4 changed files with 51 additions and 5 deletions

View File

@@ -1,12 +1,22 @@
# 3.18.3 is needed for a MSVC + NVCC + C++17 bugfix.
cmake_minimum_required(VERSION 3.18.3)
project(nvbench CUDA)
# CXX to work around issues with CUDA-only CMake projects.
project(NVBench CUDA CXX)
option(NVBench_ENABLE_TESTING "Build NVBench testing suite." OFF)
# Setup some vars for CPM packages:
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
# NVBench requires C++17.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)
# TODO this probably should use GNUInstallDirs or something.
set(NVBench_LIBRARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/lib")
set(NVBench_EXECUTABLE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
include(CPM)
CPMAddPackage(
@@ -16,4 +26,8 @@ CPMAddPackage(
)
add_subdirectory(nvbench)
add_subdirectory(testing)
if (NVBench_ENABLE_TESTING)
enable_testing()
add_subdirectory(testing)
endif()