<div dir="ltr"><div>In latest CMake Doc for cmake modules at:<br><br><a href="https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html#module:CMakePackageConfigHelpers">https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html#module:CMakePackageConfigHelpers</a><br><br></div>I find:<br clear="all"><div><div><p>Example using both configure_package_config_file() and
write_basic_package_version_file(): CMakeLists.txt:</p>
<div class="gmail-highlight-default"><div class="gmail-highlight"><pre><span></span>set(INCLUDE_INSTALL_DIR include/ ... CACHE )
set(LIB_INSTALL_DIR lib/ ... CACHE )
set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
...
include(CMakePackageConfigHelpers)
configure_package_config_file(<a href="http://FooConfig.cmake.in">FooConfig.cmake.in</a> ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
                              INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
                              PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
                                 VERSION 1.2.3
                                 COMPATIBILITY SameMajorVersion )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
        DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
</pre></div>
</div><br><br></div><div>Uses for the install directory<br><br>INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake<br><br></div><div>which leads me to beleive that install will be to <br><br></div><div>${CMAKE_INSTALL_PREIX}/lib/Foo/cmake<br><br></div><div>However lets look at where say come projects from a company called Kitware put them:<br><br>./lib/cmake<br>./lib/cmake/ITK-4.8<br>./lib/cmake/vtk-7.0<br><br></div><div>And note the version say  ITK-4.8 because if your intalling multiple versions say old on top of new I may be a good idea not to have directories without version info say like<br><br></div><div>lib/Foo<br></div><div><br>better might be <br><br></div><div>lib/cmake/Foo-1.2.3<br><br></div><div>but hey for documentation stating the "best practices" CMake still appears all over the map when in comes to packages.<br><br></div><div>Thoughts?<br></div><div><br></div></div></div>