vcpkg/ports/qt5-base/cmake/qt_fix_cmake.cmake
Alexander Neumann 96f4487c77 [Qt] Update to 5.12.4 (#7667)
* update to 5.12.4
* removed port qt5-modularscripts and split it functionality into more functions into qt5-base
* added qt_port_hashes.cmake for simpler upgrade.
* added optional VCPKG_QT_HOST_MKSPEC and VCPKG_QT_TARGET_MKSPEC to select QTs build mkspecs from a triplet
* qt_<config>.conf are now copied from the build dir instead from the port dir
* fixed freetype dependencies.
* cleanup of vcpkg_qmake scripts. No strange/unclear replacements anymore.
* introduced vcpkg_buildpath_length_warning
* changed directory layout of the qt5 installation executables and mkspecs a bit.
2019-09-12 10:07:21 -07:00

27 lines
1.1 KiB
CMake

function(qt_fix_cmake PACKAGE_DIR_TO_FIX PORT_TO_FIX)
set(BACKUP_PATH "$ENV{PATH}")
#Find Python and add it to the path
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY)
vcpkg_add_to_path("${PYTHON2_EXE_PATH}")
#Fix the cmake files if they exist
if(EXISTS ${PACKAGE_DIR_TO_FIX}/lib/cmake)
vcpkg_execute_required_process(
COMMAND ${PYTHON2} ${CURRENT_INSTALLED_DIR}/share/qt5/fixcmake.py ${PORT_TO_FIX}
WORKING_DIRECTORY ${PACKAGE_DIR_TO_FIX}/lib/cmake
LOGNAME fix-cmake
)
endif()
#Install cmake files
if(EXISTS ${PACKAGE_DIR_TO_FIX}/lib/cmake)
file(MAKE_DIRECTORY ${PACKAGE_DIR_TO_FIX}/share)
file(RENAME ${PACKAGE_DIR_TO_FIX}/lib/cmake ${PACKAGE_DIR_TO_FIX}/share/cmake)
endif()
#Remove extra cmake files
if(EXISTS ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake)
file(REMOVE_RECURSE ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake)
endif()
set(ENV{PATH} "${BACKUP_PATH}")
endfunction()