-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
Bug in CLion for CMakeListsPrivate.txt generation when using lib_extra_dirs in Windows #4071
Comments
Hi @john-contact , thanks for reporting! It should be fixed in the development branch. It would be great if you could retest the latest PlatformIO core with your project. Just run |
Hey @valeros , thanks for picking this one up! I think this about 99% of the way there. I now get:
If I take a look at the generated
Which given the output I see implies that
If I move that Basically, from looking at the associated commit
Thanks again for the help with this, and let me know if you need anything from my end! |
Thanks for the quick response, my fault. Please pull the latest changes via |
@valeros Awesome, that fixed it. Thanks again! |
Configuration
Operating system:
Windows 10
PlatformIO Version (
platformio --version
):PlatformIO Core, version 5.2.0
Description of problem
Hey everyone, hopefully you can help me resolve this or at least I can bring this to your attention.
It seems that if I use an absolute path in
lib_extra_dirs
, it attempts to be smart in its generation of CMakeListsPrivate.txt by replacing the drive and user directory with$ENV{HOMEDRIVE}$ENV{HOMEPATH}
, which then evaluates to include backslashes and breaks cmake. This occurs even if you explicitly use forward slashes in the absolute path.Steps to Reproduce
lib_extra_dirs
to be an absolute path beginning with the drive and home directory (e.g.C:/Users/john_contactci/...
Actual Results
Due to the backslash in the path.
Expected Results
Include the path listed in
lib_extra_dirs
as-is and without replacing it with vars for the drive and homepath. Or, if you're going to replace parts of the path then ensure that the backslashes are replaced or escaped.If problems with PlatformIO Build System:
In platform.ini:
Additional info
I'm on Windows 10 using the CLion PlatformIO plugin (version 212.5080.54). My toolchain is configured to use the bundled CMake in CLion, version 3.20.2.
The libraries I'm attempting to link against and include are custom libraries stored locally at the path listed in
lib_extra_dirs
. The headers are stored under the subdirectoryinclude
and the DLL is stored under the subdirectorylib
.In platform.ini:
In the resulting generated CMakeListsPrivate.txt:
Later on
EXTRA_LIB_SOURCES
is appended toSRC_LIST
:And this results in the following error from CMakeLists.txt:
Due to the backslash in the path.
For reference, line 33 of CMakeLists.txt:
Which is why I mention the bit about
EXTRA_LIB_SOURCES
being appended toSRC_LIST
above.Things I have tried to no avail:
PLATFORMIO_LIB_EXTRA_DIRS
env var, which results in the same problem.\\
) in the absolute path.Any assistance or work around would be greatly appreciated!
Thanks!
The text was updated successfully, but these errors were encountered: