• 6449阅读
  • 2回复

如何安装网友预编译版本到不同于编译时设置的目录 [复制链接]

上一主题 下一主题
离线billzang
 

只看楼主 倒序阅读 楼主  发表于: 2009-10-14
如何安装网友预编译版本到不同于编译时设置的目录
如何安装网友预编译版本到不同于编译时设置的目录?
我将网友预编译QT版本拷贝到自定义的目录后, 设置QTDIR QMAKESPECS 等环境变量后 qmake正常 但是 Nmake 时 提示 错误。 检查Makefile文件  在makefile.debug文件里 include目录 还是 编译时设置的目录。
难道我必须重新编译生成QT吗, 配置信息设置在何处 如何修改?
离线billzang

只看该作者 1楼 发表于: 2009-10-14
解决方案1:
Qt 在configure配置后 将路径写死在代码文件中QConfig.h 中:
/* Licensed */
static const char qt_configure_licensee_str          [512 + 12] = "qt_lcnsuser=Open Source";
static const char qt_configure_licensed_products_str [512 + 12] = "qt_lcnsprod=OpenSource";
static const char qt_configure_prefix_path_str       [512 + 12] = "qt_prfxpath=C:\\Qt\\4.5.2";
static const char qt_configure_documentation_path_str[512 + 12] = "qt_docspath=C:\\Qt\\4.5.2\\doc";
static const char qt_configure_headers_path_str      [512 + 12] = "qt_hdrspath=C:\\Qt\\4.5.2\\include";
static const char qt_configure_libraries_path_str    [512 + 12] = "qt_libspath=C:\\Qt\\4.5.2\\lib";
static const char qt_configure_binaries_path_str     [512 + 12] = "qt_binspath=C:\\Qt\\4.5.2\\bin";
static const char qt_configure_plugins_path_str      [512 + 12] = "qt_plugpath=C:\\Qt\\4.5.2\\plugins";
static const char qt_configure_data_path_str         [512 + 12] = "qt_datapath=C:\\Qt\\4.5.2";
static const char qt_configure_translations_path_str [512 + 12] = "qt_trnspath=C:\\Qt\\4.5.2\\translations";
static const char qt_configure_examples_path_str     [512 + 12] = "qt_xmplpath=C:\\Qt\\4.5.2\\examples";
static const char qt_configure_demos_path_str        [512 + 12] = "qt_demopath=C:\\Qt\\4.5.2\\demos";
/* strlen( "qt_lcnsxxxx" ) == 12 */
#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;
#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;
#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;
#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;
#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;
#define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;
#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;
#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;
#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;
#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;
#define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;
#define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;

在configure 配置完成后 nmake 之前 修改src\corelib\global\qlibraryinfo.cpp 文件
QLibraryInfo::location(LibraryLocation loc) 函数
返回相对路径, 编译成功的文件 就可以放到任意设置的路径下。

建议网友预编译的版本 都修改下 提供此项功能
其他人是否有更简便的方法?
离线mars4zhu
只看该作者 2楼 发表于: 2011-05-23
编译qtcreator的src\tools\qtlibspatcher, 以管理员运行, 提供新的路径作为参数即可
快速回复
限100 字节
 
上一个 下一个