Skip to content

Commit

Permalink
Revert "Map CMake install components to conda library packages (rapid…
Browse files Browse the repository at this point in the history
…sai#653)"

This reverts commit 5a9626e.
  • Loading branch information
cjnolet committed May 17, 2022
1 parent 0538acc commit 01db54a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 44 deletions.
80 changes: 40 additions & 40 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ install(TARGETS raft

install(TARGETS raft_distance
DESTINATION ${lib_dir}
COMPONENT raft
COMPONENT raft_distance
EXPORT raft-distance-exports)

install(TARGETS raft_nn
DESTINATION ${lib_dir}
COMPONENT raft
COMPONENT raft_nn
EXPORT raft-nn-exports)

if(TARGET raft_distance_lib)
Expand Down Expand Up @@ -394,44 +394,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/raft/version_config.hpp
COMPONENT raft
DESTINATION include/raft)

##############################################################################
# - export/install optional components --------------------------------------

include("${rapids-cmake-dir}/export/write_dependencies.cmake")

set(raft_components distance nn)
set(raft_install_comp "" "")
if(TARGET raft_distance_lib)
list(APPEND raft_components distance-lib)
list(APPEND raft_install_comp _distance)
endif()
if(TARGET raft_nn_lib)
list(APPEND raft_components nn-lib)
list(APPEND raft_install_comp _nn)
endif()

foreach(comp install_comp IN ZIP_LISTS raft_components raft_install_comp)
install(
EXPORT raft-${comp}-exports
FILE raft-${comp}-targets.cmake
NAMESPACE raft::
DESTINATION "${lib_dir}/cmake/raft"
COMPONENT raft${install_comp}
)
export(
EXPORT raft-${comp}-exports
FILE ${RAFT_BINARY_DIR}/raft-${comp}-targets.cmake
NAMESPACE raft::
)
rapids_export_write_dependencies(
BUILD raft-${comp}-exports "${PROJECT_BINARY_DIR}/raft-${comp}-dependencies.cmake"
)
rapids_export_write_dependencies(
INSTALL raft-${comp}-exports "${PROJECT_BINARY_DIR}/rapids-cmake/raft/export/${install_comp}/raft-${comp}-dependencies.cmake"
)

endforeach()

##############################################################################
# - install export -----------------------------------------------------------
set(doc_string
Expand Down Expand Up @@ -500,6 +462,44 @@ raft_export(BUILD raft
NAMESPACE raft::
FINAL_CODE_BLOCK code_string)

##############################################################################
# - export/install optional components --------------------------------------

include("${rapids-cmake-dir}/export/write_dependencies.cmake")

set(raft_components distance nn)
set(raft_install_comp distance nn)
if(TARGET raft_distance_lib)
list(APPEND raft_components distance-lib)
list(APPEND raft_install_comp distance)
endif()
if(TARGET raft_nn_lib)
list(APPEND raft_components nn-lib)
list(APPEND raft_install_comp nn)
endif()

foreach(comp install_comp IN ZIP_LISTS raft_components raft_install_comp)
install(
EXPORT raft-${comp}-exports
FILE raft-${comp}-targets.cmake
NAMESPACE raft::
DESTINATION "${lib_dir}/cmake/raft"
COMPONENT raft_${install_comp}
)
export(
EXPORT raft-${comp}-exports
FILE ${RAFT_BINARY_DIR}/raft-${comp}-targets.cmake
NAMESPACE raft::
)
rapids_export_write_dependencies(
BUILD raft-${comp}-exports "${PROJECT_BINARY_DIR}/raft-${comp}-dependencies.cmake"
)
rapids_export_write_dependencies(
INSTALL raft-${comp}-exports "${PROJECT_BINARY_DIR}/rapids-cmake/raft/export/${install_comp}/raft-${comp}-dependencies.cmake"
)

endforeach()

##############################################################################
# - build test executable ----------------------------------------------------

Expand Down
4 changes: 0 additions & 4 deletions cpp/cmake/modules/raft_export.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@ function(raft_export type project_name)
file(MAKE_DIRECTORY "${scratch_dir}")
install(DIRECTORY "${scratch_dir}" DESTINATION "${install_location}"
COMPONENT raft_${comp})
if(EXISTS "${scratch_dir}/raft-${comp}-dependencies.cmake")
install(FILES "${scratch_dir}/raft-${comp}-dependencies.cmake" DESTINATION "${install_location}"
COMPONENT raft)
endif()
endforeach()

else()
Expand Down

0 comments on commit 01db54a

Please sign in to comment.