2018-05-09 08:47:21 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
include(ExternalProject)
|
|
|
|
|
2018-08-02 23:18:49 +02:00
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/../../parity-clib")
|
2018-05-09 08:47:21 +02:00
|
|
|
|
|
|
|
add_executable(parity-example main.cpp)
|
|
|
|
|
|
|
|
ExternalProject_Add(
|
|
|
|
libparity
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
COMMAND cargo build -p parity-clib # Note: use --release in a real project
|
2018-08-02 23:18:49 +02:00
|
|
|
BINARY_DIR "${CMAKE_SOURCE_DIR}/../../target"
|
2018-05-09 08:47:21 +02:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
LOG_BUILD ON)
|
|
|
|
|
|
|
|
add_dependencies(parity-example libparity)
|
2018-08-02 23:18:49 +02:00
|
|
|
target_link_libraries(parity-example "${CMAKE_SOURCE_DIR}/../../target/debug/libparity.so")
|