Using CMake 3.15 & Visual Studio 2019 to build on windows produced a cmake configuration which was unable to be used by clients. Investigating this I was eventually able to determine this was caused by a mismatch in the target properties. Specifically, it was setting the TYPE property to STATIC_LIBRARY even though it was building as a SHARED_LIBRARY.
This in turn was because the if clause on line `if(@BUILD_SHARED_LIBS@)` of this file was evaluating to `if (ON)` which was then not properly evaluated while under the CMake 2.6 policy. Explicitly setting the `CMP0012` policy to NEW fixes the problem.
By default, Linux distro installs assimp into /usr/include/assimp
In case of this commit, fix hint path to include default path
Signed-off-by: Maksym Sditanov <msditanov@200volts.com>
Add /usr/lib64 and /usr/lib directory hints to cmake module
libassimp.so library installs in /usr/lib for 32bit or
in /usr/lib64 for 64bit distros.
All linux distros apply custom patch to extend cmake HINTs to
systems /usr/lib and /usr/lib64
(see https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/assimp/files/findassimp-3.3.1.patch)
Signed-off-by: Maksym Sditanov <msditanov@200volts.com>
Instead of using if(ON)/if(OFF) to determine which of the "hardcoded"
add_library(... SHARED ...) or (... STATIC ...) should be used,
specify a new BUILD_LIB_TYPE variable that is set directly to either
SHARED or STATIC and substituted in the `add_library()` statement
when assimpTargets.cmake.in is configured.
This removes a CMP0012 collision with prior `cmake_policy(VERSION 2.6)`
statement and makes the CMP0012 warning not appear in users' projects.
This problem is mentioned in issue #2685.