[cmake-developers] Making Config.cmake files easier to write
Eric Noulard
eric.noulard at gmail.com
Thu Feb 16 15:52:18 EST 2012
2012/2/16 Brad King <brad.king at kitware.com>:
> On 2/16/2012 3:29 PM, Eric Noulard wrote:
>>
>> What are you targeting?
>>
>> install-time i.e. "make install" usage?
>> package install time prodduced with cpack usage?
>> package install time NOT produced with cpack usage?
>> a subset of this?
>
>
> The goal is a FooConfig.cmake file for "make install" time but
> that contains no hard-coded paths referring to the install prefix.
> It should be totally relocatable. I think we've resolved all
> that in the other parts of this thread.
I'm not convinced, yet I'll have to try with the example provided by Alex
by adding proper CPack usage in it.
Currently I see in BarConfig.cmake
get_filename_component(BAR_HELPER_PREFIX_DIR
"${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
computed by CONFIGURE_CONFIG_FILE with
if(NOT IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
endif()
file(RELATIVE_PATH CONFIG_RELATIVE_PATH "${absInstallDir}"
"${CMAKE_INSTALL_PREFIX}" )
where you can see the usage of "CMAKE_INSTALL_PREFIX".
since CPack is using DESTDIR in order to do its local install before
actual packaging
I cannot see how this could work with CPack but again I may be simply
missing the point
I'll try to follow the thread tomorrow and try by myself.
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
More information about the cmake-developers
mailing list