Scott P
Scott P

Reputation: 1

cmake not generating Xerces_autoconf_config.hpp header for Xerces 3.2.5 build on windows

I am attempting the build the Xerces 3.2.5 library from source for windows per these instructions..

My compiler is Visual Studio 2019. The version is mandated by the application for which I am ultimately developing code for as Its APIs are only certified for that version of VS.

The cmake --build step fails because multiple files cannot find the Xerces_autoconf_config.hpp. That file is indeed missing although there is both a Xerces_autoconf_config.hpp.cmake.in and a Xerces_autoconf_config.hpp.in which I presume are used by ~something~ in the build chain to generate the missing header.

The failing source files indicate as much,

//  If the next line generates an error then you haven't run ./configure
#include    <xercesc/util/Xerces_autoconf_config.hpp>

however configure is a shell script that doesn't run under windows.

STEPS TAKEN:

  1. Downloaded the xerces-c-3.2.5.zip and expanded it into a folder.
  2. opened a VS 2019 command prompt and cd'd to that directory
  3. mkdir build / cd build
    • per the Windows examples in the build instructions (link above).
  4. cmake -Wno-dev -DPROJECT_VERSION=3.2.5 -DCMAKE_INSTALL_PREFIX=G:\libs ..\src
    • I had to add the -DPROJECT_VERSION=3.2.5 to the example command otherwise I got errors because the write_basic_package_version_file() command in CMakeLists.txt was missing the version. It is purely a SWAG that 3.2.5 was in fact the correct value to pass.
  5. cmake --build . --config Debug
    • This is the failing command.

Typical error message:

C:\Dev\xerces-c-3.2.5\src\xercesc/util/XercesDefs.hpp(46,10): fatal error C1083: Cannot open include file: 'xercesc/util/Xerces_autoconf_config.hpp': No such file or directory

I assume there is something I have to do to have cmake generate the missing header file but I do not know what that is.

Upvotes: 0

Views: 159

Answers (1)

BlowIn
BlowIn

Reputation: 1

Those headers are generated in the build tree, not the source tree.

Check the location where the generated project files were placed.

You may have to copy them into the same location as the other (non-generated) headers.

Upvotes: 0

Related Questions