Skip to content

Normalize CMake paths #546

@BaconOFBurger

Description

@BaconOFBurger

Hi so today I tried generating C++ bindings for godot with CMake and I've stumbled on an issue around there.

Basically add_library would fail on windows because paths seems to not be normalized, I managed to fix the issue by adding these lines of code before the add_library call

string(REPLACE "\\" "/" PROJECT_NAME      "${PROJECT_NAME}")
string(REPLACE "\\" "/" SOURCES           "${SOURCES}")
string(REPLACE "\\" "/" SOURCES_FILE_LIST "${SOURCES_FILE_LIST}")
string(REPLACE "\\" "/" HEADERS           "${HEADERS}")
string(REPLACE "\\" "/" HEADERS_FILE_LIST "${HEADERS_FILE_LIST}")

I'm not very familiar with github so I'm unsure how to request a change so ill just post the fix there and let someone do it for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions