Working directory vs Binary directory

Sysprogs forums Forums VisualGDB Working directory vs Binary directory

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24774
    dmott
    Participant

    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.

    #24787
    support
    Keymaster

    Hi,

    No problem, please find the detailed explanation of the related settings below:

    1. 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).
    2. Binary directory is the relative path to the directory where CMake will create the binaries.
    3. CMakeLists.txt subdirectory is the relative path to the directory where CMake will search for the top-level CMakeLists.txt.
    4. 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.
    #24790
    dmott
    Participant

    Thanks 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.
    #24794
    support
    Keymaster

    Thanks, 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.