Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target install missing #504

Closed
stigrs opened this issue Aug 1, 2018 · 9 comments · Fixed by #686
Closed

Target install missing #504

stigrs opened this issue Aug 1, 2018 · 9 comments · Fixed by #686
Labels
bug a bug in the product more info needed More info is needed from the community for us to properly triage and investigate.
Milestone

Comments

@stigrs
Copy link

stigrs commented Aug 1, 2018

Brief Issue Summary

Target "install" can no longer be selected from the bottom toolbar; only "all" is available.

Expected:

One should be able to select target "install" the same way as target "all".

@no-realm
Copy link
Contributor

no-realm commented Aug 1, 2018

Just to be sure, did you provide an install target?

@no-realm no-realm added the more info needed More info is needed from the community for us to properly triage and investigate. label Aug 1, 2018
@stigrs
Copy link
Author

stigrs commented Aug 1, 2018 via email

@vector-of-bool vector-of-bool added the bug a bug in the product label Aug 14, 2018
@vector-of-bool vector-of-bool added this to the Backlog milestone Aug 14, 2018
@andy-held
Copy link

andy-held commented Jan 10, 2019

I am having the same problem.

vscode: 1.30.1
cmake-tools: 1.1.3
CMake: 3.13.2
OS: Ubuntu 18.04

@jclay
Copy link

jclay commented Jan 11, 2019

It's hard to diagnose this without anymore information. Which generator are you using? What happens if you attempt to use the target from the command line? To the extent possible, it would be helpful to try to isolate this to either a CMake config issue or a bug in the extension.

cmake --build . --target your_target

@andy-held
Copy link

The generator is ninja, is that always the default generator in cmake-tools? Because I think I did not select ninja anywhere.

cmake --build . --target install

and

ninja install

both work in the build directory.
I am looking into writing a test to debug this, but this is my first encounter with vscode extension coding, I am noobing around.

@paulelsner
Copy link

Same problem here. With ninja on Windows.

@yeganer
Copy link

yeganer commented May 13, 2019

I had a quick look and it looks like the 'install' target is never added to the list of available targets.

My assumption is that the behavior of the cmake-server changed between versions where old versions would advertise the install target and newer versions don't (I tested with 3.13).

I can think of two ways to fix this:

  1. Use the same special treatment as for the all target and always add it. This means if there is no install target and I build, I'll get an error (same behavior as running the CMake: Install command with no install target present).
  2. Check if there is an install target (through some other means) and then add it.

Option 1 would be easier to implement, Option 2 would be cleaner.

@andy-held
Copy link

andy-held commented May 15, 2019

I looked at what CMake server 3.13 reports in the 'codemodel' reply, it seems it does not report any meta-targets like 'install' or 'clean'.

Here is the reply:

{
    "configurations": [
        {
            "name": "RelWithDebInfo",
            "projects": [
                {
                    "buildDirectory": "/home/local/test/build",
                    "hasInstallRule": false,
                    "minimumCMakeVersion": "3.13",
                    "name": "test",
                    "sourceDirectory": "/home/local/test",
                    "targets": [
                        {
                            "artifacts": [
                                "/home/local/test/build/test"
                            ],
                            "buildDirectory": "/home/local/test/build",
                            "fileGroups": [
                                {
                                    "compileFlags": "-O2 -g -DNDEBUG  ",
                                    "includePath": [
                                        {
                                            "isSystem": true,
                                            "path": "/home/local/test/lib0/build/install/include"
                                        }
                                    ],
                                    "isGenerated": false,
                                    "language": "CXX",
                                    "sources": [
                                        "test.cpp"
                                    ]
                                }
                            ],
                            "fullName": "test",
                            "isGeneratorProvided": false,
                            "linkLanguageFlags": "-O2 -g -DNDEBUG",
                            "linkLibraries": "../lib0/build/install/lib/liblib0.a",
                            "linkerLanguage": "CXX",
                            "name": "test",
                            "sourceDirectory": "/home/local/test",
                            "type": "EXECUTABLE"
                        }
                    ]
                }
            ]
        }
    ],
    "cookie": "",
    "inReplyTo": "codemodel",
    "type": "reply"
}

@andy-held
Copy link

andy-held commented May 15, 2019

Another test showed that installable targets have a 'hasInstallRule' field. Would it make sense to add the install target whenever there is at least one installable target?

Here is another test codemodel:

{
    "configurations": [
        {
            "name": "Debug",
            "projects": [
                {
                    "buildDirectory": "/home/local/test/lib0/build",
                    "hasInstallRule": true,
                    "minimumCMakeVersion": "3.13",
                    "name": "lib0",
                    "sourceDirectory": "/home/local/test/lib0",
                    "targets": [
                        {
                            "artifacts": [
                                "/home/local/test/lib0/build/liblib0d.a"
                            ],
                            "buildDirectory": "/home/local/test/lib0/build",
                            "fileGroups": [
                                {
                                    "isGenerated": false,
                                    "sources": [
                                        "lib0.h"
                                    ]
                                },
                                {
                                    "compileFlags": "-g  ",
                                    "includePath": [
                                        {
                                            "path": "/home/local/test/lib0"
                                        }
                                    ],
                                    "isGenerated": false,
                                    "language": "CXX",
                                    "sources": [
                                        "lib0.cpp"
                                    ]
                                }
                            ],
                            "fullName": "liblib0d.a",
                            "hasInstallRule": true,
                            "installPaths": [
                                "/home/local/test/lib0/build/install/lib"
                            ],
                            "isGeneratorProvided": false,
                            "linkerLanguage": "CXX",
                            "name": "lib0",
                            "sourceDirectory": "/home/local/test/lib0",
                            "type": "STATIC_LIBRARY"
                        }
                    ]
                }
            ]
        }
    ],
    "cookie": "",
    "inReplyTo": "codemodel",
    "type": "reply"
}

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product more info needed More info is needed from the community for us to properly triage and investigate.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants