In order to automatically edit CMakeLists.txt files in response to the changes made via Visual Studio GUI, VisualGDB requires CMake with Sysprogs Extensions or CMake 3.10 (not 3.10.1 or later).
The Sysprogs Extensions allow CMake to report detailed information about the location of each target, so VisualGDB can edit it.
The Sysprogs Extensions were merged into CMake 3.10, however removed from 3.10.1 as several other IDEs are unable to handle large data objects containing detailed target information. We are working with Kitware on merging an optimized version of the extensions into CMake and will provide an update here once it is merged. As a workaround, please use our CMake fork as described below.
If you are building your projects on Windows, VisualGDB will automatically install and use the advanced CMake build. If you are building your code on Linux, follow the steps below to download the modified source code and build it:
- Ensure the git client is installed on your Linux machine. You can normally install it via “sudo apt-get install git” or “yum install git”.
- Run the following commands:
123456git clone https://github.com/sysprogs/CMake.gitcd CMakemkdir build && cd build../configuremakesudo make install
- If CMake build fails due to unsupported make_unique<>, try updating your gcc to version 4.9 or later, or simply modify cmServer.cxx as shown below:
12-debug = std::make_unique<DebugInfo>();+debug.reset(new DebugInfo);
then modify cmServerProtocol.cxx:
12-this->m_CMakeInstance = std::make_unique<cmake>();+this->m_CMakeInstance.reset(new cmake);
- f CMake complains about missing dependencies, install them using apt-get or yum. On Debian-based systems you can run “sudo apt-get build-dep cmake” to get the packages neceesary to build CMake.
- Once the new CMake is installed, ensure it is executed when you run the ‘cmake’ command (you can check this by running ‘which cmake’). Alternatively you can specify the location of the new CMake binary via VisualGDB Project Properties.
If you are building the code on Windows, VisualGDB will automatically download the pre-built version of our CMake fork. If you don’t have direct Internet connection on that computer, please download it here and specify its location via Tools->Options->VisualGDB->Common->Tools->Full Path to CMake.exe.