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

[vk-bootstrap] Missing import target when building on Linux #22067

Closed
spnda opened this issue Dec 17, 2021 · 9 comments · Fixed by #32330
Closed

[vk-bootstrap] Missing import target when building on Linux #22067

spnda opened this issue Dec 17, 2021 · 9 comments · Fixed by #32330
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@spnda
Copy link
Contributor

spnda commented Dec 17, 2021

Host Environment

  • OS: x86_64 Linux 5.8.0-43-generic
  • Compiler: g++-11 (Ubuntu 11.1.0-1ubuntu1~20.04)

To Reproduce
This happens when trying to configure a cmake project depending on vk-bootstrap while on Linux.

find_package(vk-bootstrap CONFIG REQUIRED)
target_link_libraries(carbon PUBLIC vk-bootstrap::vk-bootstrap)

Steps to reproduce the behavior:
./vcpkg install vk-bootstrap
mkdir build && cd build
cmake ..

Failure logs

CMake Error in src/carbon/CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "vk-bootstrap::vk-bootstrap"
  configuration "Debug".


CMake Error in src/carbon/CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "vk-bootstrap::vk-bootstrap"
  configuration "Debug".


CMake Error in src/carbon/CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "vk-bootstrap::vk-bootstrap"
  configuration "Debug".

Additional context
I know I made the vk-bootstrap port but it seems like it only worked on Windows, even though it's the same CMake project I'm testing right now. I'm no expert in CMake, but this seems like it's a pretty simple fix that I am just missing.

@FrankXie05 FrankXie05 added the category:question This issue is a question label Dec 21, 2021
@FrankXie05
Copy link
Contributor

@spnda Thanks for posting this issue. Could you please provide this file:

src/carbon/CMakeLists.txt

@FrankXie05 FrankXie05 added requires:author-response requires:more-information This Issue requires more information to solve and removed requires:author-response labels Dec 21, 2021
@spnda
Copy link
Contributor Author

spnda commented Dec 21, 2021

@FrankXie05 I have worked around this in a updated CMakeLists.txt by using vk-bootstrap from a submodule. But this is the older version src/carbon/CMakeLists.txt which still targets vk-bootstrap from vcpkg:

https://github.com/spnda/krypton_engine/blob/8cc5b89fa92780cc95b5f834951916731e222beb/src/carbon/CMakeLists.txt

@FrankXie05 FrankXie05 added category:port-bug The issue is with a library, which is something the port should already support and removed requires:more-information This Issue requires more information to solve category:question This issue is a question labels Dec 21, 2021
@FrankXie05
Copy link
Contributor

We should fix this issue completely.

@FrankXie05 FrankXie05 added category:question This issue is a question and removed category:port-bug The issue is with a library, which is something the port should already support labels Jan 18, 2022
@FrankXie05
Copy link
Contributor

@spnda sorry for the late reply,I checked your CMakeLists.txt and found that about 'target_include_directories("./")', you should use relative paths to avoid such problems :

target_include_directories(carbon PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>)

Of course, your solution is to add between paths to the build. This problem can also be solved. :)

@FrankXie05
Copy link
Contributor

@spnda Is the problem still there? Feel free to re-open if it continues to work.

@spnda
Copy link
Contributor Author

spnda commented Feb 7, 2022

Hi, sorry, I missed your previous comment 17 days ago.

No, nothing has ever fixed this issue. The target include directories have nothing to do with this. Please re-open this issue, as I can't myself. Take the following CMakeLists.txt as an example:

cmake_minimum_required(VERSION 3.21)

project("cmake_test")

add_executable(cmake_test "main.cpp")

find_package(vk-bootstrap CONFIG REQUIRED)
target_link_libraries(cmake_test PUBLIC vk-bootstrap::vk-bootstrap)

Using this CMakeLists.txt I still get the following error when running on Ubuntu (WSL in this case). No error on Windows. I am using CMake 3.22.1 on both platforms with vcpkg at master.

CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "vk-bootstrap::vk-bootstrap".

@FrankXie05 FrankXie05 reopened this Feb 8, 2022
@FrankXie05
Copy link
Contributor

@spnda confirm

@JackBoosY JackBoosY added requires:repro The issue is not currently repro-able and removed category:question This issue is a question labels Feb 25, 2022
@FrankXie05 FrankXie05 added category:port-bug The issue is with a library, which is something the port should already support and removed requires:repro The issue is not currently repro-able labels Apr 1, 2022
@FrankXie05 FrankXie05 added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist and removed category:port-bug The issue is with a library, which is something the port should already support labels Jun 24, 2022
@aaaaaaaaaaargh
Copy link

Seems like this issue still exists:

find_package(vk-bootstrap CONFIG REQUIRED)
target_link_libraries(main PRIVATE vk-bootstrap::vk-bootstrap)

results in

CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "vk-bootstrap::vk-bootstrap"
  configuration "Debug".


CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "vk-bootstrap::vk-bootstrap"
  configuration "Debug".

@dg0yt
Copy link
Contributor

dg0yt commented Jul 1, 2023

@aaaaaaaaaaargh Please test #32330.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
5 participants