CMake的preLOAD脚本缓存 [英] CMake preload script for cache

查看:285
本文介绍了CMake的preLOAD脚本缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我CMake的火带-C mysettings.cmake。

I fire cmake with the -C mysettings.cmake.

myfile.cmake的含量

The content of myfile.cmake is

set(CMAKE_INSTALL_PREFIX "C:/install/mylib" STRING)

产生的一切,但它似乎是-C mysettings.cmake变量未设置。它仍然是安装在默认目录。

Everything is generated but it seems the -C mysettings.cmake variable is not set. It is still installed in the default directory.

CMake的打印初始加载缓存文件../../script/cmake/mysettings.cmake的消息
没有任何错误。

Cmake prints the message "loading initial cache file ../../script/cmake/mysettings.cmake" without any error.

完整的呼叫:

cmake -C ../../script/cmake/mysettings.cmake -G "Visual Studio 9 2008" ../../source/mylib

是不是有什么毛病我的语法?

Is there something wrong with my syntax?

推荐答案

从的 CMake的手动

给定的文件应该是一个包含CMake的脚本SET命令的
  使用缓存选项,而不是一个缓存格式的文件。

The given file should be a CMake script containing SET commands that use the CACHE option, not a cache-format file.

所以你的 myfile.cmake 需要来是这个样子:

So your myfile.cmake needs to look something like this:

set(CMAKE_INSTALL_PREFIX "C:/install/mylib" CACHE PATH "")

这篇关于CMake的preLOAD脚本缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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