Alexander Neundorf wrote: > On Tuesday 17 January 2012, Yury G. Kudryashov wrote: >> so we need to ensure (or document?) that the >> same directory used while writing MyLibConfig.cmake and installing it. > > Hmm, I don't understand exactly what you mean, can you please explain a > bit more ? Look at the following code:
set(CMAKECONFIG_INSTALL_DIR lib/cmake/MyLib) #MyLibConfig hardcodes $prefix/lib/cmake/MyLib configure_file(MyLibConfig.cmake.in MyLibConfig.cmake) #but is actually installed to a different directory install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MyLibConig.cmake DESTINATION lib/cmake) My points are: 1. The contents of MyLibConfigVersion.cmake does not depend on the DESTINATION argument that will be passed to install(FILES). 2. MyLibConfig.cmake content does. 3. Writing MyLibConfig.cmake to ${CMAKE_CURRENT_BINARY_DIR} is an implementation detail, not a part of "public" API. We can hide this file by placing it to CMakeFiles subdirectory. So, the macro should be called 'install_basic_config_file()'. P.S.: There is another "and" that I'll remove. The current version writes an "external" (installed) *and* internal (for use from another subdirectory) versions of MyLibConfig.cmake. -- Yury G. Kudryashov, mailto: ur...@mccme.ru _______________________________________________ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem