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>
This is a follow-up to PR #3024, in which I explained that I would then change the version of CMake to 3.0 in several files to match the changes that were originally made by OP in PR #3008.
The minimum CMake version have been raised to 3.0 in both assimp_cmd and assimp_view projects.
The same CMake configuration as in PR #3024 was used. All projects from PR #3024 are found in the solution with the current changes. All projects built. All tests were run.
The following changes were tested against building with a master copy.
For a more detailed report, please read the followings below:
The flags that were checked were the ones checked by default + the following:
ASSIMP_BUILD_ASSIMP_VIEW
ASSIMP_BUILD_SAMPLES
The list of compilable projects in Visual Studio were the following:
- assimp
- assimp_cmd
- assimp_simpleogl
- assimp_simpletextureddirectx11
- assimp_simpletexturedogl
- assimp_viewer
- INSTALL
- IrrXML
- uninstall
- unit
- UpdateAssimpLibsDebugSymbolsAndDLLs
- ZERO_CHECK
- zlib
- zlibstatic
The solution that was generated with the new changes comprised the same number of projects as the one from the master, unmodified. All projects except UpdateAssimpLibsDebugSymbolsAndDLLs were built without any error. All tests were run.
UpdateAssimpLibsDebugSymbolsAndDLLs could not be built because of the reasons explained in issue #3004.
If ASSIMP_NO_EXPORT is not defined:
- don't add the macro for the exporters
- don't include the files for all the exporter
- don't display any messages about what exporters are enabled or not
- Added function "cleanup" to centralize release of resources.
- Added function "freeTextureIds" to free textureIds memory.
- Added call to freeTextureIds in LoadGLTextures to free memory before it is allocated again.
- Made several changes in KillGLWindow to prevent certain Win32 handle/resources
from being released more than once.