Skip to content

Commit

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

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

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - Paul Taylor (https://github.com/trxcllnt)

URL: #488
  • Loading branch information
ajschmidt8 authored Feb 7, 2022
1 parent 98c03a0 commit c63083c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
10 changes: 9 additions & 1 deletion cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ target_include_directories(cuspatial_benchmark_common
function(ConfigureBench CMAKE_BENCH_NAME)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(${CMAKE_BENCH_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/gbenchmarks>")
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/gbenchmarks>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
)
target_link_libraries(${CMAKE_BENCH_NAME} PRIVATE benchmark::benchmark_main cuspatial_benchmark_common)
install(
TARGETS ${CMAKE_BENCH_NAME}
COMPONENT testing
DESTINATION bin/benchmarks/libcuspatial
EXCLUDE_FROM_ALL
)
endfunction(ConfigureBench)

###################################################################################################
Expand Down
15 changes: 12 additions & 3 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,26 @@ function(ConfigureTest CMAKE_TEST_NAME)
target_include_directories(${CMAKE_TEST_NAME}
PRIVATE "$<BUILD_INTERFACE:${CUSPATIAL_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CUSPATIAL_SOURCE_DIR}/src>")
set_target_properties(${CMAKE_TEST_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/gtests>")
set_target_properties(
${CMAKE_TEST_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/gtests>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
)
target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main cudf::cudftestutil cuspatial)
add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME})
install(
TARGETS ${CMAKE_TEST_NAME}
COMPONENT testing
DESTINATION bin/gtests/libcuspatial
EXCLUDE_FROM_ALL
)
endfunction(ConfigureTest)

###################################################################################################
### test sources ##################################################################################
###################################################################################################

ConfigureTest(CUBIC_SPLINE_TEST
ConfigureTest(CUBIC_SPLINE_TEST
interpolate/cubic_spline_test.cpp)

ConfigureTest(COORDINATE_TRANSFORM_TEST
Expand Down

0 comments on commit c63083c

Please sign in to comment.