conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
966 stars 1.77k forks source link

[bug] Unable to build pdal with MSVC - gdal include dirs #11145

Open Thiesius opened 2 years ago

Thiesius commented 2 years ago

The build fails when building the pdal itself with error

CMake Error at source_subfolder/cmake/gdal.cmake:5 (file):
  file failed to open for reading (Permission denied):

    C:/Users/capek/.conan/data/gdal/3.4.1/_/_/package/17cfa3f66e842a3b35874be1c21919ce47e9669e/include

Failing line in gdal.cmake file(READ ${GDAL_INCLUDE_DIR}/gdal_version.h versionfile)

In FindGDAL.cmake (generated from conan) you can find:

set(GDAL_INCLUDE_DIRS "C:/Users/capek/.conan/data/gdal/3.4.1/_/_/package/17cfa3f66e842a3b35874be1c21919ce47e9669e/include"
            "C:/Users/capek/.conan/data/gdal/3.4.1/_/_/package/17cfa3f66e842a3b35874be1c21919ce47e9669e/include/gdal")
set(GDAL_INCLUDE_DIR "C:/Users/capek/.conan/data/gdal/3.4.1/_/_/package/17cfa3f66e842a3b35874be1c21919ce47e9669e/include;C:/Users/capek/.conan/data/gdal/3.4.1/_/_/package/17cfa3f66e842a3b35874be1c21919ce47e9669e/include/gdal")

When I modified GDAL_INCLUDE_DIR to point to C:/Users/capek/.conan/data/gdal/3.4.1/_/_/package/17cfa3f66e842a3b35874be1c21919ce47e9669e/include/gdal and then run the cmake manually it worked. That's however not useful as running cmake manually doesn't complete all mandatory steps.

Environment Details (include every applicable attribute)

I have cleared the whole data folder before running the command.

Steps to reproduce (Include if Applicable) from PowerShell

conan install pdal/2.3.0@ --build missing 2>&1 > log.txt

Logs (Executed commands with output) (Include/Attach if Applicable)

log.txt

memsharded commented 2 years ago

Hi @Thiesius

I am not sure I see what is the problem. The GDAL_INCLUDE_DIR already contains the right path to the include directories containing the header files. If the root include folder doesn't contain the header files, then it could be a gdal recipe issue, and that folder should be removed from self.cpp_info.includedirs. But that is in the recipe, not something in the Conan client. Is this the ConanCenter recipe? In that case this issue can be moved to the conan-center-index repo.

If includedirs are multiple directories, then the file(READ ${GDAL_INCLUDE_DIR}/gdal_version.h versionfile) should be fixed to iterate over multiple directories, shouldn't it?

Thiesius commented 2 years ago

Hey, I'm sorry for posting the issue into wrong repository, it makes perfect sense that it would belong to conan-center-index as I also think the problem is not within the client.

Also yes, I think either pdal needs to iterate over include dirs file(READ ${GDAL_INCLUDE_DIR}/gdal_version.h versionfile) or the gdal package needs to set up self.cpp_info.includedirs correctly. However since the singular form fo GDAL_INCLUDE_DIR I would assume that the variable shouldn't be iterable.

Edit: Can you transfer the issue or do I have to close it here and recreate in the correct repo?

memsharded commented 2 years ago

I will transfer the issue, thanks!

SpaceIm commented 2 years ago

side effect of https://github.com/conan-io/conan-center-index/pull/10591