ソースを参照

fileapi: Report DEBUGGER_WORKING_DIRECTORY in codemodel-v2 target objects

Closes: #16478
Garrett Campbell 10 ヶ月 前
コミット
0a9fb88121
28 ファイル変更143 行追加82 行削除
  1. 17 1
      Help/manual/cmake-file-api.7.rst
  2. 6 0
      Help/release/dev/debugger-working-directory.rst
  3. 1 1
      Source/cmFileAPI.cxx
  4. 20 0
      Source/cmFileAPICodemodel.cxx
  5. 1 1
      Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
  6. 11 1
      Tests/RunCMake/FileAPI/codemodel-v2-check.py
  7. 6 6
      Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
  8. 13 13
      Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
  9. 4 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
  10. 3 3
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
  11. 5 5
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
  12. 3 3
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
  13. 2 2
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
  14. 1 1
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json
  15. 10 7
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
  16. 4 4
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json
  17. 6 6
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json
  18. 4 4
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json
  19. 2 2
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json
  20. 3 3
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
  21. 5 5
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
  22. 3 3
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
  23. 2 2
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json
  24. 3 3
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
  25. 3 3
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
  26. 2 2
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
  27. 1 0
      Tests/RunCMake/FileAPI/codemodel-v2.cmake
  28. 2 0
      Tests/RunCMake/FileAPI/cxx/CMakeLists.txt

+ 17 - 1
Help/manual/cmake-file-api.7.rst

@@ -435,7 +435,7 @@ Version 1 does not exist to avoid confusion with that from
 
   {
     "kind": "codemodel",
-    "version": { "major": 2, "minor": 7 },
+    "version": { "major": 2, "minor": 8 },
     "paths": {
       "source": "/path/to/top-level-source-dir",
       "build": "/path/to/top-level-build-dir"
@@ -1095,6 +1095,22 @@ with members:
     when link-time optimization (a.k.a. interprocedural optimization
     or link-time code generation) is enabled.
 
+``debugger``
+  Optional member that is present when the target has one of the
+  following fields set.
+  The value is a JSON object of entries corresponding to
+  debugger specific values set.
+
+  This field was added in codemodel version 2.8.
+
+  ``workingDirectory``
+    Optional member that is present when the DEBUGGER_WORKING_DIRECTORY
+    target property is set.
+    The member will also be present in Visual Studio Generator
+    scenarios when VS_DEBUGGER_WORKING_DIRECTORY is set.
+
+    This field was added in codemodel version 2.8.
+
 ``dependencies``
   Optional member that is present when the target depends on other targets.
   The value is a JSON array of entries corresponding to the dependencies.

+ 6 - 0
Help/release/dev/debugger-working-directory.rst

@@ -7,3 +7,9 @@ debugger-working-directory
 * The :prop_tgt:`DEBUGGER_WORKING_DIRECTORY` target property was added
   to tell generators what debugger working directory should be set for
   the target.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
+  been updated to 2.8.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
+  a new "debugger" field.

+ 1 - 1
Source/cmFileAPI.cxx

@@ -746,7 +746,7 @@ std::string cmFileAPI::NoSupportedVersion(
 // The "codemodel" object kind.
 
 // Update Help/manual/cmake-file-api.7.rst when updating this constant.
-static unsigned int const CodeModelV2Minor = 7;
+static unsigned int const CodeModelV2Minor = 8;
 
 void cmFileAPI::BuildClientRequestCodeModel(
   ClientRequest& r, std::vector<RequestVersion> const& versions)

+ 20 - 0
Source/cmFileAPICodemodel.cxx

@@ -508,6 +508,8 @@ class Target
   Json::Value DumpLauncher(const char* name, const char* type);
   Json::Value DumpLaunchers();
 
+  Json::Value DumpDebugger();
+
 public:
   Target(cmGeneratorTarget* gt, std::string const& config);
   Json::Value Dump();
@@ -1273,6 +1275,11 @@ Json::Value Target::Dump()
 
   target["backtraceGraph"] = this->Backtraces.Dump();
 
+  Json::Value debugger = this->DumpDebugger();
+  if (!debugger.isNull()) {
+    target["debugger"] = std::move(debugger);
+  }
+
   return target;
 }
 
@@ -2134,6 +2141,19 @@ Json::Value Target::DumpLaunchers()
 }
 }
 
