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

The imported target "assimp::assimp" references the file which doesn't exist #11092

Closed
wanlizhu opened this issue Apr 30, 2020 · 2 comments
Closed
Assignees
Labels
category:question This issue is a question

Comments

@wanlizhu
Copy link

Describe the bug
I kind of figuring out the reason for this bug. I open this issue just in case you guys can have a better solution.

I install assimp package successful, and the CMake complains about the imported library path of target assimp::assimp which doesn't exist in the file system. But, it does exist with a different name.

I have both MSVC2017 and MSVC2019 installed on my machine. The compiler that builds assimp is MSVC2019, so the output name of assimp is assimp-vc142-mtd.lib. When I find and link to assimp in my own project, assimp's CMake configuration is trying to find assimp-vc141-mtd.lib .

The -vc141 suffix which CMake failed to find in file system is determined at line 36 in file vcpkg\installed\x64-windows\share\assimp\assimpTargets-debug.cmake.

I believe that this problem can be avoided if the output name of assimp doesn't contain compiler version tag, -vc142.

Can we rename assimp's output name to something without redundant suffix like -vc142?

Environment

  • OS: [Window]
  • Compiler: MSVC2019 and MSVC2017

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install assimp
  2. find_package(assimp REQUIRED)
  3. error shows up

reproduce code:

./vcpkg install assimp
find_package(assimp  REQUIRED)

Expected behavior
no error

Failure logs

CMake Error at C:/Users/zhuwa.ADS/vcpkg/installed/x64-windows/share/assimp/assimpTargets.cmake:86 (message):
[cmake]   The imported target "assimp::assimp" references the file
[cmake] 
[cmake]      "C:/Users/zhuwa.ADS/vcpkg/installed/x64-windows/debug/lib/assimp-vc141-mtd.lib"
[cmake] 
[cmake]   but this file does not exist.  Possible reasons include:
[cmake] 
[cmake]   * The file was deleted, renamed, or moved to another location.
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/zhuwa.ADS/Desktop/GraphicsEngine/Experimental/DejaVu/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Users/zhuwa.ADS/Desktop/GraphicsEngine/Experimental/DejaVu/build/CMakeFiles/CMakeError.log".
[cmake] 
[cmake]   * An install or uninstall procedure did not complete successfully.
[cmake] 
[cmake]   * The installation package was faulty and contained
[cmake] 
[cmake]      "C:/Users/zhuwa.ADS/vcpkg/installed/x64-windows/share/assimp/assimpTargets.cmake"
[cmake] 
[cmake]   but not all the files it references.
[cmake] 
[cmake] Call Stack (most recent call first):
[cmake]   C:/Users/zhuwa.ADS/vcpkg/installed/x64-windows/share/assimp/assimp-config.cmake:1 (include)
[cmake]   C:/Users/zhuwa.ADS/vcpkg/scripts/buildsystems/vcpkg.cmake:329 (_find_package)

Additional context
Add any other context about the problem here.

@emptyVoid
Copy link
Contributor

Generally it's not a good idea to mix C++ code compiled by different compilers (even by different versions of the same compiler).

Instead you can create a custom triplet, e.g. x64-windows-v141.cmake:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET v141)

Install necessary packages with this triplet, e.g. .\vcpkg.exe install assimp --triplet x64-windows-v141.

And integrate it into your build system.

@LilyWangL LilyWangL self-assigned this May 6, 2020
@LilyWangL LilyWangL added the category:question This issue is a question label May 20, 2020
@LilyWangL
Copy link
Contributor

Thanks for posting this issue. Please reopen this issue if this is still a problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants