[gdal-dev] Generated CMake build files missing external references

Joaquim Manuel Freire Luís jluis at ualg.pt
Thu Mar 16 13:02:40 PDT 2023


Hi, I also build GDAL like that and noticed that you have an error in XercesC_INCLUDE_DIR. This is what I have. Notice that it ends with “/include”

When you solve them please report if you were able to build with PDFIUM. I wasn’t, lots of C++ incomprehensible errors.

Joaquim


               set(XercesC_INCLUDE_DIR "C:/programs/compa_libs/xerces-c-3.1.1/compileds/VC14_64/include" CACHE STRING "" FORCE)
               set(XercesC_LIBRARY "C:/programs/compa_libs/xerces-c-3.1.1/compileds/VC14_64/lib/xerces-c_3.lib" CACHE STRING "" FORCE)

From: gdal-dev <gdal-dev-bounces at lists.osgeo.org> On Behalf Of Derek Newhall
Sent: Thursday, March 16, 2023 7:51 PM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Generated CMake build files missing external references

Não costuma receber e-mails de dnewhall at carlsonsw.com<mailto:dnewhall at carlsonsw.com>. Saiba por que motivo isto é importante<https://aka.ms/LearnAboutSenderIdentification>
Hello,

We are trying to migrate from GDAL 3.5.1 to 3.6.3. We currently build a custom gdal*.dll file using a modified nmake.opt file and are trying to duplicate it as a ConfigUser.cmake file. We are building GDAL with ECW 5.5, curl, sqlite3, pdfium, OpenSSL, and Expat.

With 3.6.3 I can get the build files to generate seemingly correctly with our ConfigUser.cmake file and 'cmake -G "Visual Studio 16 2019" .. -C ..\ConfigUser.cmake' but the build fails once 'cmake --build .' is run.

The output of the configure step confirms everything's found, listing the following at the end:

"-- The following OPTIONAL package have been found:" ODBC, XercesC, OpenSSL, ECW, PDFIUM
"-- The following RECOMMENDED packages have been found:" CURL, EXPAT, SQLite3
"-- The following REQUIRED packages have been found:" PROJ

However, once the build happens, a few projects have compilation errors relating to external header files (specifically Xerces):

D:\gdal-3.6.3\ogr\ogr_xerces_headers.h(37,10): fatal error C1083: Cannot open include file: 'xercesc/framework/MemoryManager.hpp': No such file or directory [D:\gdal-3.6.3\build\gcore\gcore.vcxproj]

We are able to fix these references manually in Visual Studio by adding the external include directories to Xerces for the following projects: gcore, ogr, ogr_GMLAS, ogr_GML, ogr_NAS, ogr_ILI

That gets it to compile at least, but then we run into some similar linking issues.

We're new to building the 3.6.x branch, so I'm presuming we've misconfigured something somewhere, but I am not sure what it is in this case.

Thank you,

Derek Newhall


The following is the contents of our ConfigUser.cmake file:

set(GDAL_BUILD_ABS_PATH "D:/gdal-3.6.3")
set(GLOBAL_LIBRARIES_ABS_PATH "D:/global_libraries")
set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
set(PROJ_INCLUDE_DIR "${GDAL_BUILD_ABS_PATH}/proj-6.3.1/src" CACHE STRING "" FORCE)
set(PROJ_LIBRARY_RELEASE "${GDAL_BUILD_ABS_PATH}/proj-6.3.1/build_VS2017_x64/lib/RelWithDebInfo/proj.lib" CACHE STRING "" FORCE)
set(ECW_ROOT "${GDAL_BUILD_ABS_PATH}/ERDAS ECW JPEG 2000 SDK 5.5.0/Desktop Read-Only")
set(ECW_INCLUDE_DIR "${ECW_ROOT}/include" CACHE STRING "" FORCE)
set(ECW_LIBRARY "${ECW_ROOT}/lib/vc141/x64/NCSEcwS.lib" CACHE STRING "" FORCE)
set(XERCES_DIR "${GLOBAL_LIBRARIES_ABS_PATH}/xerces-c-3.2.1/build/2017/" CACHE STRING "" FORCE)
set(XercesC_INCLUDE_DIR "${XERCES_DIR}/src/" CACHE STRING "" FORCE)
set(XercesC_LIBRARY "${XERCES_DIR}/src/Release/xerces-c_3.lib" CACHE STRING "" FORCE)
set(SQLite3_INCLUDE_DIR "${GDAL_BUILD_ABS_PATH}/sqlite-amalgamation-3370200" CACHE STRING "" FORCE)
set(SQLite3_LIBRARY "${GDAL_BUILD_ABS_PATH}/sqlite-amalgamation-3370200/sqlite3.lib" CACHE STRING "" FORCE)
set(CURL_DIR "${GDAL_BUILD_ABS_PATH}/libcurl" CACHE STRING "" FORCE)
set(CURL_INCLUDE_DIR "${CURL_DIR}/include" CACHE STRING "" FORCE)
set(CURL_LIBRARY_RELEASE "${CURL_DIR}/lib/libcurl.lib" CACHE STRING "" FORCE)
set(PDFIUM_INCLUDE_DIR "${GDAL_BUILD_ABS_PATH}/ExtractPDFium/install/include/pdfium" CACHE STRING "" FORCE)
set(PDFIUM_LIBRARY "${GDAL_BUILD_ABS_PATH}/ExtractPDFium/install/lib/pdfium.lib" CACHE STRING "" FORCE)
set(GDAL_ENABLE_DRIVER_PDF_PLUGIN ON)
set(OPENSSL_ROOT_DIR "${GLOBAL_LIBRARIES_ABS_PATH}/openssl-1.1.0f-vs2017" CACHE STRING "" FORCE)
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include64" CACHE STRING "" FORCE)
set(OPENSSL_USE_STATIC_LIBS TRUE CACHE STRING "" FORCE)
set(OPENSSL_MSVC_STATIC_RT TRUE CACHE STRING "" FORCE)
set(EXPAT_DIR "${GDAL_BUILD_ABS_PATH}/Expat/" CACHE STRING "" FORCE)
set(EXPAT_INCLUDE_DIR "${GDAL_BUILD_ABS_PATH}/Expat/Source/lib" CACHE STRING "" FORCE)
set(EXPAT_LIBRARY "${GDAL_BUILD_ABS_PATH}/Expat/Bin/libexpatwMT.lib" CACHE STRING "" FORCE)


Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230316/8e2c60b1/attachment-0001.htm>


More information about the gdal-dev mailing list