Issue
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?
Solution
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.
Answered By - peter_w