CMake:在哪里安装FooBarConfig.cmake和FooBarConfigVersion.cmake? [英] CMake: Where to install FooBarConfig.cmake and FooBarConfigVersion.cmake?

查看:232
本文介绍了CMake:在哪里安装FooBarConfig.cmake和FooBarConfigVersion.cmake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我使用CMake编译的库A。我也想通过一个包(例如RPM)分发它。



我的包应该在哪里安装文件AConfig.cmake和AConfigVersion.cmake?



在/ usr / share / cmake / Linux上的模块?

解决方案

您应该在这里找到您需要的:



http://www.cmake.org/Wiki/CMake/Tutorials/Packaging p>

使用文本的相关部分:


考虑一个项目Foo安装以下文件:




  • < prefix> /include/foo-1.2/foo.h

  • < prefix> /lib/foo-1.2/libfoo.a



它还可以提供CMake包配置文件




  • < prefix> /lib/foo-1.2/foo-config.cmake



b $ b

配置文件需要在您的安装树中。只有 FindXXX.cmake 文件应该在modules目录中。


Let be a library A that I compile with CMake. I also want to distribute it via a package (e.g. RPM).

Where should my package install the files AConfig.cmake and AConfigVersion.cmake ?

In /usr/share/cmake/Modules on Linux ?

解决方案

You should find what you need here:

http://www.cmake.org/Wiki/CMake/Tutorials/Packaging

With the relevant portion of the text:

Consider a project "Foo" that installs the following files:

  • <prefix>/include/foo-1.2/foo.h
  • <prefix>/lib/foo-1.2/libfoo.a

It may also provide a CMake package configuration file

  • <prefix>/lib/foo-1.2/foo-config.cmake

The config files need the be in your install tree. Only the FindXXX.cmake file should go in the modules directory.

这篇关于CMake:在哪里安装FooBarConfig.cmake和FooBarConfigVersion.cmake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