Vcpkg: Xerces-C can't be found by CMake anymore

Created on 26 Mar 2019  路  7Comments  路  Source: microsoft/vcpkg

I have used Xerces-C 3.2.2-6 which worked without hassle.

I did a git pull today (using 3.2.2-7) and rebuilt all my libraries.

However, CMake doesn't find Xerces-C anymore:

CMake Error at D:/vcpkg/installed/x86-windows/share/xercesc/XercesCConfigInternal.cmake:80 (message):
The imported target "xerces_xerces-c" references the file

 "D:/vcpkg/debug/lib/xerces-c_3D.lib"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

 "D:/vcpkg/installed/x86-windows/share/xercesc/XercesCConfigInternal.cmake"

 but not all the files it references.

 Call Stack (most recent call first):
 D:/vcpkg/installed/x86-windows/share/xercesc/XercesCConfig.cmake:27 (include)
 D:/vcpkg/scripts/buildsystems/vcpkg.cmake:233 (_find_package)
 CMakeLists.txt:26 (find_package)

Configuring incomplete, errors occurred!

The given path D:/vcpkg/debug/lib/xerces-c_3D.lib doesn't exist anyway.

port-bug

All 7 comments

I had a similar issue on Linux and have a work-around. In the file: installed/x64-linux/share/xercesc/XercesCConfigInternal.cmake:

Lines 46-49 has 4 calls to get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) for parent traversal. Commenting out two of those 4 got it working.

that is strange theoretically vcpkg_fixup_cmake_targets should take care of it.

In addition to that the portfile includes the following lines:

file(READ ${CURRENT_PACKAGES_DIR}/share/xercesc/XercesCConfigInternal.cmake _contents)
string(REPLACE
    "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
    "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
    _contents
    "${_contents}"
)
file(WRITE ${CURRENT_PACKAGES_DIR}/share/xercesc/XercesCConfigInternal.cmake "${_contents}")

Lines 46-49 has 4 calls to get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) for parent traversal. Commenting out two of those 4 got it working.

@JoshBramlett your workaround worked for me as well under Windows 10.

I still don't know what caused this issue when upgrading from 3.2.2-6 to -7

@s-martin, thank you for posting the issue, the latest version is 3.2.2-8, does the issue still occur?

@wangli28 thanks, I will check tonight.

@wangli28 still doesn't work, have to use the workaround from above.

Thanks for posting this issue. This issue has been fixed. So I am closing this issue for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasjuang picture jasjuang  路  3Comments

ghost picture ghost  路  3Comments

oahzuw picture oahzuw  路  3Comments

jack17529 picture jack17529  路  3Comments

PhilLab picture PhilLab  路  3Comments