find_package() stops working when CMAKE_SYSTEM_NAME=iOS
Hi,
My problem concerns find_package()
in the “Config” mode.
I created a PDFiumConfig.cmake
and set the environment variable PDFium_DIR
to the correct directory.
find_package()
works fine for all platforms except for iOS.
It seems that, as soon as CMAKE_SYSTEM_NAME
is defined, find_package()
ignores the PDFium_DIR
environment variable.
Curiously, when I run with --debug-find
, I can see that the environment variable is considered:
Env variable PDFium_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].
/Users/runner/work/pdfium-binaries/pdfium-binaries/staging
Still, it misses the PDFiumConfig.cmake
in this directory.
Of course, I listed the directory to ensure that PDFiumConfig.cmake
is present; moreover, I use the same setup for the eleven other platforms, and they work.
I think I tried every possible combination of CMAKE_IOS_INSTALL_COMBINED
, CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH
, CMAKE_FIND_APPBUNDLE
, and CMAKE_FIND_FRAMEWORK
. I also searched the documentation thoroughly and even looked at CMake’s source code, but I couldn’t understand why it didn’t work.
You can find more information about this problem there:
Any help would be greatly appreciated!
Best regards,
Benoit
PS: I submitted this question to the CMake Forum two weeks ago but got no answer.