2019-09-13 01:07:22 +08:00
|
|
|
function(qt_fix_prl PACKAGE_DIR PRL_FILES)
|
|
|
|
file(TO_CMAKE_PATH "${PACKAGE_DIR}/lib" CMAKE_LIB_PATH)
|
|
|
|
file(TO_CMAKE_PATH "${PACKAGE_DIR}/include" CMAKE_INCLUDE_PATH)
|
2020-04-09 03:33:54 +08:00
|
|
|
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" CMAKE_INSTALLED_PREFIX)
|
2019-09-13 01:07:22 +08:00
|
|
|
foreach(PRL_FILE IN LISTS PRL_FILES)
|
|
|
|
file(READ "${PRL_FILE}" _contents)
|
|
|
|
string(REPLACE "${CMAKE_LIB_PATH}" "\$\$[QT_INSTALL_LIBS]" _contents "${_contents}")
|
|
|
|
string(REPLACE "${CMAKE_INCLUDE_PATH}" "\$\$[QT_INSTALL_HEADERS]" _contents "${_contents}")
|
2020-04-09 03:33:54 +08:00
|
|
|
string(REPLACE "${CMAKE_INSTALLED_PREFIX}" "\$\$[QT_INSTALL_PREFIX]" _contents "${_contents}")
|
|
|
|
#Note: This only works without an extra if case since QT_INSTALL_PREFIX is the same for debug and release
|
|
|
|
file(WRITE "${PRL_FILE}" "${_contents}")
|
2019-09-13 01:07:22 +08:00
|
|
|
endforeach()
|
|
|
|
endfunction()
|