aui icon indicating copy to clipboard operation
aui copied to clipboard

AUI.Boot find multiple packages from one import

Open Alex2772 opened this issue 3 years ago • 1 comments

It's the case of the gRPC library.

Consider the imported library MyLibrary contains several package configs: MyLibrary-config.cmake for the actual library and MyLibraryHelper-config.cmake for some helper stuff. How can I import both of the configs using AUI.Boot?

Alex2772 avatar Feb 12 '22 13:02 Alex2772

New options:

  • NO_FIND_PACKAGE disables find_package function call inside auib_import

New functions:

  • auib_find_package(<AUIB_IMPORT_NAME> ...) - wraps find_package trying to find packages in AUIB_IMPORT_NAME imported dir.

Example 1:

auib_import(MyLibrary ... NO_FIND_PACKAGE)
auib_find_package(MyLibrary MyLibrary REQUIRED)
auib_find_package(MyLibrary MyLibraryHelper REQUIRED)

Example 2:

auib_import(MyLibrary ...)
auib_find_package(MyLibrary MyLibraryHelper REQUIRED)

However, it would be nice to completely remove the first arg of auib_import.

Pros:

  • auib_import will be easier to use
  • No more guessing what's library's find package name
  • Finds automatically all find_package configs and prints their names
  • Covers multiple packages case

Cons:

  • Legacy
  • Need to somehow determine available find_package config names
  • Still need NO_FIND_PACKAGE if we want to import different components of the different packages

Alex2772 avatar Feb 12 '22 14:02 Alex2772