Answer the question
In order to leave comments, you need to log in
How to force CMake to look for a library of the required bitness through find_package?
I collected x86 and x64 , moreover, it did not work in one directory. CMake gave an error when trying to configure a different bit depth (relative to the previous one). I need to somehow choose the directory to search for OpenCVConfig.cmake via find_package()
, i.e. add it to CMAKE_PREFIX_PATH
visible. I looked as far as possible through FIND_LIBRARY_USE_LIB32_PATHS
and FIND_LIBRARY_USE_LIB64_PATHS
, but this is no good, there are no lib32 and lib64 directories , only lib. It may be possible to combine them manually, but I'm not sure that I will do everything right. Outside x86/x64 directoriesI found one small difference =) (see screenshot). It may be possible to add both paths there, but again, I'm not sure if this will work out (maybe after that it will take the first one it comes across, and not the right one). In short, how would you do it?
Answer the question
In order to leave comments, you need to log in
So here's how it works:
if (${CMAKE_SIZEOF_VOID_P} STREQUAL 4)
message("It's 32 bit build")
elseif (${CMAKE_SIZEOF_VOID_P} STREQUAL 8)
message("It's 64 bit build")
endif ()
I collected x86 and x64, moreover, it did not work in one directory.
I need to somehow select the directory to search for OpenCVConfig.cmake via find_package(), i.e. add it to CMAKE_PREFIX_PATH apparently.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question