cmake-packages documentation suggests to install CMake config files in a directory that is not found automatically in Windows
The cmake-packages
documentation suggests to install CMake config files to lib/cmake/<package_name>
[1], however that path is not searched for by find_package
on Windows when the package is installed in the default CMAKE_INSTALL_PREFIX
[3] .
A more multi-platform alternative to suggest would be:
if(WIN32 AND NOT CYGWIN)
set(ConfigPackageLocation CMake)
else()
set(ConfigPackageLocation lib/cmake/ClimbingStats)
endif()
This is a common pitfall for libraries developed on *nix system to work correctly out of the box in Windows [3][4][5], so fixing it in the main CMake documentation would be highly beneficial.
[1] : https://gitlab.kitware.com/cmake/cmake/blame/v3.6.1/Help/manual/cmake-packages.7.rst#L327
[2] : https://cmake.org/cmake/help/v3.6/command/find_package.html#command:find_package
[3] : https://github.com/flexible-collision-library/fcl/pull/116#discussion_r58436663