Skip to content

Commit

Permalink
Add CMake install rules for tests (rapidsai#4551)
Browse files Browse the repository at this point in the history
This PR adds a CMake `install` rule for test and benchmark targets. This step is a prerequisite to being able to package tests/benchmarks in their own `conda` package, which will enable use to deprecate _Project Flash_.

Authors:
  - AJ Schmidt (https://github.com/ajschmidt8)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai#4551
  • Loading branch information
ajschmidt8 authored Feb 9, 2022
1 parent e589c11 commit ede9019
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ if(BUILD_CUML_BENCH)
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src_prims>
)

set_target_properties(
${CUML_CPP_BENCH_TARGET}
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../../lib"
)

install(
TARGETS ${CUML_CPP_BENCH_TARGET}
COMPONENT testing
DESTINATION bin/benchmarks/libcuml
EXCLUDE_FROM_ALL
)
endif()

##############################################################################
Expand Down Expand Up @@ -97,4 +109,16 @@ if(BUILD_CUML_PRIMS_BENCH)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src_prims>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

set_target_properties(
${PRIMS_BENCH_TARGET}
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../../lib"
)

install(
TARGETS ${PRIMS_BENCH_TARGET}
COMPONENT testing
DESTINATION bin/benchmarks/libcuml_prims
EXCLUDE_FROM_ALL
)
endif()
34 changes: 34 additions & 0 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ if(BUILD_CUML_TESTS)
${COMMON_TEST_LINK_LIBRARIES}
)

set_target_properties(
${CUML_CPP_TARGET}
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../../lib"
)

install(
TARGETS ${CUML_CPP_TARGET}
COMPONENT testing
DESTINATION bin/gtests/libcuml
EXCLUDE_FROM_ALL
)
endif()

#############################################################################
Expand Down Expand Up @@ -133,6 +144,18 @@ if(BUILD_CUML_MG_TESTS)
cumlprims_mg::cumlprims_mg
)

set_target_properties(
${CUML_MG_TEST_TARGET}
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../../lib"
)

install(
TARGETS ${CUML_MG_TEST_TARGET}
COMPONENT testing
DESTINATION bin/gtests/libcuml_mg
EXCLUDE_FROM_ALL
)

else(MPI_CXX_FOUND)
message("OpenMPI not found. Skipping test '${CUML_MG_TEST_TARGET}'")
endif()
Expand Down Expand Up @@ -222,6 +245,17 @@ if(BUILD_PRIMS_TESTS)
${COMMON_TEST_LINK_LIBRARIES}
)

set_target_properties(
${PRIMS_TEST_TARGET}
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../../lib"
)

install(
TARGETS ${PRIMS_TEST_TARGET}
COMPONENT testing
DESTINATION bin/gtests/libcuml_prims
EXCLUDE_FROM_ALL
)
endif()

##############################################################################
Expand Down

0 comments on commit ede9019

Please sign in to comment.