Sysprogs forums › Forums › VisualGDB › Working directory vs Binary directory
- This topic has 3 replies, 2 voices, and was last updated 5 years, 8 months ago by support.
-
AuthorPosts
-
April 25, 2019 at 11:10 #24774dmottParticipant
Please clarify the purpose and relationship of these settings on the ‘CMake project settings’ tab. There is typically a single ‘working directory’ AKA ‘binary directory’ AKA ‘output directory’ where CMake will deposit generated and compiled files. These two settings seem to share a similar purpose but its unclear. If set incorrectly the entire source tree is wiped out during a clean operation. This should never happen.
April 25, 2019 at 19:24 #24787supportKeymasterHi,
No problem, please find the detailed explanation of the related settings below:
- Working directory is the directory where VisualGDB will physically launch cmake.exe. It defaults to the remote source directory and does not have effect when using cmake in the server mode (i.e. with the Advanced CMake Project Subsystem).
- Binary directory is the relative path to the directory where CMake will create the binaries.
- CMakeLists.txt subdirectory is the relative path to the directory where CMake will search for the top-level CMakeLists.txt.
- This setting controls how VisualGDB will clean the projects. The default setting is to delete the entire binary directory (if you are using direct SSH access and the build directory is the same as the source directory, the latest VisualGDB 5.4R5 will skip the deletion and will suggest changing this setting). For the setup you described, we would advise using the “build the ‘clean’ target” option.
The CMake command line equivalent to the VisualGDB settings mentioned above would be:
cd <working directory> && cmake <CMakeLists.txt subdirectory> -B<binary directory>
We have also double-checked the latest v5.4R5 build and it looks like the “clean mode” setting may not always be shown correctly. We have fixed it in this build: VisualGDB-5.4.105.3138.msi
Attachments:
You must be logged in to view attached files.April 25, 2019 at 21:49 #24790dmottParticipantThanks for the clarification.
Working directory…does not have effect…with the Advanced CMake Project Subsystem.
Suggestion to disable it in this mode to avoid confusion.
Also WRT the clean option, thanks for the clarification.
Suggestion to default to a ‘smart’ clean option.
if (${CMAKE_BINARY_DIR} EQUALS ${CMAKE_HOME_DIRECTORY})
cmake –build . –target clean
else()
rm -rf *
endif()
- This reply was modified 5 years, 8 months ago by dmott.
April 26, 2019 at 03:42 #24794supportKeymasterThanks, we will consider hiding the unused option in one of the next VisualGDB releases (due to the way VisualGDB GUI is structured, it would require a non-trivial change and might have side effects).
The smart clean idea looks good, however we won’t be able to make it default as having the build directory the same as the source directory is a very rare setup and supporting it without changing one extra setting manually does not outweigh the risks of breaking backward compatibility for other users that expect the current behavior to be the default one.
-
AuthorPosts
- You must be logged in to reply to this topic.