1 Using the library in other projects {#uselibrary}
2 ===================================
4 The %IMP C++ library can be used in other projects. When %IMP is built or
5 installed, it creates a [CMake](https:
6 `IMPConfig.cmake` which contains information about how %IMP was configured
7 and where all the parts of %IMP can be found. This can be used to easily
8 add %IMP as a dependency to other C++ projects
using CMake.
9 When built from source,
this
10 file is placed in the CMake build directory; when installed, it is placed
11 under the library directory,
for example in `/usr/lib64/cmake/IMP/`.
13 The `IMPConfig.cmake` file defines a number of CMake variables:
15 - `IMP_USE_FILE`: the path to a CMake file which can be
16 [included into other CMake scripts](https:
17 to make %IMP-related CMake functions available.
18 - `IMP_INCLUDE_DIR`: the path containing %IMP C++ headers.
19 - `IMP_xxx_LIBRARY`: the full path to the dynamic library
for the `xxx` module
20 (
for example `IMP_kernel_LIBRARY` points to the IMP kernel and
21 `IMP_atom_LIBRARY` to the IMP::atom library).
22 - `RMF_INCLUDE_PATH`: the path containing RMF C++ headers (
if RMF is
24 - `IMP_DATA_DIR`: the path containing %IMP data files.
25 - `IMP_SWIG_DIR`: the path containing SWIG `.i` files
for all %IMP modules.
27 The paths to all %IMP dependent libraries and headers are also present in
28 this file -
for example `EIGEN3_INCLUDE_DIR` and `Boost_INCLUDE_DIR`.
30 A [FindIMP.cmake](https:
31 file is provided to help CMake find
this %IMP configuration (
using the
33 command), and can be used in other CMake projects.
35 If you also need to use [RMF](https:
36 this should be searched
for separately
using a
37 [FindRMF.cmake](https:
39 See also the tutorial on
40 [
using IMP as a C++ library](https:
41 for a worked example of
using %IMP in a CMake project.
43 This functionality can also be used to build an %IMP module
"out of tree",
44 that is to build the module by itself and link to an existing pre-built
45 %IMP installation. See the [out of tree](@ref outoftree) page
for more