ecbuild_install_project

Set up packaging and export configuration.

ecbuild_install_project( NAME <name> [ DESCRIPTION <description> ] )

Options

NAMErequired

project name used for packaging

DESCRIPTIONoptional

project description used for packaging

Usage

ecbuild_install_project should be called at the very end of any ecBuild project (only followed by ecbuild_print_summary), sets up packaging of the project with cpack and exports the configuration and targets for other projects to use.

Unless ECBUILD_SKIP_<PROJECT_NAME>_EXPORT is set, the following files are generated:

<project>-config.cmake

default project configuration

<project>-config-version.cmake

project version number

<project>-targets.cmake

exported targets

<project>-import.cmake

extra project configuration (optional)

<project>-post-import.cmake

extra project configuration (optional)

For <project>-import.cmake to be exported to build and install tree, <project>-import.cmake or <project>-import.cmake.in must exist in the source tree. The same applies for <project>-post-import.cmake. The ‘import’ file is included before defining the targets (e.g. to call find_dependency), whereas the ‘post-import’ file is included after (e.g. to

define aliases). <project>-config.cmake.in and <project>-config-version.cmake.in can be provided in the source tree to override the default templates used to generate <project>-config.cmake and <project>-config-version.cmake.

If the project is added as a subdirectory, the following CMake variables are set in the parent scope:

<PROJECT_NAME>_FOUND

set to TRUE

<PROJECT_NAME>_VERSION

version string

<PROJECT_NAME>_FEATURES

list of enabled features

<PROJECT_NAME>_HAVE_<FEATURE>

set to 1 for each enabled features