-
Notifications
You must be signed in to change notification settings - Fork 154
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
CMake Error: Imported target "kompute::kompute" includes non-existent path "/usr/local/single_include" #212
Comments
One solution I can think of is if one has enabled target_include_directories(
kompute PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
# Including Kompute.hpp from single_include if Vulkan Kompute is not installed
# If Vulkan Kompute is installed and we include these directories, cmake will try
# to find a path under a non-existance directory (because single_include doesn't get added)
if(NOT KOMPUTE_OPT_INSTALL)
target_include_directories(
kompute PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/single_include>
$<INSTALL_INTERFACE:single_include>
)
endif() |
Good shout @unexploredtest, good to have the discussion on the chat docuemnted as an issue. L ooking at this proposed solution generally it does make sense, however in the context of the examples (as per the example folder), users may want to include the kompute dependency via cmake import, and may want to use it in their projects through the Also, just to confirm, the expected way of using the single include is via |
Yeah I see, I just need a bit of clarification. For example, in the example 'array_multiplication', you mean first building Kompute without install and then using
With or without installation? |
That is correct, you can see that in the cmakelists it only imports the project (as uses by default not KOMPUTE_ARR_OPT_INSTALLED_KOMPUTE) - it then allows for the
In both cases you would reference the file as |
I see,
Makes sense, but I'm a bit confused, why target_include_directories(
kompute PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/single_include
) was used, was there an issue with this approach? |
Good point, I think there were issues I found when the explicit interfaces were not being used, particularly in the context of the examples like the android one. However it does seem like you have been able to take it to the test, and if we can go back to this simpler appraoch it would be much better to be honest. |
I see, makes sense. In my case it appears that |
Good suggestion, I think for now it woudl make sense to go back to the simpler version. If you open a PR we can merge going back to that, and then as we approach the next release I can make sure all examples run with the relevant conditional statements that are specific to those. |
Sure! With the new suggestion? |
Yes exactly - with the one you suggested above, namely:
Assuming that it would ensure both are included in the build and install interface |
Fixed with #213 |
So, how about target_include_directories(
kompute PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/single_include>
$<INSTALL_INTERFACE:include>
)
if(NOT KOMPUTE_OPT_INSTALL)
target_include_directories(
kompute PUBLIC
$<INSTALL_INTERFACE:single_include>
)
endif() Because I when we run examples, |
This should now be fixed , and with glslang removed should be more robust |
When Vulkan Kompute is installed globally, it'll try to find
/usr/local/single_include
but it doesn't exist, the cause of problem is from:In
src/CMakeLists.txt
.The text was updated successfully, but these errors were encountered: