aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarath Kannan <barathsotd@gmail.com>2017-10-17 03:15:30 +1100
committerBarath Kannan <barathsotd@gmail.com>2017-10-17 03:15:30 +1100
commitc147fc78c919d6084e5f98a574484346d590f00d (patch)
treefcd63eab8d7c0381441fe3f6e742dd77cea67aae
parentd28de4a13edca249086e3ccf8d34e92ecb10006d (diff)
downloadvcpkg-c147fc78c919d6084e5f98a574484346d590f00d.tar.gz
vcpkg-c147fc78c919d6084e5f98a574484346d590f00d.zip
further fixes
-rw-r--r--ports/qt5base/qt_debug.conf13
-rw-r--r--ports/qt5base/qt_release.conf13
-rw-r--r--ports/qt5declarative/fixcmake.py48
-rw-r--r--ports/qt5declarative/portfile.cmake49
-rw-r--r--ports/qt5doc/CONTROL4
-rw-r--r--ports/qt5docs/CONTROL4
-rw-r--r--ports/qt5docs/portfile.cmake (renamed from ports/qt5doc/portfile.cmake)10
-rw-r--r--ports/qt5tools/fixcmake.py48
-rw-r--r--ports/qt5tools/portfile.cmake32
-rw-r--r--ports/qt5winextras/portfile.cmake6
-rw-r--r--scripts/cmake/vcpkg_build_qmake_debug.cmake3
-rw-r--r--scripts/cmake/vcpkg_build_qmake_release.cmake5
12 files changed, 214 insertions, 21 deletions
diff --git a/ports/qt5base/qt_debug.conf b/ports/qt5base/qt_debug.conf
new file mode 100644
index 000000000..96e4a2a4d
--- /dev/null
+++ b/ports/qt5base/qt_debug.conf
@@ -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 \ No newline at end of file
diff --git a/ports/qt5base/qt_release.conf b/ports/qt5base/qt_release.conf
new file mode 100644
index 000000000..ddd9d1880
--- /dev/null
+++ b/ports/qt5base/qt_release.conf
@@ -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 \ No newline at end of file
diff --git a/ports/qt5declarative/fixcmake.py b/ports/qt5declarative/fixcmake.py
new file mode 100644
index 000000000..d55ca7754
--- /dev/null
+++ b/ports/qt5declarative/fixcmake.py
@@ -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() \ No newline at end of file
diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake
index b6a24946b..48ab900ce 100644
--- a/ports/qt5declarative/portfile.cmake
+++ b/ports/qt5declarative/portfile.cmake
@@ -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}
+)
+
+vcpkg_build_qmake_debug()
+
+vcpkg_configure_qmake_release(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
- OPTIONS "CONFIG+=debug_and_release"
)
-vcpkg_build_qmake()
+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) \ No newline at end of file
diff --git a/ports/qt5doc/CONTROL b/ports/qt5doc/CONTROL
deleted file mode 100644
index aef693586..000000000
--- a/ports/qt5doc/CONTROL
+++ /dev/null
@@ -1,4 +0,0 @@
-Source: qt5doc
-Version: 5.9.2-0
-Description: Qt5 Document Creation Module
-Build-Depends: qt5base \ No newline at end of file
diff --git a/ports/qt5docs/CONTROL b/ports/qt5docs/CONTROL
new file mode 100644
index 000000000..32d85ef37
--- /dev/null
+++ b/ports/qt5docs/CONTROL
@@ -0,0 +1,4 @@
+Source: qt5docs
+Version: 5.9.2-0
+Description: Qt5 Documentation
+Build-Depends: qt5base, qt5tools \ No newline at end of file
diff --git a/ports/qt5doc/portfile.cmake b/ports/qt5docs/portfile.cmake
index 9cacc8166..6b177dda1 100644
--- a/ports/qt5doc/portfile.cmake
+++ b/ports/qt5docs/portfile.cmake
@@ -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
+)
diff --git a/ports/qt5tools/fixcmake.py b/ports/qt5tools/fixcmake.py
new file mode 100644
index 000000000..d55ca7754
--- /dev/null
+++ b/ports/qt5tools/fixcmake.py
@@ -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() \ No newline at end of file
diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake
index 2a2e5cd4d..ebcdb6b12 100644
--- a/ports/qt5tools/portfile.cmake
+++ b/ports/qt5tools/portfile.cmake
@@ -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
diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake
index 800e3490b..5d7b85909 100644
--- a/ports/qt5winextras/portfile.cmake
+++ b/ports/qt5winextras/portfile.cmake
@@ -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
diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake
index 7e5625850..a734e63cf 100644
--- a/scripts/cmake/vcpkg_build_qmake_debug.cmake
+++ b/scripts/cmake/vcpkg_build_qmake_debug.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
)
diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake
index 6cfbcdc91..3daf9201b 100644
--- a/scripts/cmake/vcpkg_build_qmake_release.cmake
+++ b/scripts/cmake/vcpkg_build_qmake_release.cmake
@@ -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
)