mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 20:25:57 +08:00
further fixes
This commit is contained in:
parent
d28de4a13e
commit
c147fc78c9
13
ports/qt5base/qt_debug.conf
Normal file
13
ports/qt5base/qt_debug.conf
Normal file
@ -0,0 +1,13 @@
|
||||
[Paths]
|
||||
Prefix = C:/vcpkg/installed/x64-windows
|
||||
Documentation = share/qt5/debug/doc
|
||||
Headers = share/qt5/debug/include
|
||||
Libraries = debug/lib
|
||||
Binaries = debug/tools/qt5
|
||||
LibraryExecutables = debug/tools/qt5
|
||||
Plugins = debug/plugins
|
||||
Qml2Imports = qml
|
||||
Data = share/qt5/debug
|
||||
ArchData = share/qt5/debug
|
||||
HostData = share/qt5/debug
|
||||
HostBinaries = debug/tools/qt5
|
13
ports/qt5base/qt_release.conf
Normal file
13
ports/qt5base/qt_release.conf
Normal file
@ -0,0 +1,13 @@
|
||||
[Paths]
|
||||
Prefix = C:/vcpkg/installed/x64-windows
|
||||
Documentation = share/qt5/doc
|
||||
Headers = include
|
||||
Libraries = lib
|
||||
Binaries = tools/qt5
|
||||
LibraryExecutables = tools/qt5
|
||||
Plugins = plugins
|
||||
Qml2Imports = qml
|
||||
Data = share/qt5
|
||||
ArchData = share/qt5
|
||||
HostData = share/qt5
|
||||
HostBinaries = tools/qt5
|
48
ports/qt5declarative/fixcmake.py
Normal file
48
ports/qt5declarative/fixcmake.py
Normal file
@ -0,0 +1,48 @@
|
||||
import os
|
||||
import re
|
||||
from glob import glob
|
||||
|
||||
files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))]
|
||||
|
||||
for f in files:
|
||||
openedfile = open(f, "r")
|
||||
builder = ""
|
||||
dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll")
|
||||
libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib")
|
||||
exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe")
|
||||
for line in openedfile:
|
||||
if "_install_prefix}/bin/${LIB_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/bin/", "/debug/bin/")
|
||||
builder += " endif()\n"
|
||||
elif "_install_prefix}/lib/${LIB_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/lib/", "/debug/lib/")
|
||||
builder += " endif()\n"
|
||||
elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/lib/", "/debug/lib/")
|
||||
builder += " endif()\n"
|
||||
elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/plugins/", "/debug/plugins/")
|
||||
builder += " endif()\n"
|
||||
elif dllpattern.search(line) != None:
|
||||
builder += line.replace("/bin/", "/debug/bin/")
|
||||
elif libpattern.search(line) != None:
|
||||
builder += line.replace("/lib/", "/debug/lib/")
|
||||
elif exepattern.search(line) != None:
|
||||
builder += line.replace("/bin/", "/tools/qt5/")
|
||||
else:
|
||||
builder += line
|
||||
new_file = open(f, "w")
|
||||
new_file.write(builder)
|
||||
new_file.close()
|
@ -33,12 +33,53 @@ set(ENV{_CL_} "/utf-8")
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
|
||||
|
||||
set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}")
|
||||
|
||||
vcpkg_configure_qmake(
|
||||
vcpkg_configure_qmake_debug(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
|
||||
OPTIONS "CONFIG+=debug_and_release"
|
||||
)
|
||||
|
||||
vcpkg_build_qmake()
|
||||
vcpkg_build_qmake_debug()
|
||||
|
||||
vcpkg_configure_qmake_release(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
|
||||
)
|
||||
|
||||
vcpkg_build_qmake_release()
|
||||
|
||||
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py
|
||||
WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake
|
||||
LOGNAME fix-cmake
|
||||
)
|
||||
|
||||
set(ENV{PATH} "${_path}")
|
||||
|
||||
file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe")
|
||||
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
|
||||
file(REMOVE ${BINARY_TOOLS})
|
||||
file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe")
|
||||
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5)
|
||||
file(REMOVE ${BINARY_TOOLS})
|
||||
|
||||
file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
||||
file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
||||
file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug)
|
||||
file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug)
|
||||
|
||||
file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR})
|
||||
file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR})
|
||||
file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR})
|
||||
file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5)
|
||||
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
|
||||
|
||||
file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
|
||||
file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
|
||||
file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS})
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5declarative RENAME copyright)
|
@ -1,4 +0,0 @@
|
||||
Source: qt5doc
|
||||
Version: 5.9.2-0
|
||||
Description: Qt5 Document Creation Module
|
||||
Build-Depends: qt5base
|
4
ports/qt5docs/CONTROL
Normal file
4
ports/qt5docs/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: qt5docs
|
||||
Version: 5.9.2-0
|
||||
Description: Qt5 Documentation
|
||||
Build-Depends: qt5base, qt5tools
|
@ -31,14 +31,10 @@ endif()
|
||||
# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
|
||||
set(ENV{_CL_} "/utf-8")
|
||||
|
||||
vcpkg_configure_qmake_debug(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
|
||||
)
|
||||
|
||||
vcpkg_build_qmake_debug()
|
||||
|
||||
vcpkg_configure_qmake_release(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
|
||||
)
|
||||
|
||||
vcpkg_build_qmake_release()
|
||||
vcpkg_build_qmake_release(
|
||||
TARGETS docs
|
||||
)
|
48
ports/qt5tools/fixcmake.py
Normal file
48
ports/qt5tools/fixcmake.py
Normal file
@ -0,0 +1,48 @@
|
||||
import os
|
||||
import re
|
||||
from glob import glob
|
||||
|
||||
files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))]
|
||||
|
||||
for f in files:
|
||||
openedfile = open(f, "r")
|
||||
builder = ""
|
||||
dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll")
|
||||
libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib")
|
||||
exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe")
|
||||
for line in openedfile:
|
||||
if "_install_prefix}/bin/${LIB_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/bin/", "/debug/bin/")
|
||||
builder += " endif()\n"
|
||||
elif "_install_prefix}/lib/${LIB_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/lib/", "/debug/lib/")
|
||||
builder += " endif()\n"
|
||||
elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/lib/", "/debug/lib/")
|
||||
builder += " endif()\n"
|
||||
elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line:
|
||||
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
|
||||
builder += "\n " + line
|
||||
builder += " else()"
|
||||
builder += "\n " + line.replace("/plugins/", "/debug/plugins/")
|
||||
builder += " endif()\n"
|
||||
elif dllpattern.search(line) != None:
|
||||
builder += line.replace("/bin/", "/debug/bin/")
|
||||
elif libpattern.search(line) != None:
|
||||
builder += line.replace("/lib/", "/debug/lib/")
|
||||
elif exepattern.search(line) != None:
|
||||
builder += line.replace("/bin/", "/tools/qt5/")
|
||||
else:
|
||||
builder += line
|
||||
new_file = open(f, "w")
|
||||
new_file.write(builder)
|
||||
new_file.close()
|
@ -43,6 +43,21 @@ vcpkg_configure_qmake_release(
|
||||
|
||||
vcpkg_build_qmake_release()
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
|
||||
set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}")
|
||||
|
||||
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py
|
||||
WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake
|
||||
LOGNAME fix-cmake
|
||||
)
|
||||
|
||||
set(ENV{PATH} "${_path}")
|
||||
|
||||
file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe")
|
||||
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
|
||||
file(REMOVE ${BINARY_TOOLS})
|
||||
@ -50,6 +65,23 @@ file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.ex
|
||||
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5)
|
||||
file(REMOVE ${BINARY_TOOLS})
|
||||
|
||||
file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
||||
file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
||||
file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug)
|
||||
file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug)
|
||||
|
||||
file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR})
|
||||
file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR})
|
||||
file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR})
|
||||
file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5)
|
||||
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
|
||||
|
||||
file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
|
||||
file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
|
||||
file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS})
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright)
|
||||
|
||||
#touch an empty include file - qt tools does not create any and this is an error in vcpkg
|
||||
|
@ -43,14 +43,14 @@ vcpkg_configure_qmake_release(
|
||||
|
||||
vcpkg_build_qmake_release()
|
||||
|
||||
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
|
||||
set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}")
|
||||
set(_path "$ENV{PATH}")
|
||||
|
||||
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py
|
||||
WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake
|
||||
|
@ -10,6 +10,7 @@
|
||||
# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html
|
||||
|
||||
function(vcpkg_build_qmake_debug)
|
||||
cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN})
|
||||
vcpkg_find_acquire_program(JOM)
|
||||
|
||||
# Make sure that the linker finds the libraries used
|
||||
@ -18,7 +19,7 @@ function(vcpkg_build_qmake_debug)
|
||||
|
||||
message(STATUS "Package ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${JOM}
|
||||
COMMAND ${JOM} ${_csc_TARGETS}
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
|
||||
LOGNAME package-${TARGET_TRIPLET}-dbg
|
||||
)
|
||||
|
@ -10,15 +10,16 @@
|
||||
# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html
|
||||
|
||||
function(vcpkg_build_qmake_release)
|
||||
cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN})
|
||||
vcpkg_find_acquire_program(JOM)
|
||||
|
||||
|
||||
# Make sure that the linker finds the libraries used
|
||||
set(ENV_PATH_BACKUP "$ENV{PATH}")
|
||||
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}")
|
||||
|
||||
message(STATUS "Package ${TARGET_TRIPLET}-rel")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${JOM}
|
||||
COMMAND ${JOM} ${_csc_TARGETS}
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
|
||||
LOGNAME package-${TARGET_TRIPLET}-rel
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user