aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-02-23 23:06:50 +0300
committerlink2xt <link2xt@testrun.org>2021-02-24 00:34:33 +0300
commita320ff2ae7cd38045113218d83fbdfd19c0a64b1 (patch)
treed46b72090c3a40b257e1239b0abe05257eb091a6 /CMakeLists.txt
parent93abc90557131ed1679a78f91be92cbfcc38f91f (diff)
downloadkdeltachat-a320ff2ae7cd38045113218d83fbdfd19c0a64b1.tar.gz
kdeltachat-a320ff2ae7cd38045113218d83fbdfd19c0a64b1.zip
Do not build libdeltachat as ExternalProject
deltachat-core-rust has CMakeLists.txt now and can be used as a module within `kdesrc-build`. The recommended way for building KDeltaChat is using `kdesrc-build` now, README is updated accordingly.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 3 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e380217..7585475 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,19 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Widgets Quick REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Widgets Quick REQUIRED)
-
-include(ExternalProject)
-ExternalProject_Add(
- deltachat-core-rust
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/../deltachat-core-rust"
- BUILD_IN_SOURCE 1
- BUILD_COMMAND env PREFIX=<INSTALL_DIR> cargo build -p deltachat_ffi -j 1
- BUILD_ALWAYS 1
- BUILD_BYPRODUCTS <SOURCE_DIR>/target/debug/libdeltachat.a
- CONFIGURE_COMMAND ""
- INSTALL_COMMAND cp <SOURCE_DIR>/target/debug/libdeltachat.a <INSTALL_DIR>/libdeltachat.a
- COMMAND cp <SOURCE_DIR>/deltachat-ffi/deltachat.h <INSTALL_DIR>/deltachat.h
-)
+find_package(PkgConfig REQUIRED)
add_executable(kdeltachat
main.cpp
@@ -41,9 +29,9 @@ add_executable(kdeltachat
qml.qrc
)
-add_dependencies(kdeltachat deltachat-core-rust)
find_package(Threads REQUIRED)
find_package(KF5Kirigami2)
+pkg_check_modules(DeltaChat IMPORTED_TARGET deltachat)
target_compile_definitions(kdeltachat
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
@@ -51,7 +39,5 @@ target_link_libraries(kdeltachat
PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Widgets
PRIVATE Threads::Threads
PRIVATE KF5::Kirigami2
- PRIVATE "${CMAKE_BINARY_DIR}/deltachat-core-rust-prefix/libdeltachat.a"
+ PRIVATE PkgConfig::DeltaChat
m dl)
-target_include_directories(kdeltachat
- PRIVATE "${CMAKE_BINARY_DIR}/deltachat-core-rust-prefix/")