godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Normalize CMake paths

Open BaconOFBurger opened this issue 3 years ago • 3 comments

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.

BaconOFBurger avatar Apr 21 '21 18:04 BaconOFBurger

Could you try this PR https://github.com/godotengine/godot-cpp/pull/536 we are waiting to be merged?

o01eg avatar Apr 21 '21 18:04 o01eg

Could you try this PR #536 we are waiting to be merged?

Oh my bad didn't notice this PR, well either ways it works so I guess I'm closing this issue

BaconOFBurger avatar Apr 21 '21 18:04 BaconOFBurger

Reopening, as the pull request still needs to be merged to fix this.

Calinou avatar Apr 21 '21 18:04 Calinou