From b14c1ba9088bd5b2ec88ebead50677cc6cc1a576 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 23 Mar 2018 10:01:07 -0700 Subject: [PATCH] [libpq][harfbuzz][qt5-base] Fix non-Windows --- ports/harfbuzz/CONTROL | 2 +- ...pe.patch => find-package-freetype-2.patch} | 26 +-- ports/harfbuzz/portfile.cmake | 4 +- ports/libpq/CMakeLists.txt | 95 +++++++-- ports/libpq/CONTROL | 4 +- ports/libpq/pg_config.darwin.h | 191 ++++++++++++++++++ ports/libpq/pg_config.linux.h | 173 ++++++++++++++++ ports/libpq/portfile.cmake | 5 +- ports/qt5-base/configure_qt.cmake | 33 +-- ports/qt5-base/install_qt.cmake | 29 ++- ports/qt5-base/portfile.cmake | 158 ++++++++++----- 11 files changed, 611 insertions(+), 109 deletions(-) rename ports/harfbuzz/{find-package-freetype.patch => find-package-freetype-2.patch} (74%) create mode 100644 ports/libpq/pg_config.darwin.h create mode 100644 ports/libpq/pg_config.linux.h diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index f03f52187..e6cf6a8e5 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.7.6 +Version: 1.7.6-1 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype, ragel, glib (windows) diff --git a/ports/harfbuzz/find-package-freetype.patch b/ports/harfbuzz/find-package-freetype-2.patch similarity index 74% rename from ports/harfbuzz/find-package-freetype.patch rename to ports/harfbuzz/find-package-freetype-2.patch index a556d1377..85dbbdeec 100644 --- a/ports/harfbuzz/find-package-freetype.patch +++ b/ports/harfbuzz/find-package-freetype-2.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 24ccb6f..21df836 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -201,7 +201,7 @@ set(project_headers - ## Find and include needed header folders and libraries - if (HB_HAVE_FREETYPE) - -- include(FindFreetype) -+ find_package(Freetype REQUIRED) - if (NOT FREETYPE_FOUND) - message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix") - endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index defd5d6..03f9d4e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -267,7 +267,7 @@ set (subset_project_headers + + ## Find and include needed header folders and libraries + if (HB_HAVE_FREETYPE) +- include (FindFreetype) ++ find_package(Freetype REQUIRED) + if (NOT FREETYPE_FOUND) + message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix") + endif () diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index b1c91aa91..906e42d95 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -12,10 +12,10 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp-build.patch" - "${CMAKE_CURRENT_LIST_DIR}/find-package-freetype.patch" + "${CMAKE_CURRENT_LIST_DIR}/find-package-freetype-2.patch" ) -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_CMAKE_SYSTEM_NAME) SET(HAVE_GLIB "OFF") SET(BUILTIN_UCDN "ON") else() diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 35a67118a..57b86e255 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -1,41 +1,98 @@ cmake_minimum_required(VERSION 3.5) project(libpq VERSION 9.6.1 LANGUAGES C) +if(NOT CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}) +endif() + find_package(OpenSSL REQUIRED) +find_program(PERL NAMES perl) + +set(CMAKE_STATIC_LIBRARY_PREFIX) +set(CMAKE_SHARED_LIBRARY_PREFIX) set(CMAKE_DEBUG_POSTFIX "d") -configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/include/pg_config.h) -configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/pg_config_ext.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/include/pg_config_ext.h) -configure_file(${CMAKE_CURRENT_LIST_DIR}/src/include/port/win32.h ${CMAKE_CURRENT_BINARY_DIR}/include/pg_config_os.h) + +file(REMOVE + ${CMAKE_CURRENT_SOURCE_DIR}/src/include/pg_config.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/include/pg_config_ext.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/include/pg_config_os.h +) + +if(WIN32) + configure_file(src/include/pg_config.h.win32 include/pg_config.h) + configure_file(src/include/pg_config_ext.h.win32 include/pg_config_ext.h) + configure_file(src/include/port/win32.h include/pg_config_os.h) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/include/pg_config_ext.h" "#include \n#define PG_INT64_TYPE int64_t") + configure_file("${PORT_DIR}/pg_config.darwin.h" include/pg_config.h COPYONLY) + configure_file(src/include/port/darwin.h include/pg_config_os.h COPYONLY) + configure_file(src/backend/port/dynloader/darwin.h include/dynloader.h COPYONLY) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/include/pg_config_ext.h" "#include \n#define PG_INT64_TYPE int64_t") + configure_file(src/include/port/linux.h include/pg_config_os.h COPYONLY) + configure_file("${PORT_DIR}/pg_config.linux.h" include/pg_config.h COPYONLY) + configure_file(src/backend/port/dynloader/linux.h include/dynloader.h COPYONLY) +else() + message(FATAL_ERROR "Unknown system: ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") +endif() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/include/pg_config_paths.h "#define SYSCONFDIR \"\"") set(INSTALL_INCLUDES ON CACHE BOOL "Install include files") set(pg_port_src - src/port/getaddrinfo.c src/port/pgstrcasecmp.c src/port/pqsignal.c src/port/thread.c - src/port/inet_aton.c src/port/crypt.c src/port/noblock.c src/port/chklocale.c - src/port/inet_net_ntop.c src/port/snprintf.c - src/port/strlcpy.c - src/port/dirent.c src/port/dirmod.c src/port/pgsleep.c src/port/open.c src/port/system.c - src/port/win32error.c - src/port/win32setlocale.c ) +if(WIN32) + list(APPEND pg_port_src + src/port/dirent.c + src/port/inet_aton.c + src/port/inet_net_ntop.c + src/port/win32error.c + src/port/win32setlocale.c + src/port/getaddrinfo.c + src/port/strlcpy.c + ) + include_directories(src/include/port/win32 src/include/port/win32_msvc) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND pg_port_src + src/port/strlcpy.c + ) +endif() + set(pg_backend_src src/backend/libpq/md5.c src/backend/libpq/ip.c src/backend/utils/mb/wchar.c src/backend/utils/mb/encnames.c ) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND pg_backend_src + src/backend/port/dynloader/linux.c + src/backend/port/sysv_sema.c + src/backend/port/sysv_shmem.c + ) +endif() +if(NOT WIN32) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/utils/errcodes.h + COMMAND "${PERL}" "${CMAKE_CURRENT_SOURCE_DIR}/src/backend/utils/generate-errcodes.pl" "${CMAKE_CURRENT_SOURCE_DIR}/src/backend/utils/errcodes.txt" > "${CMAKE_CURRENT_BINARY_DIR}/include/utils/errcodes.h" + VERBATIM + ) + list(APPEND pg_backend_src + ${CMAKE_CURRENT_BINARY_DIR}/include/utils/errcodes.h + ) +endif() + set(pg_libpq_src src/interfaces/libpq/fe-auth.c src/interfaces/libpq/fe-connect.c @@ -49,16 +106,21 @@ set(pg_libpq_src src/interfaces/libpq/fe-secure.c src/interfaces/libpq/libpq-events.c src/interfaces/libpq/pqexpbuffer.c - src/interfaces/libpq/pthread-win32.c - src/interfaces/libpq/win32.c src/interfaces/libpq/libpq-dist.rc ) + +if(WIN32) + list(APPEND pg_libpq_src + src/interfaces/libpq/pthread-win32.c + src/interfaces/libpq/win32.c + ) +endif() set(pg_libpq_interface src/include/postgres_ext.h ${CMAKE_CURRENT_BINARY_DIR}/include/pg_config_ext.h ${CMAKE_CURRENT_BINARY_DIR}/include/pg_config.h src/interfaces/libpq/libpq-fe.h - ) +) set(pg_libpq_catalog_interface src/include/catalog/pg_type.h src/include/catalog/genbki.h @@ -68,8 +130,11 @@ set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_INCLUDE_CURRENT_DIR ON) add_library(libpq ${pg_port_src} ${pg_backend_src} ${pg_libpq_src}) target_compile_definitions(libpq PRIVATE -DFRONTEND -DENABLE_THREAD_SAFETY -DUSE_OPENSSL -D_CRT_SECURE_NO_WARNINGS) -target_link_libraries(libpq PRIVATE OpenSSL::SSL ws2_32 secur32 advapi32 shell32) -target_include_directories(libpq PRIVATE src/include src/include/port/win32 src/include/port/win32_msvc src/port ${CMAKE_CURRENT_BINARY_DIR}/include) +target_link_libraries(libpq PRIVATE OpenSSL::SSL) +if(WIN32) + target_link_libraries(libpq PRIVATE ws2_32 secur32 advapi32 shell32) +endif() +target_include_directories(libpq PRIVATE src/include src/port ${CMAKE_CURRENT_BINARY_DIR}/include) set_target_properties(libpq PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) install(TARGETS libpq diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index b91e08526..225d886de 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,4 +1,4 @@ Source: libpq -Version: 9.6.1-1 +Version: 9.6.1-4 Description: The official database access API of postgresql -Build-Depends: openssl +Build-Depends: openssl, zlib (linux) diff --git a/ports/libpq/pg_config.darwin.h b/ports/libpq/pg_config.darwin.h new file mode 100644 index 000000000..5db9f84d2 --- /dev/null +++ b/ports/libpq/pg_config.darwin.h @@ -0,0 +1,191 @@ +#define ACCEPT_TYPE_ARG1 int +#define ACCEPT_TYPE_ARG2 struct sockaddr * +#define ACCEPT_TYPE_ARG3 socklen_t +#define ACCEPT_TYPE_RETURN int +#define ALIGNOF_DOUBLE 8 +#define ALIGNOF_INT 4 +#define ALIGNOF_LONG 8 +#define ALIGNOF_SHORT 2 +#define BLCKSZ 8192 +#define DEF_PGPORT 5432 +#define DEF_PGPORT_STR "5432" +#define ENABLE_THREAD_SAFETY 1 +#define FLEXIBLE_ARRAY_MEMBER /**/ +#define FLOAT4PASSBYVAL true +#define FLOAT8PASSBYVAL true +#ifdef GETTIMEOFDAY_1ARG +# define gettimeofday(a,b) gettimeofday(a) +#endif +#define HAVE_ATOMICS 1 +#define HAVE_CBRT 1 +#define HAVE_CRYPT 1 +#define HAVE_DECL_FDATASYNC 0 +#define HAVE_DECL_F_FULLFSYNC 1 +#define HAVE_DECL_POSIX_FADVISE 0 +#define HAVE_DECL_SNPRINTF 1 +#define HAVE_DECL_STRLCAT 1 +#define HAVE_DECL_STRLCPY 1 +#define HAVE_DECL_SYS_SIGLIST 1 +#define HAVE_DECL_VSNPRINTF 1 +#define HAVE_DLOPEN 1 +#define HAVE_FDATASYNC 1 +#define HAVE_FLS 1 +#define HAVE_FSEEKO 1 +#define HAVE_FUNCNAME__FUNC 1 +#define HAVE_GCC__ATOMIC_INT32_CAS 1 +#define HAVE_GCC__ATOMIC_INT64_CAS 1 +#define HAVE_GCC__SYNC_CHAR_TAS 1 +#define HAVE_GCC__SYNC_INT32_CAS 1 +#define HAVE_GCC__SYNC_INT32_TAS 1 +#define HAVE_GCC__SYNC_INT64_CAS 1 +#define HAVE_GETADDRINFO 1 +#define HAVE_GETIFADDRS 1 +#define HAVE_GETOPT 1 +#define HAVE_GETOPT_H 1 +#define HAVE_GETOPT_LONG 1 +#define HAVE_GETPEEREID 1 +#define HAVE_GETPWUID_R 1 +#define HAVE_GETRLIMIT 1 +#define HAVE_GETRUSAGE 1 +#define HAVE_HISTORY_TRUNCATE_FILE 1 +#define HAVE_IFADDRS_H 1 +#define HAVE_INET_ATON 1 +#define HAVE_INTPTR_T 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_INT_OPTERR 1 +#define HAVE_INT_OPTRESET 1 +#define HAVE_INT_TIMEZONE 1 +#define HAVE_IPV6 1 +#define HAVE_ISINF 1 +#define HAVE_LANGINFO_H 1 +#define HAVE_LIBM 1 +#define HAVE_LIBREADLINE 1 +#define HAVE_LIBZ 1 +#define HAVE_LOCALE_T 1 +#define HAVE_LONG_INT_64 1 +#define HAVE_LONG_LONG_INT 1 +#define HAVE_MBSTOWCS_L 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMORY_H 1 +#define HAVE_MKDTEMP 1 +#define HAVE_NETINET_IN_H 1 +#define HAVE_NETINET_TCP_H 1 +#define HAVE_NET_IF_H 1 +#define HAVE_POLL 1 +#define HAVE_POLL_H 1 +#define HAVE_PTHREAD 1 +#define HAVE_PTHREAD_IS_THREADED_NP 1 +#define HAVE_PTHREAD_PRIO_INHERIT 1 +#define HAVE_PWD_H 1 +#define HAVE_RANDOM 1 +#define HAVE_READLINE_HISTORY_H 1 +#define HAVE_READLINE_READLINE_H 1 +#define HAVE_READLINK 1 +#define HAVE_RINT 1 +#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 +#define HAVE_RL_COMPLETION_MATCHES 1 +#define HAVE_RL_FILENAME_COMPLETION_FUNCTION 1 +#define HAVE_SETSID 1 +#define HAVE_SHM_OPEN 1 +#define HAVE_SNPRINTF 1 +#define HAVE_SPINLOCKS 1 +#define HAVE_SRANDOM 1 +#define HAVE_SSL_GET_CURRENT_COMPRESSION 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRERROR 1 +#define HAVE_STRERROR_R 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRUCT_ADDRINFO 1 +#define HAVE_STRUCT_OPTION 1 +#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 +#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 +#define HAVE_STRUCT_TM_TM_ZONE 1 +#define HAVE_SYMLINK 1 +#define HAVE_SYSLOG 1 +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_IPC_H 1 +#define HAVE_SYS_POLL_H 1 +#define HAVE_SYS_RESOURCE_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_SEM_H 1 +#define HAVE_SYS_SHM_H 1 +#define HAVE_SYS_SOCKET_H 1 +#define HAVE_SYS_SOCKIO_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_UCRED_H 1 +#define HAVE_SYS_UN_H 1 +#define HAVE_TERMIOS_H 1 +#define HAVE_TM_ZONE 1 +#define HAVE_TOWLOWER 1 +#define HAVE_TZNAME 1 +#define HAVE_UINTPTR_T 1 +#define HAVE_UNION_SEMUN 1 +#define HAVE_UNISTD_H 1 +#define HAVE_UNIX_SOCKETS 1 +#define HAVE_UNSETENV 1 +#define HAVE_UNSIGNED_LONG_LONG_INT 1 +#define HAVE_UTIME 1 +#define HAVE_UTIMES 1 +#define HAVE_UTIME_H 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_WCHAR_H 1 +#define HAVE_WCSTOMBS 1 +#define HAVE_WCSTOMBS_L 1 +#define HAVE_WCTYPE_H 1 +#define HAVE__BUILTIN_BSWAP32 1 +#define HAVE__BUILTIN_BSWAP64 1 +#define HAVE__BUILTIN_CONSTANT_P 1 +#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1 +#define HAVE__BUILTIN_UNREACHABLE 1 +#define HAVE__GET_CPUID 1 +#define HAVE__STATIC_ASSERT 1 +#define HAVE__VA_ARGS 1 +#define INT64_MODIFIER "l" +#define LOCALE_T_IN_XLOCALE 1 +#define MAXIMUM_ALIGNOF 8 +#define MEMSET_LOOP_LIMIT 1024 +#define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org" +#define PACKAGE_NAME "PostgreSQL" +#define PACKAGE_STRING "PostgreSQL 9.6.3" +#define PACKAGE_TARNAME "postgresql" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "9.6.3" +#define PG_INT128_TYPE __int128 +#define PG_INT64_TYPE long int +#define PG_KRB_SRVNAM "postgres" +#define PG_MAJORVERSION "9.6" +#define PG_PRINTF_ATTRIBUTE printf +#define PG_VERSION "9.6.3" +#define PG_VERSION_NUM 90603 +#define PG_VERSION_STR "PostgreSQL 9.6.3 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 7.0.2 (clang-700.1.81), 64-bit" +#define RELSEG_SIZE 131072 +#define SIZEOF_LONG 8 +#define SIZEOF_OFF_T 8 +#define SIZEOF_SIZE_T 8 +#define SIZEOF_VOID_P 8 +#define STDC_HEADERS 1 +#define STRERROR_R_INT 1 +#define USE_FLOAT4_BYVAL 1 +#define USE_FLOAT8_BYVAL 1 +#define USE_INTEGER_DATETIMES 1 +#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1 +#define USE_SYSV_SEMAPHORES 1 +#define USE_SYSV_SHARED_MEMORY 1 +#define WCSTOMBS_L_IN_XLOCALE 1 +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#endif +#define XLOG_BLCKSZ 8192 +#define XLOG_SEG_SIZE (16 * 1024 * 1024) diff --git a/ports/libpq/pg_config.linux.h b/ports/libpq/pg_config.linux.h new file mode 100644 index 000000000..d3758bb95 --- /dev/null +++ b/ports/libpq/pg_config.linux.h @@ -0,0 +1,173 @@ +#define ACCEPT_TYPE_ARG1 int +#define ACCEPT_TYPE_ARG2 struct sockaddr * +#define ACCEPT_TYPE_ARG3 socklen_t +#define ACCEPT_TYPE_RETURN int +#define ALIGNOF_DOUBLE 8 +#define ALIGNOF_INT 4 +#define ALIGNOF_LONG 8 +#define ALIGNOF_SHORT 2 +#define BLCKSZ 8192 +#define DEF_PGPORT 5432 +#define DEF_PGPORT_STR "5432" +#define ENABLE_THREAD_SAFETY 1 +#define FLEXIBLE_ARRAY_MEMBER /**/ +#define FLOAT4PASSBYVAL true +#define FLOAT8PASSBYVAL true +#ifdef GETTIMEOFDAY_1ARG +# define gettimeofday(a,b) gettimeofday(a) +#endif +#define HAVE_ATOMICS 1 +#define HAVE_CBRT 1 +#define HAVE_CRYPT 1 +#define HAVE_CRYPT_H 1 +#define HAVE_DECL_FDATASYNC 1 +#define HAVE_DECL_F_FULLFSYNC 0 +#define HAVE_DECL_POSIX_FADVISE 1 +#define HAVE_DECL_SNPRINTF 1 +#define HAVE_DECL_STRLCAT 0 +#define HAVE_DECL_STRLCPY 0 +#define HAVE_DECL_SYS_SIGLIST 1 +#define HAVE_DECL_VSNPRINTF 1 +#define HAVE_DLOPEN 1 +#define HAVE_FDATASYNC 1 +#define HAVE_FSEEKO 1 +#define HAVE_FUNCNAME__FUNC 1 +#define HAVE_GCC__ATOMIC_INT32_CAS 1 +#define HAVE_GCC__ATOMIC_INT64_CAS 1 +#define HAVE_GCC__SYNC_CHAR_TAS 1 +#define HAVE_GCC__SYNC_INT32_CAS 1 +#define HAVE_GCC__SYNC_INT32_TAS 1 +#define HAVE_GCC__SYNC_INT64_CAS 1 +#define HAVE_GETADDRINFO 1 +#define HAVE_GETHOSTBYNAME_R 1 +#define HAVE_GETIFADDRS 1 +#define HAVE_GETOPT 1 +#define HAVE_GETOPT_H 1 +#define HAVE_GETOPT_LONG 1 +#define HAVE_GETPWUID_R 1 +#define HAVE_GETRLIMIT 1 +#define HAVE_GETRUSAGE 1 +#define HAVE_IFADDRS_H 1 +#define HAVE_INET_ATON 1 +#define HAVE_INTPTR_T 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_INT_OPTERR 1 +#define HAVE_INT_TIMEZONE 1 +#define HAVE_IPV6 1 +#define HAVE_ISINF 1 +#define HAVE_LANGINFO_H 1 +#define HAVE_LIBM 1 +#define HAVE_LIBZ 1 +#define HAVE_LOCALE_T 1 +#define HAVE_LONG_INT_64 1 +#define HAVE_LONG_LONG_INT 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMORY_H 1 +#define HAVE_MKDTEMP 1 +#define HAVE_NETINET_IN_H 1 +#define HAVE_NETINET_TCP_H 1 +#define HAVE_NET_IF_H 1 +#define HAVE_POLL 1 +#define HAVE_POLL_H 1 +#define HAVE_POSIX_FADVISE 1 +#define HAVE_PTHREAD 1 +#define HAVE_PTHREAD_PRIO_INHERIT 1 +#define HAVE_PWD_H 1 +#define HAVE_RANDOM 1 +#define HAVE_READLINK 1 +#define HAVE_RINT 1 +#define HAVE_SETSID 1 +#define HAVE_SHM_OPEN 1 +#define HAVE_SNPRINTF 1 +#define HAVE_SPINLOCKS 1 +#define HAVE_SRANDOM 1 +#define HAVE_SSL_GET_CURRENT_COMPRESSION 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRERROR 1 +#define HAVE_STRERROR_R 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRUCT_ADDRINFO 1 +#define HAVE_STRUCT_OPTION 1 +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 +#define HAVE_STRUCT_TM_TM_ZONE 1 +#define HAVE_SYMLINK 1 +#define HAVE_SYNC_FILE_RANGE 1 +#define HAVE_SYSLOG 1 +#define HAVE_SYS_EPOLL_H 1 +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_IPC_H 1 +#define HAVE_SYS_POLL_H 1 +#define HAVE_SYS_RESOURCE_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_SEM_H 1 +#define HAVE_SYS_SHM_H 1 +#define HAVE_SYS_SOCKET_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_UN_H 1 +#define HAVE_TERMIOS_H 1 +#define HAVE_TM_ZONE 1 +#define HAVE_TOWLOWER 1 +#define HAVE_TZNAME 1 +#define HAVE_UINTPTR_T 1 +#define HAVE_UNISTD_H 1 +#define HAVE_UNIX_SOCKETS 1 +#define HAVE_UNSETENV 1 +#define HAVE_UNSIGNED_LONG_LONG_INT 1 +#define HAVE_UTIME 1 +#define HAVE_UTIMES 1 +#define HAVE_UTIME_H 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_WCHAR_H 1 +#define HAVE_WCSTOMBS 1 +#define HAVE_WCTYPE_H 1 +#define HAVE__BUILTIN_BSWAP32 1 +#define HAVE__BUILTIN_BSWAP64 1 +#define HAVE__BUILTIN_CONSTANT_P 1 +#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1 +#define HAVE__BUILTIN_UNREACHABLE 1 +#define HAVE__GET_CPUID 1 +#define HAVE__STATIC_ASSERT 1 +#define HAVE__VA_ARGS 1 +#define INT64_MODIFIER "l" +#define MAXIMUM_ALIGNOF 8 +#define MEMSET_LOOP_LIMIT 1024 +#define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org" +#define PACKAGE_NAME "PostgreSQL" +#define PACKAGE_STRING "PostgreSQL 9.6.3" +#define PACKAGE_TARNAME "postgresql" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "9.6.3" +#define PG_INT128_TYPE __int128 +#define PG_INT64_TYPE long int +#define PG_KRB_SRVNAM "postgres" +#define PG_MAJORVERSION "9.6" +#define PG_PRINTF_ATTRIBUTE gnu_printf +#define PG_VERSION "9.6.3" +#define PG_VERSION_NUM 90603 +#define PG_VERSION_STR "PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904, 64-bit" +#define RELSEG_SIZE 131072 +#define SIZEOF_LONG 8 +#define SIZEOF_OFF_T 8 +#define SIZEOF_SIZE_T 8 +#define SIZEOF_VOID_P 8 +#define STDC_HEADERS 1 +#define USE_FLOAT4_BYVAL 1 +#define USE_FLOAT8_BYVAL 1 +#define USE_INTEGER_DATETIMES 1 +#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1 +#define USE_SYSV_SEMAPHORES 1 +#define USE_SYSV_SHARED_MEMORY 1 +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#endif +#define XLOG_BLCKSZ 8192 +#define XLOG_SEG_SIZE (16 * 1024 * 1024) diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 2d14204fa..7b23aed32 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -12,7 +12,10 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS_DEBUG -DINSTALL_INCLUDES=OFF + OPTIONS + "-DPORT_DIR=${CMAKE_CURRENT_LIST_DIR}" + OPTIONS_DEBUG + -DINSTALL_INCLUDES=OFF ) vcpkg_install_cmake() diff --git a/ports/qt5-base/configure_qt.cmake b/ports/qt5-base/configure_qt.cmake index 1d4f1e570..356361a9b 100644 --- a/ports/qt5-base/configure_qt.cmake +++ b/ports/qt5-base/configure_qt.cmake @@ -1,12 +1,8 @@ function(configure_qt) cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) - if (_csc_PLATFORM) - set(PLATFORM ${_csc_PLATFORM}) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") - set(PLATFORM "win32-msvc2015") - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(PLATFORM "win32-msvc2017") + if(NOT _csc_PLATFORM) + message(FATAL_ERROR "configure_qt requires a PLATFORM argument.") endif() vcpkg_find_acquire_program(PERL) @@ -15,17 +11,24 @@ function(configure_qt) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) - list(APPEND _csc_OPTIONS - "-static" - "-static-runtime" - ) + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS "-static") + endif() + + if(VCPKG_CRT_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS "-static-runtime") + endif() + + if(CMAKE_HOST_WIN32) + set(CONFIGURE_BAT "configure.bat") + else() + set(CONFIGURE_BAT "configure") endif() message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( - COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + COMMAND "${_csc_SOURCE_PATH}/${CONFIGURE_BAT}" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} -debug -prefix ${CURRENT_PACKAGES_DIR}/debug -hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 @@ -36,7 +39,7 @@ function(configure_qt) -headerdir ${CURRENT_PACKAGES_DIR}/include -I ${CURRENT_INSTALLED_DIR}/include -L ${CURRENT_INSTALLED_DIR}/debug/lib - -platform ${PLATFORM} + -platform ${_csc_PLATFORM} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME config-${TARGET_TRIPLET}-dbg ) @@ -45,7 +48,7 @@ function(configure_qt) message(STATUS "Configuring ${TARGET_TRIPLET}-rel") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + COMMAND "${_csc_SOURCE_PATH}/${CONFIGURE_BAT}" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} -release -prefix ${CURRENT_PACKAGES_DIR} -hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5 @@ -55,7 +58,7 @@ function(configure_qt) -qmldir ${CURRENT_PACKAGES_DIR}/qml -I ${CURRENT_INSTALLED_DIR}/include -L ${CURRENT_INSTALLED_DIR}/lib - -platform ${PLATFORM} + -platform ${_csc_PLATFORM} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) diff --git a/ports/qt5-base/install_qt.cmake b/ports/qt5-base/install_qt.cmake index 37528e4e6..482802f38 100644 --- a/ports/qt5-base/install_qt.cmake +++ b/ports/qt5-base/install_qt.cmake @@ -2,12 +2,27 @@ function(install_qt) cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) if (_bc_DISABLE_PARALLEL) - set(JOBS "1") + set(NUMBER_OF_PROCESSORS "1") else() - set(JOBS "$ENV{NUMBER_OF_PROCESSORS}") + if(DEFINED ENV{NUMBER_OF_PROCESSORS}) + set(NUMBER_OF_PROCESSORS $ENV{NUMBER_OF_PROCESSORS}) + else() + execute_process( + COMMAND nproc + OUTPUT_VARIABLE NUMBER_OF_PROCESSORS + ) + string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") + string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") + endif() endif() - vcpkg_find_acquire_program(JOM) + if(CMAKE_HOST_WIN32) + vcpkg_find_acquire_program(JOM) + set(INVOKE "${JOM}" /J ${NUMBER_OF_PROCESSORS}) + else() + find_program(MAKE make) + set(INVOKE "${MAKE}" -j${NUMBER_OF_PROCESSORS}) + endif() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") @@ -16,12 +31,12 @@ function(install_qt) message(STATUS "Package ${TARGET_TRIPLET}-dbg") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} + COMMAND ${INVOKE} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install + COMMAND ${INVOKE} install WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) @@ -30,12 +45,12 @@ function(install_qt) message(STATUS "Package ${TARGET_TRIPLET}-rel") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} + COMMAND ${INVOKE} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install + COMMAND ${INVOKE} install WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 9e9d7779a..39498b4a3 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -1,13 +1,13 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) +if(BUILDTREES_PATH_LENGTH GREATER 37 AND CMAKE_HOST_WIN32) message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." ) endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) +if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_LIBRARY_LINKAGE STREQUAL static) message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") endif() @@ -30,58 +30,108 @@ if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) endif() +# Remove vendored dependencies to ensure they are not picked up by the build +foreach(DEPENDENCY freetype zlib harfbuzzng libjpeg libpng double-conversion) + if(EXISTS ${SOURCE_PATH}/src/3rdparty/${DEPENDENCY}) + file(REMOVE_RECURSE ${SOURCE_PATH}/src/3rdparty/${DEPENDENCY}) + endif() +endforeach() + +file(REMOVE_RECURSE ${SOURCE_PATH}/include/QtZlib) + vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES - "${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch" +# "${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch" "${CMAKE_CURRENT_LIST_DIR}/fix-system-freetype.patch" ) # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings set(ENV{_CL_} "/utf-8") -configure_qt( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -confirm-license - -opensource - -system-zlib - -system-libjpeg - -system-libpng - -system-freetype - -system-pcre - -system-harfbuzz - -system-doubleconversion - -system-sqlite - -no-fontconfig - -sql-sqlite - -sql-psql - -nomake examples -nomake tests - -opengl desktop # other options are "-no-opengl" and "-opengl angle" - -mp - LIBJPEG_LIBS="-ljpeg" - OPTIONS_RELEASE - ZLIB_LIBS="-lzlib" - LIBPNG_LIBS="-llibpng16" - FREETYPE_LIBS="-lfreetype" - OPTIONS_DEBUG - ZLIB_LIBS="-lzlibd" - LIBPNG_LIBS="-llibpng16d" - PSQL_LIBS="-llibpqd" - FREETYPE_LIBS="-lfreetyped" +set(CORE_OPTIONS + -confirm-license + -opensource + -system-zlib + -system-libjpeg + -system-libpng + -system-freetype + -system-pcre + -system-harfbuzz + -system-doubleconversion + -no-fontconfig + -nomake examples -nomake tests ) +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + if(VCPKG_PLATFORM_TOOLSET MATCHES "v140") + set(PLATFORM "win32-msvc2015") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(PLATFORM "win32-msvc2017") + endif() + configure_qt( + SOURCE_PATH ${SOURCE_PATH} + PLATFORM ${PLATFORM} + OPTIONS + ${CORE_OPTIONS} + -sql-sqlite + -sql-psql + -system-sqlite + -mp + -opengl desktop # other options are "-no-opengl", "-opengl angle", and "-opengl desktop" + LIBJPEG_LIBS="-ljpeg" + OPTIONS_RELEASE + ZLIB_LIBS="-lzlib" + LIBPNG_LIBS="-llibpng16" + FREETYPE_LIBS="-lfreetype" + OPTIONS_DEBUG + ZLIB_LIBS="-lzlibd" + LIBPNG_LIBS="-llibpng16d" + PSQL_LIBS="-llibpqd" + FREETYPE_LIBS="-lfreetyped" + ) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + configure_qt( + SOURCE_PATH ${SOURCE_PATH} + PLATFORM "linux-g++" + OPTIONS + ${CORE_OPTIONS} + -no-sqlite + -no-opengl # other options are "-no-opengl", "-opengl angle", and "-opengl desktop" + LIBJPEG_LIBS="-ljpeg" + OPTIONS_RELEASE + "QMAKE_LIBS_PRIVATE+=${CURRENT_INSTALLED_DIR}/lib/libpng16.a" + "QMAKE_LIBS_PRIVATE+=${CURRENT_INSTALLED_DIR}/lib/libz.a" + "ZLIB_LIBS=${CURRENT_INSTALLED_DIR}/lib/libz.a" + "LIBPNG_LIBS=${CURRENT_INSTALLED_DIR}/lib/libpng16.a" + "FREETYPE_LIBS=${CURRENT_INSTALLED_DIR}/lib/libfreetype.a" + "PSQL_LIBS=${CURRENT_INSTALLED_DIR}/lib/libpq.a ${CURRENT_INSTALLED_DIR}/lib/libssl.a ${CURRENT_INSTALLED_DIR}/lib/libcrypto.a" + OPTIONS_DEBUG + "QMAKE_LIBS_PRIVATE+=${CURRENT_INSTALLED_DIR}/debug/lib/libpng16d.a" + "QMAKE_LIBS_PRIVATE+=${CURRENT_INSTALLED_DIR}/debug/lib/libz.a" + "ZLIB_LIBS=${CURRENT_INSTALLED_DIR}/debug/lib/libz.a" + "LIBPNG_LIBS=${CURRENT_INSTALLED_DIR}/debug/lib/libpng16d.a" + "FREETYPE_LIBS=${CURRENT_INSTALLED_DIR}/debug/lib/libfreetyped.a" + "PSQL_LIBS=${CURRENT_INSTALLED_DIR}/debug/lib/libpqd.a ${CURRENT_INSTALLED_DIR}/debug/lib/libssl.a ${CURRENT_INSTALLED_DIR}/debug/lib/libcrypto.a" + ) +endif() + install_qt() file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*") +list(FILTER BINARY_TOOLS EXCLUDE REGEX "\\.dll\$") file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) file(REMOVE ${BINARY_TOOLS}) -file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") +file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*") +list(FILTER BINARY_TOOLS EXCLUDE REGEX "\\.dll\$") file(REMOVE ${BINARY_TOOLS}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) @@ -94,25 +144,27 @@ vcpkg_execute_required_process( vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) -#--------------------------------------------------------------------------- -# qtmain(d) vs. Qt5AxServer(d) -#--------------------------------------------------------------------------- -# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), -# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. -# -# Create manual-link folders: -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -# -# Either have users explicitly link against qtmain.lib, qtmaind.lib: -file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) +if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) + #--------------------------------------------------------------------------- + # qtmain(d) vs. Qt5AxServer(d) + #--------------------------------------------------------------------------- + # Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), + # never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. + # + # Create manual-link folders: + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + # + # Either have users explicitly link against qtmain.lib, qtmaind.lib: + file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) + file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) +endif() file(COPY ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/plugins) file(COPY ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/plugins)