Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake abosule paths in build interface #331

Merged
merged 1 commit into from Jun 4, 2023
Merged

Fix cmake abosule paths in build interface #331

merged 1 commit into from Jun 4, 2023

Conversation

AgarwalSaurav
Copy link
Contributor

GLOB creates absolute paths requiring the BUILD_INTERFACE generator to be placed inside quotes.

Currently, here is what the autogenerated TorchSparseTargets.cmake looks like:

set_target_properties(TorchSparse::TorchSparse PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "/home/user/opt/pytorch_sparse/"
)

This causes an error when the TorchSparse::TorchSparse is added to other projects because of the absolute path.

Adding quotes to the generator in CMakeLists.txt fixes this issue.

target_include_directories(${PROJECT_NAME} INTERFACE
  "$<BUILD_INTERFACE:${HEADERS}>"
  $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

@rusty1s rusty1s merged commit 0355738 into rusty1s:master Jun 4, 2023
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants