2018-05-09 08:47:21 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
include(ExternalProject)
|
2019-01-02 16:49:01 +01:00
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/../..")
|
2019-04-12 18:51:01 +02:00
|
|
|
set (CMAKE_CXX_STANDARD 11) # Enforce C++11
|
2018-05-09 08:47:21 +02:00
|
|
|
add_executable(parity-example main.cpp)
|
|
|
|
|
|
|
|
ExternalProject_Add(
|
|
|
|
libparity
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
BUILD_COMMAND ""
|
2019-04-12 18:51:01 +02:00
|
|
|
COMMAND cargo build -p parity-clib --verbose --color=always # Note: use --release in a real project
|
2018-12-28 10:33:49 +01: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)
|
2019-02-08 10:01:29 +01:00
|
|
|
target_link_libraries(parity-example "${CMAKE_SOURCE_DIR}/../../../target/debug/${CMAKE_SHARED_LIBRARY_PREFIX}parity${CMAKE_SHARED_LIBRARY_SUFFIX}")
|