Skip to content

Commit

Permalink
Change create_modules to return the set of created targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed May 12, 2022
1 parent 7f9e6ab commit 40fabfe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rapids-cmake/cython/create_modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ extension module.
an absolute path in a relocatable way. If not provided, defaults to the path
to CMAKE_CURRENT_SOURCE_DIR relative to PROJECT_SOURCE_DIR.
Result Variables
^^^^^^^^^^^^^^^^
:cmake:variable:`RAPIDS_CYTHON_CREATED_TARGETS` will be set to a list of
targets created by this function.
#]=======================================================================]
function(rapids_cython_create_modules)
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/detail/verify_init.cmake)
Expand All @@ -69,6 +74,8 @@ function(rapids_cython_create_modules)
set(language "CXX")
endif()

set(CREATED_TARGETS "")

foreach(cython_filename IN LISTS RAPIDS_CYTHON_SOURCE_FILES)
# Generate a reasonable module name.
cmake_path(GET cython_filename FILENAME cython_module)
Expand All @@ -95,5 +102,9 @@ function(rapids_cython_create_modules)
OUTPUT_VARIABLE RAPIDS_CYTHON_INSTALL_DIR)
endif()
install(TARGETS ${cython_module} DESTINATION ${RAPIDS_CYTHON_INSTALL_DIR})

list(APPEND CREATED_TARGETS "${cython_module}")
endforeach()

set(RAPIDS_CYTHON_CREATED_TARGETS ${CREATED_TARGETS} PARENT_SCOPE)
endfunction()

0 comments on commit 40fabfe

Please sign in to comment.