解决方案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) 函数
返回相对路径, 编译成功的文件 就可以放到任意设置的路径下。
建议网友预编译的版本 都修改下 提供此项功能
其他人是否有更简便的方法?