Determine the directory to install package config and version files (like /usr/lib/cmake)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Determine the directory to install package config and version files (like /usr/lib/cmake)

Daniel Wyatt
Is there a way to determine this directory?

Right now I have something like:
${CMAKE_INSTALL_LIBDIR}/cmake/<project-name>/something-version.cmake

On CentOS 7 w/cmake3, however, this should be /usr/lib/cmake3/...

Obviously I can just check to see if this directory exists and then fall back,
but I'm wondering if there is a bultin variable to retrieve this (I've looked, but no luck so far).

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Determine the directory to install package config and version files (like /usr/lib/cmake)

Craig Scott-3


On Sun, Jun 17, 2018 at 11:15 AM, Daniel Wyatt <[hidden email]> wrote:
Is there a way to determine this directory?

Right now I have something like:
${CMAKE_INSTALL_LIBDIR}/cmake/<project-name>/something-version.cmake

On CentOS 7 w/cmake3, however, this should be /usr/lib/cmake3/...

Obviously I can just check to see if this directory exists and then fall back,
but I'm wondering if there is a bultin variable to retrieve this (I've looked, but no luck so far).

CMake does not require one specific location, it searches quite a few locations. It is up to the project where it installs to, but I'd normally recommend the place you are already using (${CMAKE_INSTALL_LIBDIR}/cmake/<project-name>/). Have a look here for the full list (scroll down to the list of directories starting with <prefix>/...):


The only thing I could find that referred to a .../cmake3/ location was the cmake3 package from epel, which I assume they do to avoid clashing with the default cmake package. Personally, I'd consider that to be wrong behavior though since CMake won't be searching that location by default (unless they patched their cmake3 executable to search there as well, but still it's not ideal).


--
Craig Scott
Melbourne, Australia

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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