Emulate the CMAKE_INSTALL_FULL_* variables on non-Unix systems and
disable redefining FHS-mandated install locations via user-editable
ASSIMP_*_INSTALL_DIR variables. Instead, if it REALLY proves necessary,
Unix users can edit the advanced, canonical CMAKE_INSTALL_* variables.
Linkage against lib or lib64 should be taken into assumption.
Without it we get:
The imported target "assimp::assimp" references the file
"/usr/lib/libassimp.so.5"
When compiling against x86_64 target. The library of couse exits in
/usr/lib64.
see:
https://cmake.org/cmake/help/v3.17/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.html
As i am not a master of cmake this should be double checked if
it doesn't break anything.
Signed-off-by: Nikita Shubin <NShubin@topcon.com>
When built with BUILD_SHARED_LIBS disabled, the exported CMake
targets are modified to reference the static library location.
This also fixes version detection for VS2017 and beyond within
the target import script.
Now the configs follows the standard cmake-package code: see https://cmake.org/cmake/help/v3.12/manual/cmake-packages.7.html
Downstreamer no longer have to manually specify target_include_directories with ${ASSIMP_INCLUDE_DIRS}, target_link_libraries with ${ASSIMP_LIBRARY_DIRS} and so on.
Downstreamer can now use:
find_package(assimp CONFIG REQUIRED)
target_link_libraries(AWESOME_APP PUBLIC assimp::assimp)
and everything should work.
Added assimpTargets.cmake.in
Added assimpTargets-debug.cmake.in
Added assimpTargets-release.cmake.in
Modified CMakeLists.txt
Modified code/CMakeLists.txt - added ALIAS assimp::assimp
Tested on Ubuntu 18.04 and Windows 10