diff --git a/CMakeLists.txt b/CMakeLists.txt index a9e9be5..12fb32b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,10 +66,15 @@ list(APPEND NKR_EXTERNAL_TARGETS yaml-cpp) find_package(ZXing CONFIG REQUIRED) list(APPEND NKR_EXTERNAL_TARGETS ZXing::ZXing) -include(FetchContent) -FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git - GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases -FetchContent_MakeAvailable(cpr) +IF (WIN32) + include(FetchContent) + FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git + GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) + FetchContent_MakeAvailable(cpr) +ELSE() + find_package(cpr REQUIRED) +ENDIF() + list(APPEND NKR_EXTERNAL_TARGETS cpr::cpr) set(QHOTKEY_INSTALL OFF) diff --git a/libs/build_deps_all.sh b/libs/build_deps_all.sh index 86c4b1f..b26a0f7 100755 --- a/libs/build_deps_all.sh +++ b/libs/build_deps_all.sh @@ -24,7 +24,7 @@ mkdir -p $INSTALL_PREFIX #### clean #### clean() { - rm -rf dl.zip yaml-* zxing-* protobuf + rm -rf dl.zip yaml-* zxing-* protobuf curl cpr } #### ZXing v2.2.0 #### @@ -71,5 +71,30 @@ ninja && ninja install cd ../.. +system_name=$(uname -s) + +# Check if 'NT' is present in the system name +if [[ "$system_name" == *"NT"* ]]; then + echo "System is likely Windows" +else + git clone https://github.com/curl/curl.git + cd curl + git checkout 83bedbd730d62b83744cc26fa0433d3f6e2e4cd6 + mkdir build && cd build + cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX + ninja && ninja install + + cd ../.. + + git clone https://github.com/libcpr/cpr.git + cd cpr + git checkout 3b15fa82ea74739b574d705fea44959b58142eb8 + mkdir build && cd build + cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DCPR_USE_SYSTEM_CURL=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX + ninja && ninja install + + cd ../.. +fi + #### clean diff --git a/libs/deploy_linux64.sh b/libs/deploy_linux64.sh index 629e292..a1dd803 100755 --- a/libs/deploy_linux64.sh +++ b/libs/deploy_linux64.sh @@ -34,10 +34,3 @@ export EXTRA_QT_PLUGINS="svg;iconengines;" rm linuxdeploy-x86_64.AppImage linuxdeploy-plugin-qt-x86_64.AppImage cd $DEST rm -r ./usr/translations ./usr/bin ./usr/share ./apprun-hooks - -# fix extra libs... -mkdir ./usr/lib2 -ls ./usr/lib/ -cp ./usr/lib/libQt* ./usr/lib/libxcb-util* ./usr/lib/libicuuc* ./usr/lib/libicui18n* ./usr/lib/libicudata* ./usr/lib/libcpr* ./usr/lib2 -rm -r ./usr/lib -mv ./usr/lib2 ./usr/lib