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

cmake completion for --find-package lacks required -D arguments #593

Open
pseyfert opened this issue Sep 3, 2018 · 2 comments
Open

cmake completion for --find-package lacks required -D arguments #593

pseyfert opened this issue Sep 3, 2018 · 2 comments

Comments

@pseyfert
Copy link
Contributor

pseyfert commented Sep 3, 2018

The current cmake completion does not suggest the -D arguments that are required when running --find-package.
See also stackoverflow.

Essentially, when one uses --find-package, also -DNAME must be set. Otherwise cmake complains:

CMake Error at /usr/share/cmake-3.12/Modules/CMakeFindPackageMode.cmake:33 (message):
  Name of the package to be searched not specified.  Set the CMake variable
  NAME, e.g.  -DNAME=JPEG .

Further down the line one gets

CMake Error at /usr/share/cmake-3.12/Modules/CMakeFindPackageMode.cmake:37 (message):
  COMPILER_ID argument not specified.  In doubt, use GNU.

then

CMake Error at /usr/share/cmake-3.12/Modules/CMakeFindPackageMode.cmake:41 (message):
  LANGUAGE argument not specified.  Use C, CXX or Fortran.

and eventually

CMake Error at /usr/share/cmake-3.12/Modules/CMakeFindPackageMode.cmake:45 (message):
  MODE argument not specified.  Use either EXIST, COMPILE or LINK.

I.e. --find-package implies that -DNAME=, -DLANGUAGE=, -DCOMPILER_ID=
and -DMODE= are provided. The possible values are spelled out in the error
messages above.

I don't see how to add that myself to the current completion (given time constraints and priorities).

@syohex
Copy link
Contributor

syohex commented Mar 26, 2020

I see

BTW It looks --find-packages option is not recommended by official document.

Note This mode is not well-supported due to some technical limitations. It is kept for compatibility but should not be used in new projects.

@pseyfert
Copy link
Contributor Author

pseyfert commented Apr 1, 2020

https://cmake.org/cmake/help/v3.17/release/3.17.html#command-line somewhat related, the release notes of the latest cmake release mention --debug-find as new option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants