Skip to content

Commit

Permalink
Cleanup cmake usage when MatX is a dependent project (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmartin-gh authored Jan 16, 2025
1 parent 8a013cc commit 39ba917
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ endif()
if(NOT DEFINED rapids-cmake-dir)
include(FetchContent)
# Tell FetchContent to just use the local copy of rapids-cmake:
set(FETCHCONTENT_SOURCE_DIR_RAPIDS_CMAKE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rapids-cmake")
FetchContent_Declare(rapids-cmake URL https://github.com/rapidsai/rapids-cmake/archive/refs/heads/branch-24.12.zip)
FetchContent_Declare(rapids-cmake SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rapids-cmake")

# Tell FetchContent to download remote copy of rapids-cmake:
#FetchContent_Declare(rapids-cmake URL https://github.com/rapidsai/rapids-cmake/archive/refs/heads/branch-24.12.zip)
FetchContent_MakeAvailable(rapids-cmake)
else()
# The include() commands below search the module path for the corresponding .cmake files
Expand Down
12 changes: 6 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ set (test_sources
)

# Some of <00_io> tests need csv files and binaries which all
# are located under 'CMAKE_SOURCE_DIR/test/00_io'. When calling the test
# are located under 'CMAKE_CURRENT_SOURCE_DIR/00_io'. When calling the test
# executable <matx_test> from its location in 'CMAKE_BINARY_DIR/test' the
# search paths according <FileIOTests.cu> are
# '../test/00_io/small_csv_comma_nh.csv' and
# '../test/00_io/small_csv_complex_comma_nh.csv' respectively. Therefore
# they must be copied to the correct location:
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test/00_io)
file(COPY
${CMAKE_SOURCE_DIR}/test/00_io/small_csv_comma_nh.csv
${CMAKE_CURRENT_SOURCE_DIR}/00_io/small_csv_comma_nh.csv
DESTINATION ${CMAKE_BINARY_DIR}/test/00_io
)
file(COPY
${CMAKE_SOURCE_DIR}/test/00_io/small_csv_complex_comma_nh.csv
${CMAKE_CURRENT_SOURCE_DIR}/00_io/small_csv_complex_comma_nh.csv
DESTINATION ${CMAKE_BINARY_DIR}/test/00_io
)
file(COPY
${CMAKE_SOURCE_DIR}/test/00_io/test.mat
${CMAKE_CURRENT_SOURCE_DIR}/00_io/test.mat
DESTINATION ${CMAKE_BINARY_DIR}/test/00_io
)
file(COPY
${CMAKE_SOURCE_DIR}/test/00_io/test.npy
${CMAKE_CURRENT_SOURCE_DIR}/00_io/test.npy
DESTINATION ${CMAKE_BINARY_DIR}/test/00_io
)

Expand All @@ -72,7 +72,7 @@ foreach (ptest ${proprietary_sources})
list(APPEND proprietary_inc_list ${incdir}/../examples)
endforeach()

set(target_inc ${CMAKE_SOURCE_DIR}/test/include ${CMAKE_SOURCE_DIR}/examples/ ${proprietary_inc_list})
set(target_inc ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../examples/ ${proprietary_inc_list})
set(system_inc ${CUTLASS_INC} ${GTEST_INC_DIRS} ${pybind11_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})

set(all_test_srcs ${test_sources} ${proprietary_sources})
Expand Down

0 comments on commit 39ba917

Please sign in to comment.