willowgarage/catkin — Issue #28: install_cmake_infrastructure libraries
Author: ethanrublee
Created: 2012-01-01 20:32:20+00:00
State: open

Attempting to port ecto's build system to catkin, i run into this problem with the cmake infrastructure.

Here is my use of the function:

```
install_cmake_infrastructure(ecto
VERSION 0.0.1
INCLUDE_DIRS include
LIBRARIES ecto
)
```

Here is the error

```
CMake Error at catkin/cmake/install_cmake_infrastructure.cmake:163 (install):
install TARGETS given target "ecto" which does not exist in this directory.
Call Stack (most recent call first):
ecto/CMakeLists.txt:88 (install_cmake_infrastructure)
```

My ecto target is declared in ``src/lib/CMakeLists.txt``, while i'm tempted to put the ``install_cmake_infrastructure`` in the top level. Apparently the install(TARGETS ...) command will only look for targets in the current cmake file...

Brainstorm here:
install_cmake_infrastructure should not be used to create the install targets. It should be used to declare configuration related things. Everything necessary to generate the config.cmake and version files:

* where are my includes
* what are my library names
* what is my python path
* version
* special flags
* header include dependencies (e.g. boost and python.h)
* cmake extras location
* etc...

Another function should be used, possibly just vanilla cmake for installation of targets.

Another possibility is the use of the export(...) and install(EXPORT ...) cmake functions which appear to be a native way for exporting targets for use by other projects.