]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/qt5-base/cmake/qt_fix_cmake.cmake
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / qt5-base / cmake / qt_fix_cmake.cmake
1 function(qt_fix_cmake PACKAGE_DIR_TO_FIX PORT_TO_FIX)
2
3 file(GLOB_RECURSE cmakefiles ${PACKAGE_DIR_TO_FIX}/share/cmake/*.cmake ${PACKAGE_DIR_TO_FIX}/lib/cmake/*.cmake)
4 foreach(cmakefile ${cmakefiles})
5 file(READ "${cmakefile}" _contents)
6 if(_contents MATCHES "_install_prefix}/tools/qt5/bin/([a-z0-9]+)") # there are only about 3 to 5 cmake files which require the fix in ports: qt5-tools qt5-xmlpattern at5-activeqt qt5-quick
7 string(REGEX REPLACE "_install_prefix}/tools/qt5/bin/([a-z0-9]+)" "_install_prefix}/tools/${PORT_TO_FIX}/bin/\\1" _contents "${_contents}")
8 file(WRITE "${cmakefile}" "${_contents}")
9 endif()
10 endforeach()
11
12 #Install cmake files
13 if(EXISTS ${PACKAGE_DIR_TO_FIX}/lib/cmake)
14 file(MAKE_DIRECTORY ${PACKAGE_DIR_TO_FIX}/share)
15 file(RENAME ${PACKAGE_DIR_TO_FIX}/lib/cmake ${PACKAGE_DIR_TO_FIX}/share/cmake)
16 endif()
17 #Remove extra cmake files
18 if(EXISTS ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake)
19 file(REMOVE_RECURSE ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake)
20 endif()
21 endfunction()