[CMake] How to installing cmake Config.cmake files under Debian multiarch ?

Brad King brad.king at kitware.com
Wed Aug 3 13:46:27 EDT 2011


On 8/3/2011 1:19 PM, Alexander Neundorf wrote:
> Is there already a variable which contains the multiarch triplet, so I can do
> something like lib/${CMAKE_MULTIARCH_TRIPLET}/... ?

Yes, "CMAKE_LIBRARY_ARCHITECTURE".  It contains no slashes and is empty
if there is no architecture choice.

> Slightly different question: if a Config.cmake file is installed on a
> multiarch debian system, will it also be found if installed in lib/ or lib64/
> (i.e. without the multiarch triplet) ?

Yes.

> How can lib/cmake/Foo/FooConfig.cmake know where the include dir is ?

If someone uses absolute install locations he/she better use the installed
package only from those locations.  The packager that creates a binary
installer better use relative locations.  This is no different than it
was before multiarch or GNUInstallDirs.

> We didn't see a way how to do this, so we decided those directories should not
> be in the cache, so we can be sure they are never absolute.

if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
   message(FATAL_ERROR "We do not support this.")
endif()

-Brad


More information about the CMake mailing list