Hi again,

I'm working on setting up install(...) commands for a shared library project 
(call it libA), and I'm using the install(EXPORT ...) signature as has been 
recommended to me previously to export the shared library target so I can 
import it in another CMake-based project (call it libB). So far things have 
been pretty straightforward, but I'm now trying to determine how to deal with 
the public header files for the project. So, two questions:

1. What's the preferred method for installing public headers? I've seen sparse 
documentation about a PUBLIC_HEADER target property, but the lack of 
information I can find about it via Google makes me wonder if it's not 
considered 'best practice'. Taking a look at the CMake list files for the LLVM 
project, they seem to be using multiple install(DIRECTORY ...) commands. I'm 
sure there are multiple ways to do this, so what's recommended?

2. How should libB find the location of the installed headers for libA? With 
Find* modules (of which I'm using a few, FindBoost being one), there is 
generally a LibName_INCLUDE_DIRs variable that gets set with the include path 
that I would add in libB's list file via 
include_directories(${LibName_INCLUDE_DIRS}). But, since I'm using 
exported/imported targets instead of a Find* module, there doesn't seem to be 
any built-in support for 'importing' the headers. I saw something in the 
release notes for a recent CMake version (2.8, I think?) about something called 
'per-target INCLUDE_DIRECTORIES', which sounds promising, but couldn't find 
much more info about it.

Alright, I lied... a third somewhat-related question:

3) What's the general practice as far as where to install the .cmake file 
generated by the install(EXPORT ...) command? Should it go in the install 
location along with the built targets? It seems that the generated .cmake file 
is intended to replace Find* modules and prevent other projects from having to 
know the installed location of the exported library... but wouldn't putting the 
generated .cmake import file in the install location require dependent projects 
to know where the install location is in order to include the .cmake import 
file?

Many thanks!
Matt
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to