Skip to content

[feature] Normalizing path in generators #17933

Closed
@KUGA2

Description

@KUGA2

What is your suggestion?

Hi!

we export generator and package dirs (with deployer). The generator dir (find_package() *_data.cmake files ) contains very long paths:

e.G.:

set(grpc_PACKAGE_FOLDER_RELWITHDEBINFO "${CMAKE_CURRENT_LIST_DIR}/../../../Build/armv8-lin-gcc-RelWi-conan/conan_installed/host/grpc/1.54.3/armv8")

This causes problems in our Windows build. Windows has the ancient limitation of 260 characters in path name. This problem can be mitigated by registry (if your IT department plays ball) or by using a shorter base path. Sometimes both is not possible.
(As you can see, we already abbreviated RelWithDebInfo to fight for every byte here :( )

Could conan change the path so this error is less likely to happen?

a) Generate a shorter path here
In our case, this could be shortended to:

set(grpc_PACKAGE_FOLDER_RELWITHDEBINFO "${CMAKE_CURRENT_LIST_DIR}/../conan_installed/host/grpc/1.54.3/armv8")

b) Set it as before, but NORMALIZE it afterwards, before passing it to tools

cmake_path(SET grpc_PACKAGE_FOLDER_RELWITHDEBINFO NORMALIZE "${grpc_PACKAGE_FOLDER_RELWITHDEBINFO}")

(This is CMake 3.20, and I am not sure weather this is allowed here)

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions