-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake on Windows: Unescaped backslashes #628
Comments
The set of CCFLAGS makes also trouble.
|
Hm, Windows support is difficult to get right… There is a new CMake generator, see #568. Perhaps it solves some of these issues. |
It only generates other issues. |
For me VSCode works great (with the C++/Intellisense plugin) using SCons (or even without a build system) if I open the project folder (with the |
I'm sorry for your troubles, I also dislike CMake a lot… Perhaps you can try to import this project, which I've just tested to work on VSCode with CMake (but on macOS): |
#568 was already merged into I use following setitngs:
CMake wasn't able to find python3 Than again unescaped backslashes in Building and linking works. After that a "open file with" dialog opens up and and after selecting a program, the cmd says failed. I think the call of size.py isn't correct. I will investigate further and will report and/or create a PR. Anonymous log:
Edit: Missed the size parameter. |
Probably both because "CMake wasn't able to find python3". |
Maybe we should use |
There's an extra |
I assume that too. Python 3 is installed automatically after the first call with Windows store. (I don't know who and why somebody at MS think that that is a good idea) |
Replacing all occurrences of I think CMake itself is the problem now. |
|
Could Windows perhaps not install
|
I's a bad idea. After install Python without the windows store app function and cleaning the path:
On a fresh python installation pyelftools is needed but not mention (only for old ubuntu versions) |
That didn't set
|
The 'windows store python' did both. The 'real python' only python. To sum this evening:
|
👍🏽
pyelftools are a dependency of the modm pip package that is installed in the getting started guide. |
I've looked a bit deeper into the Windows Store Python issues. The Windows Store Python does something very odd. Rather than adding the python install folder to the PATH, CMake's So I suppose that part is an upstream bug of either CMake or Windows rather than a modm bug. [0]: See https://github.com/Kitware/CMake/blob/master/Source/kwsys/SystemTools.cxx#L1336 |
Originally it was tested on windows and I can remember it was necessary to downgrade cmake to make it work. If build-in python libraries are use in lbuild to generate path names backslashes can also be a problem on Windows. |
I have fund the following issues:
Tested with following version: This ain't pretty but it works. The following code can be placed in the main CMakeLists.txt and it will replace the backslashes automatically. function (convert_backslash_path FILE_NAME)
file(READ ${FILE_NAME} SRC)
file(TO_CMAKE_PATH ${SRC} DST)
file(WRITE ${FILE_NAME} ${DST})
endfunction()
convert_backslash_path("modm/CMakeLists.txt")
convert_backslash_path("modm/cmake/ModmConfiguration.cmake") |
I have been playing with modm on windows recently and also ran into this issue. I use CMake a lot across different platforms and IMO one should always use As far as the weird windows store python, one of the first things I do when I have a fresh windows install is remove all those executables and remove that path from my PATH. Then I install the "real" python from python.org. Again, it's a sanity thing. The changes I made to address things, taking into consideration the above two things, you can see in my modm fork here: CrustyAuklet@bf542fb I kept changes to the python restricted to cmake generation code, and in the CMake I check for |
Feel free to change the CMake generator and path issues as you see fit! My only experience with Windows is inside a VM and only briefly, so these issues are really not intentional. (Unfortunately changing lbuild to use pathlib exclusively breaks backwards compatibility since |
This issue can be closed. pathes are generated with |
Hi,
I am using Windows and CMake and just start using modm. If I like modm I will start a PR to fix this issue by myself but for now I just reporting.
The generated repo.cmake contains unescaped backslashes.
${CMAKE_CURRENT_LIST_DIR}/src\modm\architecture\driver\atomic\flag.cpp
CMake on Windows accept slashes or escaped backslashes. I don't know the common preferences but i preferer normal slashes.
The text was updated successfully, but these errors were encountered: