macos CMake defaults for local arch, SDK and brew-Qt

The universal binary with older SDK and aqt-Qt will be
built by the release/build-mac.sh script
This commit is contained in:
Christian Hohnstaedt 2023-05-25 13:39:07 +02:00
parent 3e284b1245
commit 780225198d
5 changed files with 20 additions and 24 deletions

View File

@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.16.0)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "")
project(xca
DESCRIPTION "X Certificate and Key management"
HOMEPAGE_URL http://xca.hohnstaedt.de
@ -82,12 +80,6 @@ set(QT Qt${QT_VERSION_MAJOR})
find_package(${QT} REQUIRED COMPONENTS Core Widgets Sql Help LinguistTools)
message(STATUS "Using ${QT} with version ${QT_VERSION}")
if (${QT_VERSION} VERSION_LESS 6.5.0)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET 11)
endif()
get_target_property(qmake_executable ${QT}::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${qmake_executable}" DIRECTORY)

View File

@ -1,7 +1,7 @@
# This installation is for building macos 10.13 compatible releases including
# database drivers. IOW: For me
brew install python3 cmake
brew install python3 cmake pkg-config
# Compile SQL Drivers if necessary:
@ -14,11 +14,15 @@ brew install mariadb-connector-c postgresql unixodbc
MYSQL_LIBDIR=$(pkg-config --variable=prefix libmariadb)/lib/mariadb \
MYSQL_INCDIR=$(pkg-config --variable=prefix libmariadb)/include/mariadb/ \
MYSQL_LIBS="-lmariadb" \
PSQL_PREFIX=$(brew --cellar postgresql)/12.4/ \
PSQL_PREFIX=$(brew --prefix)/opt/postgresql@14 \
ODBC_PREFIX=$(pkg-config --variable=prefix odbc)
make sub-plugins
https://github.com/PostgresApp/PostgresApp/releases/download/v2.6.2/Postgres-2.6.2-14.dmg
# Compile OpenSSL
#! /bin/sh

View File

@ -79,9 +79,9 @@ XCA can be used with Xcode after initializing the directory with:
- Install Qt, cmake and the MinGW toolchain
```
aqt install-qt windows desktop 5.15.2 win64_mingw81
aqt install-tool windows desktop tools\_cmake qt.tools.cmake.win64
aqt install-tool windows desktop tools\_mingw qt.tools.win64\_mingw810
aqt install-tool windows desktop tools\_vcredist qt.tools.vcredist_64
aqt install-tool windows desktop tools_cmake qt.tools.cmake.win64
aqt install-tool windows desktop tools_mingw qt.tools.win64\_mingw810
aqt install-tool windows desktop tools_vcredist qt.tools.vcredist_64
```
- If 7z is missing, install it from the store. `7-Zip File Manager (unofficial)` or from 7-zip.org
- Add cmake, MinGW, OpenSSL and Qt5 to your Path
@ -106,4 +106,4 @@ XCA can be used with Xcode after initializing the directory with:
- Configure: `cmake -B build -G "MinGW Makefiles" xca`
- Make: `cmake --build build -j5`
- Create the Portable App: `cmake --build build -t install`
- Build the MSI installer (and the Portable App): `cd build && cpack`
- Build the MSI installer (and the Portable App): `cd build ; cpack`

View File

@ -14,30 +14,31 @@ do_openssl()
-mmacosx-version-min="$SDK"
make -j $JOBS build_libs && make install_sw
)
PARTS_crypto="$PARTS_crypto ${OSSL}-${arch}/libcrypto.3.dylib"
PARTS_ssl="$PARTS_ssl ${OSSL}-${arch}/libssl.3.dylib"
PARTS_crypto="$PARTS_crypto ${OSSL}-${arch}/libcrypto.${OSSL_MAJOR}.dylib"
PARTS_ssl="$PARTS_ssl ${OSSL}-${arch}/libssl.${OSSL_MAJOR}.dylib"
done
rm -f "$INSTALL"/lib/libcrypto.3.dylib "$INSTALL"/lib/libssl.3.dylib
lipo -create -output "$INSTALL_DIR"/lib/libcrypto.3.dylib $PARTS_crypto
lipo -create -output "$INSTALL_DIR"/lib/libssl.3.dylib $PARTS_ssl
rm -f "$INSTALL"/lib/libcrypto.3.dylib "$INSTALL"/lib/libssl.${OSSL_MAJOR}.dylib
lipo -create -output "$INSTALL_DIR"/lib/libcrypto.${OSSL_MAJOR}.dylib $PARTS_crypto
lipo -create -output "$INSTALL_DIR"/lib/libssl.${OSSL_MAJOR}.dylib $PARTS_ssl
}
OSSL="openssl-3.0.8"
OSSL_MAJOR="1.1"
OSSL="openssl-1.1.1t"
XCA_DIR="$(cd `dirname $0`/.. && pwd)"
TOP_DIR="`dirname $XCA_DIR`"
BUILDDIR="$TOP_DIR/osx-release"
INSTALL_DIR="$TOP_DIR/install"
SDK="10.14"
SDK="11"
JOBS=7
test -x $INSTALL_DIR/lib/libcrypto.dylib || (cd $TOP_DIR && do_openssl )
cmake -B "$BUILDDIR" "$XCA_DIR" \
-DOPENSSL_ROOT_DIR="$INSTALL_DIR" \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_PREFIX_PATH="$TOP_DIR/6.5.0/macos/lib/cmake"
-DCMAKE_PREFIX_PATH="$TOP_DIR/6.5.0/macos/lib/cmake;$INSTALL_DIR" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$SDK
cmake --build "$BUILDDIR" -j$JOBS

View File

@ -72,7 +72,6 @@ void xcaWarningGui::error(const QString &msg)
box.addButton(QMessageBox::Apply, tr("Copy to Clipboard"));
box.addButton(QMessageBox::Ok);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && defined(Q_OS_MAC))
#warning MAC_650
box.show();
QCoreApplication::processEvents(QEventLoop::AllEvents);
#else