Add headers to install and set default install dir

This commit is contained in:
Olli Saarikivi
2023-05-12 21:23:01 +00:00
parent 260c3e35f0
commit d58e698d51
2 changed files with 9 additions and 0 deletions

View File

@@ -8,6 +8,10 @@ option(USE_MPI_FOR_TESTS "Use MPI for tests" ON)
option(USE_NPKIT "Use NPKIT" ON)
option(ALLOW_GDRCOPY "Use GDRCopy, if available" OFF)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/installed" CACHE PATH "default install path" FORCE)
endif()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(CUDAToolkit REQUIRED)
@@ -24,6 +28,7 @@ include_directories(${CUDAToolkit_INCLUDE_DIRS})
include(CTest)
include(FetchContent)
FetchContent_Declare(googletest URL https://github.com/google/googletest/archive/b796f7d44681514f58a683a3a71ff17c94edb0c1.zip)
option(INSTALL_GTEST OFF)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)
@@ -45,5 +50,6 @@ if(ALLOW_GDRCOPY AND GDRCOPY_FOUND)
target_link_libraries(mscclpp PRIVATE MSCCLPP::gdrcopy)
endif()
add_subdirectory(include) # This adds the public headers to install with mscclpp
add_subdirectory(src) # This adds the sources to the mscclpp target
add_subdirectory(test)

3
include/CMakeLists.txt Normal file
View File

@@ -0,0 +1,3 @@
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp)
target_sources(mscclpp PUBLIC FILE_SET HEADERS FILES ${HEADERS})
install(TARGETS mscclpp FILE_SET HEADERS)