Don't download dependencies during build

fixes #346
remotes/origin/HEAD
Konstantinos Sideris 6 years ago
parent 6c5309d9eb
commit 3bc8d791fb
  1. 6
      .ci/script.sh
  2. 30
      CMakeLists.txt
  3. 2
      appveyor.yml
  4. 23
      cmake/LMDBXX.cmake
  5. 23
      cmake/Tweeny.cmake
  6. 20
      deps/CMakeLists.txt
  7. 22
      deps/cmake/Tweeny.cmake
  8. 2
      src/timeline/TimelineView.cc
  9. 2
      src/ui/SnackBar.cc

@ -11,13 +11,15 @@ if [ $TRAVIS_OS_NAME == osx ]; then
fi fi
# Build & install dependencies # Build & install dependencies
cmake -Hdeps -B.deps \ cmake -GNinja -Hdeps -B.deps \
-DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \ -DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \
-DUSE_BUNDLED_SPDLOG=${USE_BUNDLED_SPDLOG} -DUSE_BUNDLED_SPDLOG=${USE_BUNDLED_SPDLOG}
cmake --build .deps cmake --build .deps
# Build nheko # Build nheko
cmake -GNinja -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake -GNinja -H. -Bbuild \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=.deps/usr
cmake --build build cmake --build build
if [ $TRAVIS_OS_NAME == osx ]; then if [ $TRAVIS_OS_NAME == osx ]; then

@ -226,23 +226,25 @@ find_package(MatrixClient 0.1.0 REQUIRED)
find_package(Olm 2 REQUIRED) find_package(Olm 2 REQUIRED)
find_package(spdlog 0.16.0 CONFIG REQUIRED) find_package(spdlog 0.16.0 CONFIG REQUIRED)
# if(NOT LMDBXX_INCLUDE_DIR)
# tweeny find_path(LMDBXX_INCLUDE_DIR
# NAMES lmdb++.h
if(NOT TWEENY_INCLUDE_DIR) PATHS /usr/include
include(Tweeny) /usr/local/include
set(EXTERNAL_PROJECT_DEPS ${EXTERNAL_PROJECT_DEPS} Tweeny) $ENV{LIB_DIR}/include
$ENV{LIB_DIR}/include/lmdbxx)
endif() endif()
include_directories(SYSTEM ${TWEENY_INCLUDE_DIR}) include_directories(${LMDBXX_INCLUDE_DIR})
# if(NOT TWEENY_INCLUDE_DIR)
# lmdbxx find_path(TWEENY_INCLUDE_DIR
# NAMES tweeny/tweeny.h
if(NOT LMDBXX_INCLUDE_DIR) PATHS /usr/include/
include(LMDBXX) /usr/local/include/
set(EXTERNAL_PROJECT_DEPS ${EXTERNAL_PROJECT_DEPS} lmdbxx) $ENV{LIB_DIR}/include/
$ENV{LIB_DIR}/include/tweeny)
endif() endif()
include_directories(SYSTEM ${LMDBXX_INCLUDE_DIR}) include_directories(${TWEENY_INCLUDE_DIR})
include_directories(include) include_directories(include)
include_directories(include/ui) include_directories(include/ui)

@ -61,6 +61,8 @@ build_script:
# Build nheko # Build nheko
- cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild - cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild
-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
-DLMDBXX_INCLUDE_DIR=.deps/usr/include
-DTWEENY_INCLUDE_DIR=.deps/usr/include
- cmake --build build --config Release - cmake --build build --config Release
after_build: after_build:

@ -1,23 +0,0 @@
include(ExternalProject)
#
# Build lmdbxx.
#
set(THIRD_PARTY_ROOT ${CMAKE_SOURCE_DIR}/.third-party)
set(LMDBXX_ROOT ${THIRD_PARTY_ROOT}/lmdbxx)
set(LMDBXX_INCLUDE_DIR ${LMDBXX_ROOT})
ExternalProject_Add(
lmdbxx
GIT_REPOSITORY https://github.com/bendiken/lmdbxx
GIT_TAG 0b43ca87d8cfabba392dfe884eb1edb83874de02
BUILD_IN_SOURCE 1
SOURCE_DIR ${LMDBXX_ROOT}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)

@ -1,23 +0,0 @@
include(ExternalProject)
#
# Build tweeny
#
set(THIRD_PARTY_ROOT ${CMAKE_SOURCE_DIR}/.third-party)
set(TWEENY_ROOT ${THIRD_PARTY_ROOT}/tweeny)
set(TWEENY_INCLUDE_DIR ${TWEENY_ROOT}/include)
ExternalProject_Add(
Tweeny
GIT_REPOSITORY https://github.com/mobius3/tweeny
GIT_TAG b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf
BUILD_IN_SOURCE 1
SOURCE_DIR ${TWEENY_ROOT}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)

