evmc/CMakeLists.txt

58 lines
1.5 KiB
CMake
Raw Normal View History

2018-04-12 09:01:01 +00:00
# EVMC -- Ethereum Client-VM Connector API
# Copyright 2018 Pawel Bylica.
# Licensed under the MIT License. See the LICENSE file.
2018-03-28 13:19:41 +00:00
cmake_minimum_required(VERSION 3.5)
if(TARGET evmc)
# The evmc library has been already created (probably by other submodule).
return()
endif()
2018-04-12 09:01:01 +00:00
include(cmake/cable/bootstrap.cmake)
include(CableCompilerSettings)
2018-04-12 09:01:01 +00:00
include(HunterGate)
2018-04-18 14:23:07 +00:00
include(GNUInstallDirs)
2018-04-12 09:01:01 +00:00
include(defaults/HunterCacheServers)
# Setup Hunter.
# Hunter is going to be initialized only if building with tests,
# where it is needed to get dependencies.
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.20.37.tar.gz"
SHA1 "51886d10428c924cc21756abc17623bcf4986386"
)
2018-03-28 13:19:41 +00:00
project(evmc)
2018-04-18 14:32:10 +00:00
set(PROJECT_VERSION "0.1.0.dev0")
2018-03-28 13:19:41 +00:00
cable_configure_compiler()
2018-03-28 13:19:41 +00:00
add_library(evmc INTERFACE)
target_include_directories(evmc INTERFACE include)
2018-04-18 14:23:07 +00:00
install(DIRECTORY include/evmc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
2018-04-12 09:01:24 +00:00
option(EVMC_BUILD_TESTS "Build EVMC tests and test tools" OFF)
if(EVMC_BUILD_TESTS)
2018-04-11 15:36:54 +00:00
enable_testing()
2018-04-12 09:01:24 +00:00
add_subdirectory(test)
endif()
option(EVMC_BUILD_EXAMPLES "Build EVMC examples" OFF)
2018-03-28 13:19:41 +00:00
if(EVMC_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
2018-04-18 14:32:24 +00:00
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)