-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More updates needed when porting libcudf
- Loading branch information
1 parent
d60491a
commit ffc1f7c
Showing
4 changed files
with
103 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
diff --git a/cmake/libcudacxxInstallRules.cmake b/cmake/libcudacxxInstallRules.cmake | ||
index 446ccb50..f44a61f1 100644 | ||
--- a/cmake/libcudacxxInstallRules.cmake | ||
+++ b/cmake/libcudacxxInstallRules.cmake | ||
@@ -1,5 +1,5 @@ | ||
option(libcudacxx_ENABLE_INSTALL_RULES | ||
- "Enable installation of libcudacxx" ${libcudacxx_TOPLEVEL_PROJECT} | ||
+ "Enable installation of libcudacxx" ${LIBCUDACXX_TOPLEVEL_PROJECT} | ||
) | ||
|
||
if (NOT libcudacxx_ENABLE_INSTALL_RULES) | ||
@@ -12,15 +12,17 @@ include(GNUInstallDirs) | ||
# Libcudacxx headers | ||
install(DIRECTORY "${libcudacxx_SOURCE_DIR}/include/cuda" | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
+ PATTERN CMakeLists.txt EXCLUDE | ||
) | ||
install(DIRECTORY "${libcudacxx_SOURCE_DIR}/include/nv" | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
+ PATTERN CMakeLists.txt EXCLUDE | ||
) | ||
|
||
# Libcudacxx cmake package | ||
install(DIRECTORY "${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake" | ||
- PATTERN libcudacxx-header-search EXCLUDE | ||
+ PATTERN *.cmake.in EXCLUDE | ||
) | ||
|
||
# Need to configure a file to store CMAKE_INSTALL_INCLUDEDIR | ||
@@ -30,6 +32,7 @@ configure_file("${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx/libcudacxx-header- | ||
"${libcudacxx_BINARY_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake" | ||
@ONLY | ||
) | ||
+set(install_location "${CMAKE_INSTALL_LIBDIR}/cmake/libcudacxx") | ||
install(FILES "${libcudacxx_BINARY_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake" | ||
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libcudacxx" | ||
+ DESTINATION "${install_location}" | ||
) | ||
diff --git a/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in b/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in | ||
index 9e7e187c..cb3b946f 100644 | ||
--- a/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in | ||
+++ b/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in | ||
@@ -1,8 +1,18 @@ | ||
# Parse version information from version header: | ||
unset(_libcudacxx_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search | ||
+ | ||
+# Find CMAKE_INSTALL_INCLUDEDIR=@CMAKE_INSTALL_INCLUDEDIR@ directory" | ||
+set(from_install_prefix "@install_location@") | ||
+ | ||
+# Transform to a list of directories, replace each directory with "../" | ||
+# and convert back to a string | ||
+string(REGEX REPLACE "/" ";" from_install_prefix "${from_install_prefix}") | ||
+list(TRANSFORM from_install_prefix REPLACE ".+" "../") | ||
+list(JOIN from_install_prefix "" from_install_prefix) | ||
+ | ||
find_path(_libcudacxx_VERSION_INCLUDE_DIR cuda/std/detail/__config | ||
NO_DEFAULT_PATH # Only search explicit paths below: | ||
PATHS | ||
- "${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_INCLUDEDIR@" # Install tree | ||
+ "${CMAKE_CURRENT_LIST_DIR}/${from_install_prefix}/@CMAKE_INSTALL_INCLUDEDIR@" # Install tree | ||
) | ||
set_property(CACHE _libcudacxx_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters