Merge pull request #25 from ethereum/cmake-install

CMake install
This commit is contained in:
Paweł Bylica 2018-04-19 12:49:22 +02:00 committed by GitHub
commit a739fb9add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 10 deletions

View File

@ -12,6 +12,7 @@ endif()
include(cmake/cable/bootstrap.cmake)
include(CableCompilerSettings)
include(HunterGate)
include(GNUInstallDirs)
include(defaults/HunterCacheServers)
# Setup Hunter.
@ -23,12 +24,15 @@ HunterGate(
)
project(evmc)
set(PROJECT_VERSION "0.1.0.dev0")
cable_configure_compiler()
add_library(evmc INTERFACE)
target_include_directories(evmc INTERFACE include)
install(DIRECTORY include/evmc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
option(EVMC_BUILD_TESTS "Build EVMC tests and test tools" OFF)
if(EVMC_BUILD_TESTS)
enable_testing()
@ -39,3 +43,15 @@ option(EVMC_BUILD_EXAMPLES "Build EVMC examples" OFF)
if(EVMC_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(WIN32)
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_GENERATOR TGZ)
endif()
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name)
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}-${system_name})
set(CPACK_PACKAGE_CHECKSUM SHA256)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE)
include(CPack)

View File

@ -99,7 +99,7 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = include/evmc.h
INPUT = include/evmc/evmc.h
INPUT_ENCODING = UTF-8
FILE_PATTERNS =
RECURSIVE = NO

View File

@ -19,6 +19,15 @@ jobs:
- run:
name: "Install"
command: cmake --build ~/build --target install
- run:
name: "Package"
command: |
cmake --build ~/build --target package
mkdir ~/package
mv ~/build/evmc-*.tar.gz ~/package
- store_artifacts:
path: ~/package
destination: package
- run:
name: "Run evmc-vmtester libevmc-examplevm.so"
command: ~/install/bin/evmc-vmtester ~/install/lib/libevmc-examplevm.so

View File

@ -1,4 +1,4 @@
#include <evmc.h>
#include <evmc/evmc.h>
#include <inttypes.h>
#include <string.h>

View File

@ -5,7 +5,7 @@
#pragma once
#include <evmc.h>
#include <evmc/evmc.h>
/**
* Creates EVMC Example VM.

View File

@ -1,13 +1,9 @@
// EVMC -- Ethereum Client-VM Connector API
// EVMC: Ethereum Client-VM Connector API.
// Copyright 2018 Pawel Bylica.
// Licensed under the MIT License. See the LICENSE file.
#include "vmtester.hpp"
#include <evmc.h>
#include <gtest/gtest.h>
#include <boost/dll.hpp>
#include <boost/dll/alias.hpp>
#include <boost/function.hpp>

View File

@ -1,8 +1,11 @@
// EVMC -- Ethereum Client-VM Connector API
// EVMC: Ethereum Client-VM Connector API
// Copyright 2018 Pawel Bylica.
// Licensed under the MIT License. See the LICENSE file.
#include <evmc.h>
#pragma once
#include <evmc/evmc.h>
#include <gtest/gtest.h>
evmc_instance* get_vm_instance();