+Json::Value Target::DumpDebugger()
+{
+  Json::Value debuggerInformation;
+  if (cmValue debuggerWorkingDirectory =
+        this->GT->GetGlobalGenerator()->GetDebuggerWorkingDirectory(
+          this->GT)) {
+    debuggerInformation = Json::objectValue;
+    debuggerInformation["workingDirectory"] = *debuggerWorkingDirectory;
+  }
+
+  return debuggerInformation;
+}
+
 Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI, unsigned long version)
 {
   Codemodel codemodel(fileAPI, version);

+ 1 - 1
Tests/RunCMake/CommandLine/E_capabilities-stdout.txt

@@ -1 +1 @@
-^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":7}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
+^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":8}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$

+ 11 - 1
Tests/RunCMake/FileAPI/codemodel-v2-check.py

@@ -12,7 +12,7 @@ def read_codemodel_json_data(filename):
 def check_objects(o, g):
     assert is_list(o)
     assert len(o) == 1
-    check_index_object(o[0], "codemodel", 2, 7, check_object_codemodel(g))
+    check_index_object(o[0], "codemodel", 2, 8, check_object_codemodel(g))
 
 def check_backtrace(t, b, backtrace):
     btg = t["backtraceGraph"]
@@ -429,6 +429,14 @@ def check_target(c):
                                 missing_exception=lambda e: "launchers: %s" % e,
                                 extra_exception=lambda a: "launchers: %s" % a)
 
+        if "debugger" in expected:
+            if expected["debugger"] is not None:
+                expected_keys.append("debugger")
+                assert is_dict(obj["debugger"])
+                debugger_keys = ["workingDirectory"]
+                assert sorted(obj["debugger"].keys()) == sorted(debugger_keys)
+                assert matches(obj["debugger"]["workingDirectory"], expected["debugger"]["workingDirectory"])
+
         if expected["link"] is not None:
             expected_keys.append("link")
             assert is_dict(obj["link"])
@@ -956,6 +964,8 @@ def gen_check_targets(c, g, inSource):
                 for d in e["dependencies"]:
                     if matches(d["id"], "^\\^ZERO_CHECK::@"):
                         d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$"
+            if e["name"] == "cxx_exe":
+                e["debugger"]["workingDirectory"] = "^/test/debugger/workingDirectoryVS$"
 
     elif g["name"] == "Xcode":
         if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):

+ 6 - 6
Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json

@@ -42,7 +42,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 38,
+                    "line": 40,
                     "command": "install",
                     "hasParent": true
                 },
@@ -76,7 +76,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 38,
+                    "line": 40,
                     "command": "install",
                     "hasParent": true
                 },
@@ -107,7 +107,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 38,
+                    "line": 40,
                     "command": "install",
                     "hasParent": true
                 },
@@ -138,7 +138,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 38,
+                    "line": 40,
                     "command": "install",
                     "hasParent": true
                 },
@@ -170,7 +170,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 43,
+                    "line": 45,
                     "command": "install",
                     "hasParent": true
                 },
@@ -202,7 +202,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 43,
+                    "line": 45,
                     "command": "install",
                     "hasParent": true
                 },

+ 13 - 13
Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json

@@ -51,7 +51,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 45,
+                    "line": 46,
                     "command": "install",
                     "hasParent": true
                 },
@@ -96,7 +96,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 48,
+                    "line": 49,
                     "command": "install",
                     "hasParent": true
                 },
@@ -144,7 +144,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 48,
+                    "line": 49,
                     "command": "install",
                     "hasParent": true
                 },
@@ -189,7 +189,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 48,
+                    "line": 49,
                     "command": "install",
                     "hasParent": true
                 },
@@ -233,7 +233,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 48,
+                    "line": 49,
                     "command": "install",
                     "hasParent": true
                 },
@@ -277,7 +277,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 53,
+                    "line": 54,
                     "command": "install",
                     "hasParent": true
                 },
@@ -324,7 +324,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 55,
+                    "line": 56,
                     "command": "install",
                     "hasParent": true
                 },
@@ -369,7 +369,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 56,
+                    "line": 57,
                     "command": "install",
                     "hasParent": true
                 },
@@ -418,7 +418,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 57,
+                    "line": 58,
                     "command": "install",
                     "hasParent": true
                 },
@@ -470,7 +470,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 58,
+                    "line": 59,
                     "command": "install",
                     "hasParent": true
                 },
@@ -519,7 +519,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 59,
+                    "line": 60,
                     "command": "install",
                     "hasParent": true
                 },
@@ -561,7 +561,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 60,
+                    "line": 61,
                     "command": "install",
                     "hasParent": true
                 },
@@ -603,7 +603,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 61,
+                    "line": 62,
                     "command": "install",
                     "hasParent": true
                 },

+ 4 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json

@@ -142,5 +142,8 @@
             "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
             "backtrace": null
         }
-    ]
+    ],
+    "debugger": {
+        "workingDirectory": "^/test/debugger/workingDirectory$"
+    }
 }

