Sysprogs forums › Forums › VisualGDB › Bug Submission – Possible Feature Improvement.
- This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by support.
-
AuthorPosts
-
August 3, 2015 at 18:25 #6782dmitryponvParticipant
Good afternoon,
This is a submission of what is possibly a bug for VisualGDB
This is for importing projects created with CMake.
The issue is when CMakeLists.txt is in one directory but the Build directory is not within the same directory as CMakeLists.txt
For example, setting the MainSourceDirectoryForLocalBuilds source containing CMakeLists.txt to:
<MainSourceDirectoryForLocalBuilds>D:\svn\Project\source</MainSourceDirectoryForLocalBuilds>
And BinaryDirectory vs_arm_debug (adjacent to, but not within the source directory)
<BinaryDirectory>../vs_arm_debug</BinaryDirectory>
Causes an error running the CMake command:
VisualGDB: Run "C:\Program Files (x86)\CMake\bin\cmake.exe -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_COLOR_MAKEFILE=OFF .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=toolchain-Debug.cmake -DCMAKE_MAKE_PROGRAM="C:/SysGCC/raspberry/bin/make.exe"" in directory "D:\svn\Project\source/../vs_arm_debug/" on local computer 1>EXEC : CMake error : The source directory "D:/svn/Project" does not appear to contain CMakeLists.txt.
The Problem is, VisualGDB is running CMake from the Build Directory,
What the command really should be is:
Run "C:\Program Files (x86)\CMake\bin\cmake.exe -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_COLOR_MAKEFILE=OFF .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=toolchain-Debug.cmake -DCMAKE_MAKE_PROGRAM="C:/SysGCC/raspberry/bin/make.exe" ../source"
The ../source added at the end will cause CMake to switch back to the source directory with CMakeLists.txt while creating the MakeFile in the vs_arm_debug directory.
Of course, the real name of the directory should be parsed from User’s input.
Please comment if there is a workaround for running a custom cmake command
Thank you,
- This topic was modified 9 years, 4 months ago by dmitryponv.
- This topic was modified 9 years, 4 months ago by dmitryponv.
August 3, 2015 at 18:49 #6786dmitryponvParticipantTo Add to this Feature Request/Bug
The CMake command is mostly hard-coded, and when adding Arguments, they are added to the beginning of the command, not the end, so adding ../source/ makes it
Run "C:\Program Files (x86)\CMake\bin\cmake.exe ../source -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_COLOR_MAKEFILE=OFF .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=toolchain-Debug.cmake -DCMAKE_MAKE_PROGRAM="C:/SysGCC/raspberry/bin/make.exe""
Which is evidently pretty useless, because it tries to run everything from the source folder. Instead
Another problem is the flags are hard-coded and impossible to change.
For example: the -DCMAKE_TOOLCHAIN_FILE=toolchain-Debug.cmake flag remains the same in the command line, even when I remove toolchain-Debug.cmake from CMake Files in the Solution Explorer and add my armtoolchain-vs.cmake
It would be good to be able to edit the CMake.exe command line entirely
Thank you,
August 3, 2015 at 19:48 #6787dmitryponvParticipantOk I figured out a way around this if anybody is havingthe same problem:
Simply, create a cmake.bat file next to cmake.exe in C:\Program Files (x86)\CMake\bin
Into it, enter (this is from the above example)
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE="../armtoolchain-vs.cmake" -DCMAKE_MAKE_PROGRAM="C:/SysGCC/raspberry/bin/make.exe" ../source echo
Then in VisualGDB properties enter “C:\Program Files (x86)\CMake\bin\cmake.bat” for Command Line instead of cmake.txt
This will cause the hard-coded arguments to be appended to the echo command instead of the cmake.exe command
However, entering echo into the arguments list does not work the same way,
I am looking for something line a ENTER or CR to force a carriage return before the echo command directly in the Arguments list, to make this a bit easier to set up.
Thank you,
- This reply was modified 9 years, 4 months ago by dmitryponv.
- This reply was modified 9 years, 4 months ago by dmitryponv.
August 6, 2015 at 04:48 #6804supportKeymasterHi,
Thanks for reporting this, we have fixed the problem with the relative paths in VisualGDB 5.0R2. You can download it here: http://visualgdb.com/download/
We have also added an option (currently unsupported via GUI) to disable the use of toolchain files. Please change any setting in VisualGDB Project Propreties, save the settings, open the .vgdbsettings file in a text editor and modify the DisableToolchainFile field.
-
AuthorPosts
- You must be logged in to reply to this topic.