Using options

qi_add_optional_package

qi_add_optional_package(NAME DESCRIPTION
)
Arguments:
  • NAME – Name of the package, a WITH_${NAME} option will be created
  • DESCRIPTION – The description of the option (will be shown in cmake gui)

Add optional dependency to a package

Example:

# Create a WITH_FOO option if FOO_PACKAGE is found
qi_add_optional_package(FOO)

if(WITH_FOO)
   ...
endif()