+ 3 - 3
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 12,
+                    "line": 13,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -64,7 +64,7 @@
     "backtrace": [
         {
             "file": "^codemodel-v2\\.cmake$",
-            "line": 12,
+            "line": 13,
             "command": "add_executable",
             "hasParent": true
         },
@@ -114,7 +114,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 13,
+                    "line": 14,
                     "command": "target_link_libraries",
                     "hasParent": true
                 },

+ 5 - 5
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 11,
+                    "line": 12,
                     "command": "add_library",
                     "hasParent": true
                 },
@@ -69,7 +69,7 @@
     "backtrace": [
         {
             "file": "^codemodel-v2\\.cmake$",
-            "line": 11,
+            "line": 12,
             "command": "add_library",
             "hasParent": true
         },
@@ -118,7 +118,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 48,
+                        "line": 49,
                         "command": "install",
                         "hasParent": true
                     },
@@ -148,7 +148,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 48,
+                        "line": 49,
                         "command": "install",
                         "hasParent": true
                     },
@@ -178,7 +178,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 53,
+                        "line": 54,
                         "command": "install",
                         "hasParent": true
                     },

+ 3 - 3
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 16,
+                    "line": 17,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -64,7 +64,7 @@
     "backtrace": [
         {
             "file": "^codemodel-v2\\.cmake$",
-            "line": 16,
+            "line": 17,
             "command": "add_executable",
             "hasParent": true
         },
@@ -114,7 +114,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 17,
+                    "line": 18,
                     "command": "target_link_libraries",
                     "hasParent": true
                 },

+ 2 - 2
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^codemodel-v2\\.cmake$",
-                    "line": 15,
+                    "line": 16,
                     "command": "add_library",
                     "hasParent": true
                 },
@@ -64,7 +64,7 @@
     "backtrace": [
         {
             "file": "^codemodel-v2\\.cmake$",
-            "line": 15,
+            "line": 16,
             "command": "add_library",
             "hasParent": true
         },

+ 1 - 1
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json

@@ -89,7 +89,7 @@
     "backtrace": [
         {
             "file": "^codemodel-v2\\.cmake$",
-            "line": 19,
+            "line": 20,
             "command": "add_library",
             "hasParent": true
         },

+ 10 - 7
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json

@@ -52,7 +52,7 @@
                 "backtrace": [
                   {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 21,
+                    "line": 23,
                     "command": "target_precompile_headers",
                     "hasParent": true
                   },
@@ -71,7 +71,7 @@
                     "backtrace": [
                         {
                             "file": "^cxx/CMakeLists\\.txt$",
-                            "line": 17,
+                            "line": 19,
                             "command": "target_compile_options",
                             "hasParent": true
                         },
@@ -122,7 +122,7 @@
                 "backtrace": [
                     {
                         "file": "^cxx/CMakeLists\\.txt$",
-                        "line": 38,
+                        "line": 40,
                         "command": "install",
                         "hasParent": true
                     },
@@ -139,7 +139,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 45,
+                        "line": 46,
                         "command": "install",
                         "hasParent": true
                     },
@@ -175,7 +175,7 @@
                 "backtrace": [
                     {
                         "file": "^cxx/CMakeLists\\.txt$",
-                        "line": 18,
+                        "line": 20,
                         "command": "target_link_options",
                         "hasParent": true
                     },
@@ -193,7 +193,7 @@
                 "backtrace": [
                     {
                         "file": "^cxx/CMakeLists\\.txt$",
-                        "line": 19,
+                        "line": 21,
                         "command": "target_link_directories",
                         "hasParent": true
                     },
@@ -248,5 +248,8 @@
             "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
             "backtrace": null
         }
-    ]
+    ],
+    "debugger": {
+        "workingDirectory": "^/test/debugger/workingDirectory$"
+    }
 }

+ 4 - 4
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json

@@ -14,7 +14,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -33,7 +33,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },
@@ -61,7 +61,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -80,7 +80,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },

+ 6 - 6
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json

@@ -14,7 +14,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -33,7 +33,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },
@@ -61,7 +61,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -80,7 +80,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },
@@ -108,7 +108,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -127,7 +127,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },

+ 4 - 4
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json

@@ -14,7 +14,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -33,7 +33,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },
@@ -61,7 +61,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 21,
+              "line": 23,
               "command": "target_precompile_headers",
               "hasParent": true
             },
@@ -80,7 +80,7 @@
           "backtrace": [
             {
               "file": "^cxx/CMakeLists\\.txt$",
-              "line": 17,
+              "line": 19,
               "command": "target_compile_options",
               "hasParent": true
             },

+ 2 - 2
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 49,
+                    "line": 51,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -52,7 +52,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 49,
+            "line": 51,
             "command": "add_executable",
             "hasParent": true
         },