@ -24,6 +24,8 @@ option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_BOOST "Use the bundled version of Boost." ${USE_BUNDLED}) option(USE_BUNDLED_BOOST "Use the bundled version of Boost." ${USE_BUNDLED})
option(USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." ${USE_BUNDLED}) option(USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." ${USE_BUNDLED})
option(USE_BUNDLED_OLM "Use the bundled version of libolm." ${USE_BUNDLED}) option(USE_BUNDLED_OLM "Use the bundled version of libolm." ${USE_BUNDLED})
option(USE_BUNDLED_TWEENY "Use the bundled version of Tweeny." ${USE_BUNDLED})
option(USE_BUNDLED_LMDBXX "Use the bundled version of lmdbxx." ${USE_BUNDLED})
option(USE_BUNDLED_MATRIX_STRUCTS "Use the bundled version of matrix-structs." option(USE_BUNDLED_MATRIX_STRUCTS "Use the bundled version of matrix-structs."
${USE_BUNDLED}) ${USE_BUNDLED})
option(USE_BUNDLED_MATRIX_CLIENT "Use the bundled version of mtxclient." option(USE_BUNDLED_MATRIX_CLIENT "Use the bundled version of mtxclient."
@ -42,6 +44,15 @@ set(MATRIX_STRUCTS_TAG 3a052a95c555ce3ae12b8a2e0508e8bb73266fa1)
set(MTXCLIENT_URL https://github.com/mujx/mtxclient) set(MTXCLIENT_URL https://github.com/mujx/mtxclient)
set(MTXCLIENT_TAG 73491268f94ddeb606284836bb5f512d11b0e249) set(MTXCLIENT_TAG 73491268f94ddeb606284836bb5f512d11b0e249)
set(TWEENY_URL https://github.com/mobius3/tweeny)
set(TWEENY_TAG b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf)
set(
LMDBXX_HEADER_URL
https://raw.githubusercontent.com/bendiken/lmdbxx/0b43ca87d8cfabba392dfe884eb1edb83874de02/lmdb%2B%2B.h
)
set(LMDBXX_SHA c57b501a4e8fa1187fa7fd348da415c7685a50a7cb25b17b3f257b9e9426f73d)
set(OLM_URL https://git.matrix.org/git/olm.git) set(OLM_URL https://git.matrix.org/git/olm.git)
set(OLM_TAG 4065c8e11a33ba41133a086ed3de4da94dcb6bae) set(OLM_TAG 4065c8e11a33ba41133a086ed3de4da94dcb6bae)
@ -64,6 +75,15 @@ if(USE_BUNDLED_MATRIX_STRUCTS)
include(MatrixStructs) include(MatrixStructs)
endif() endif()
if(USE_BUNDLED_TWEENY)
include(Tweeny)
endif()
if(USE_BUNDLED_LMDBXX)
file(DOWNLOAD ${LMDBXX_HEADER_URL} ${DEPS_INSTALL_DIR}/include/lmdb++.h
EXPECTED_HASH SHA256=${LMDBXX_SHA})
endif()
if(WIN32) if(WIN32)
if("${TARGET_ARCH}" STREQUAL "X86_64") if("${TARGET_ARCH}" STREQUAL "X86_64")
set(TARGET_ARCH x64) set(TARGET_ARCH x64)

@ -0,0 +1,22 @@
set(WINDOWS_FLAGS "")
if(MSVC)
set(WINDOWS_FLAGS "-DCMAKE_GENERATOR_PLATFORM=x64")
endif()
ExternalProject_Add(
Tweeny
GIT_REPOSITORY ${TWEENY_URL}
GIT_TAG ${TWEENY_TAG}
BUILD_IN_SOURCE 1
SOURCE_DIR ${DEPS_BUILD_DIR}/tweeny
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DTWEENY_BUILD_EXAMPLES=OFF
-DTWEENY_BUILD_DOCUMENTATION=OFF
${DEPS_BUILD_DIR}/tweeny
${WINDOWS_FLAGS})
list(APPEND THIRD_PARTY_DEPS Tweeny)

@ -489,7 +489,7 @@ TimelineView::init()
scroll_widget_ = new QWidget(this); scroll_widget_ = new QWidget(this);
scroll_layout_ = new QVBoxLayout(scroll_widget_); scroll_layout_ = new QVBoxLayout(scroll_widget_);
scroll_layout_->setContentsMargins(15, 0, 15, 15); scroll_layout_->setContentsMargins(4, 0, 15, 15);
scroll_layout_->addStretch(1); scroll_layout_->addStretch(1);
scroll_layout_->setSpacing(0); scroll_layout_->setSpacing(0);
scroll_layout_->setObjectName("timelinescrollarea"); scroll_layout_->setObjectName("timelinescrollarea");

@ -1,7 +1,7 @@
#include <QDebug> #include <QDebug>
#include <QPainter> #include <QPainter>
#include <tweeny.h> #include <tweeny/tweeny.h>
#include "SnackBar.h" #include "SnackBar.h"

Loading…
Cancel
Save