[CMake] structuring installation folders for relocatable multi-platform installations

John Butterfield johnb003 at gmail.com
Fri Jul 13 14:31:55 EDT 2018


What is the recommended way to structure installation folders for a
relocatable installation for multiple platforms?

I'm looking for a structure that works with find_package module mode and
config mode; something like this:

    <install_prefix>/
      include/
        foo/
          foo.h
      lib/
        <PLAT x ARCH x CONFIG>/
          cmake/
            foo/
              FooConfig.cmake
          libFoo.a

Goal is:

 * libs can be co-installed for different platforms, architectures and
configs
 * includes can be shared
 * finding the includes should work in typical module mode searches
 * should just work with vanilla find_package(Foo REQUIRED), but for the
appropriate platform and arch.

Considering I'd be installing mostly 3rd party libraries here, if this can
be done by overriding the vars from GNUInstallDirs, it'd probably work for
many libraries. The rest I guess would either have to be edited or I just
give up and use separate installation dirs that include platform and arch.

I also cross posted on Stack Overflow:
https://stackoverflow.com/questions/51112173/whats-the-ideal-cmake-installation-directory-structure-for-a-relocatable-multip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180713/5cfe833c/attachment.html>


More information about the CMake mailing list