+ 3 - 3
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 10,
+                    "line": 12,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -52,7 +52,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 10,
+            "line": 12,
             "command": "add_executable",
             "hasParent": true
         },
@@ -90,7 +90,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 11,
+                    "line": 13,
                     "command": "target_link_libraries",
                     "hasParent": true
                 },

+ 5 - 5
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 9,
+                    "line": 11,
                     "command": "add_library",
                     "hasParent": true
                 },
@@ -57,7 +57,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 9,
+            "line": 11,
             "command": "add_library",
             "hasParent": true
         },
@@ -94,7 +94,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 48,
+                        "line": 49,
                         "command": "install",
                         "hasParent": true
                     },
@@ -124,7 +124,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 48,
+                        "line": 49,
                         "command": "install",
                         "hasParent": true
                     },
@@ -154,7 +154,7 @@
                 "backtrace": [
                     {
                         "file": "^codemodel-v2\\.cmake$",
-                        "line": 53,
+                        "line": 54,
                         "command": "install",
                         "hasParent": true
                     },

+ 3 - 3
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 26,
+                    "line": 28,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -46,7 +46,7 @@
                     [
                         {
                             "file": "^cxx/CMakeLists\\.txt$",
-                            "line": 27,
+                            "line": 29,
                             "command": "set_property",
                             "hasParent": true
                         },
@@ -72,7 +72,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 26,
+            "line": 28,
             "command": "add_executable",
             "hasParent": true
         },

+ 2 - 2
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json

@@ -5,7 +5,7 @@
           [
               {
                   "file": "^cxx/CMakeLists\\.txt$",
-                  "line": 29,
+                  "line": 31,
                   "command": "target_compile_features",
                   "hasParent": true
               },
@@ -19,7 +19,7 @@
           [
               {
                   "file": "^cxx/CMakeLists\\.txt$",
-                  "line": 30,
+                  "line": 32,
                   "command": "target_compile_features",
                   "hasParent": true
               },

+ 3 - 3
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 23,
+                    "line": 25,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -46,7 +46,7 @@
                     [
                         {
                             "file": "^cxx/CMakeLists\\.txt$",
-                            "line": 24,
+                            "line": 26,
                             "command": "set_property",
                             "hasParent": true
                         },
@@ -72,7 +72,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 23,
+            "line": 25,
             "command": "add_executable",
             "hasParent": true
         },

+ 3 - 3
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 14,
+                    "line": 16,
                     "command": "add_executable",
                     "hasParent": true
                 },
@@ -52,7 +52,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 14,
+            "line": 16,
             "command": "add_executable",
             "hasParent": true
         },
@@ -90,7 +90,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 15,
+                    "line": 17,
                     "command": "target_link_libraries",
                     "hasParent": true
                 },

+ 2 - 2
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json

@@ -16,7 +16,7 @@
             "backtrace": [
                 {
                     "file": "^cxx/CMakeLists\\.txt$",
-                    "line": 13,
+                    "line": 15,
                     "command": "add_library",
                     "hasParent": true
                 },
@@ -52,7 +52,7 @@
     "backtrace": [
         {
             "file": "^cxx/CMakeLists\\.txt$",
-            "line": 13,
+            "line": 15,
             "command": "add_library",
             "hasParent": true
         },

+ 1 - 0
Tests/RunCMake/FileAPI/codemodel-v2.cmake

@@ -7,6 +7,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/include_test.cmake")
 add_library(c_lib empty.c)
 add_executable(c_exe empty.c)
 target_link_libraries(c_exe PRIVATE c_lib)
+set_property(TARGET c_exe PROPERTY DEBUGGER_WORKING_DIRECTORY "/test/debugger/workingDirectory")
 
 add_library(c_shared_lib SHARED empty.c)
 add_executable(c_shared_exe empty.c)

+ 2 - 0
Tests/RunCMake/FileAPI/cxx/CMakeLists.txt

@@ -5,6 +5,8 @@ add_library(cxx_lib ../empty.cxx)
 add_executable(cxx_exe ../empty.cxx)
 target_link_libraries(cxx_exe PRIVATE cxx_lib)
 set_property(TARGET cxx_exe PROPERTY FOLDER bin)
+set_property(TARGET cxx_exe PROPERTY DEBUGGER_WORKING_DIRECTORY "/test/debugger/workingDirectory")
+set_property(TARGET cxx_exe PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "/test/debugger/workingDirectoryVS")
 
 add_library(cxx_shared_lib SHARED ../empty.cxx)
 add_executable(cxx_shared_exe ../empty.cxx)