0

I have the latest assimp source code (5.0.1 release), I have built it with CMake and installed using cmake --install. Now I am trying to add it to my CMake project: find_package(Assimp REQUIRED Assimp) - at this moment it configures fine. The problems started when I tried to add

target_link_libraries(
    MyProj PRIVATE
    Assimp::Assimp
)

And I get the following error:

[cmake]   target "MyProj" links to target "Assimp::Assimp" but the target
[cmake]   was not found.  Perhaps a find_package() call is missing for an IMPORTED
[cmake]   target, or an ALIAS target is missing?

After some research, I've tried target_link_libraries(MyProj PRIVATE ${ASSIMP_LIBRARIES}), this time I got a compile error, and when I displayed the value of the ${ASSIMP_LIBRARIES} variable (command: message("${ASSIMP_LIBRARIES}")) I got: assimp-vc142-mt.dll - it contains .dll name, even without full path. Have a lot of troubles with assimp, could anyone suggest a solution?

1
  • I am doing that on Windows 10, using Visual Studio compiler. Commented May 30, 2021 at 21:22

1 Answer 1

1

Without having any knowledge of assimp, I think what you want is this:

target_link_libraries(MyProj PRIVATE assimp::assimp)

As far as I know, CMake target names are case sensitive and the assimp::assimp alias target is created here with lowercase a.

1
  • Whaaaat?! One day of looking for a solution and the problem was about uppercase letters?! Thank you a lot for your help. At least now this project is configured without errors. But now I get a compile-time error: ..\lib\bin\assimp-vc142-mt.dll : fatal error LNK1107, because in generated Visual Studio solution in Linker Input section I have ..\lib\bin\assimp-vc142-mtd.dll instead of .lib. But still thanks a lot! Commented May 31, 2021 at 19:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.