Building and debugging cmake app

Sysprogs forums Forums VisualGDB Building and debugging cmake app

This topic contains 5 replies, has 4 voices, and was last updated by  support 10 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #544

    kbzowski
    Participant

    Hi, what is the correct solution to import existing cmake based application and work with it?
    Right now I am importing source, and after that run cmake to create MakeFile. Is it correct? Will I need import project again when I will modify CMakeLists.txt (by adding new files)?
    Using that method I cannot run out-of-source build (MakeFile is located in different directory than source files).
    I am working in environment without any directories shared between Linux and Windows platforms.

    #2321

    ket
    Participant

    Do not copy the source files to a new location from the Makefile location, the source tree shown in Visual Studio projects is only for the convenience of sorting and opening the files and does not refer to the physical location. Adding new files to the project only adds the files automatically to the Makefile if you are using the VisualGDB generated Makefile. You do not need to import the project again if you add files to CMakeLists.txt, importing is just meant for the convenience of importing the entire source at the beginning of a project. Putting it all together, import the source and Makefile, CMakeLists.txt when making the project, make sure the project builds, when adding files later on, make sure you also add them in the Makefile.

    Better handling of CMake projects is currently being considered as a feature for the next VisualGDB version. If you have any feature suggestions, let us know.

    #2322

    Anonymous
    Participant

    In current version CMake-based build runs as expected, but out-of-source cmake builds lead to VisualGDB “warning VGDB001: Inconsistent depth reported by GNU Make”. It would be great if VisualGDB will suppress such warnings if case of CMake projects.

    #2323

    support
    Keymaster

    Could you paste a typical build log showing the problem here? Looks like cmake uses a different format for “entering directory”/”leaving directory” messages and this confuses VisualGDB.

    #2324

    Anonymous
    Participant

    Sorry for the late reply. I’ve just checked this topic again.
    I’ve root-caused the warning source. It have nothing to do with cmake, but rather make option -j8, which parallels build (and speedup it appropriately 🙂 ) causes warning. Seems in current version VisualGDB expects single-thread build process.

    #2325

    support
    Keymaster

    Hi,

    Yes, VisualGDB expects the single-threaded output as it’s the only way to detect the full path of files (so that Visual Studio can show them) when GCC reports the relative path. If this is not a problem for you, you can safely ignore those warnings.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.