2018-04-23 21:22:39 +00:00
|
|
|
# EVMC: Ethereum Client-VM Connector API.
|
2019-04-24 14:12:13 +00:00
|
|
|
# Copyright 2016-2019 The EVMC Authors.
|
2019-01-18 12:49:54 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0.
|
2018-04-12 09:01:01 +00:00
|
|
|
|
2018-03-28 13:19:41 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2018-04-09 14:13:31 +00:00
|
|
|
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)
|
2018-06-19 09:25:19 +00:00
|
|
|
include(CableBuildType)
|
2018-04-11 12:56:14 +00:00
|
|
|
include(CableCompilerSettings)
|
2019-11-27 10:24:41 +00:00
|
|
|
include(CMakeDependentOption)
|
2019-08-12 09:24:01 +00:00
|
|
|
include(CablePackage)
|
2019-01-15 13:08:54 +00:00
|
|
|
include(CableToolchains)
|
2018-06-19 09:25:19 +00:00
|
|
|
include(CMakePackageConfigHelpers)
|
2018-04-18 14:23:07 +00:00
|
|
|
include(GNUInstallDirs)
|
2018-04-12 09:01:01 +00:00
|
|
|
|
2019-11-27 10:24:41 +00:00
|
|
|
option(EVMC_INSTALL "Enable EVMC installation (e.g. make install)" ON)
|
|
|
|
|
|
|
|
option(EVMC_TESTING "Build everything (libraries, tools, examples, internal tests)" OFF)
|
|
|
|
|
|
|
|
cmake_dependent_option(EVMC_TOOLS "Build EVMC tools" OFF
|
|
|
|
"NOT EVMC_TESTING" ON)
|
|
|
|
|
2019-11-27 10:39:16 +00:00
|
|
|
cmake_dependent_option(EVMC_EXAMPLES "Build EVMC examples" OFF
|
|
|
|
"NOT EVMC_TESTING" ON)
|
|
|
|
|
2019-11-27 10:24:41 +00:00
|
|
|
option(HUNTER_ENABLED "Enable Hunter package manager support" ${EVMC_TOOLS})
|
|
|
|
|
2019-03-14 16:37:26 +00:00
|
|
|
if(HUNTER_ENABLED)
|
2019-03-11 20:58:21 +00:00
|
|
|
set(HUNTER_CONFIGURATION_TYPES Release CACHE STRING "Build type of Hunter packages")
|
2019-01-18 12:49:54 +00:00
|
|
|
include(HunterGate)
|
2019-05-06 09:23:12 +00:00
|
|
|
include(Hunter/init)
|
2019-01-18 12:49:54 +00:00
|
|
|
include(defaults/HunterCacheServers)
|
2018-11-10 22:01:48 +00:00
|
|
|
endif()
|
2018-04-12 09:01:01 +00:00
|
|
|
|
2019-01-15 13:08:54 +00:00
|
|
|
cable_configure_toolchain(DEFAULT cxx11-pic)
|
2019-05-15 09:59:36 +00:00
|
|
|
cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Debug Release)
|
2019-01-15 13:08:54 +00:00
|
|
|
|
2018-03-28 13:19:41 +00:00
|
|
|
project(evmc)
|
2019-11-29 12:19:18 +00:00
|
|
|
set(PROJECT_VERSION 7.1.0)
|
2018-03-28 13:19:41 +00:00
|
|
|
|
2018-04-19 08:26:46 +00:00
|
|
|
cable_configure_compiler(NO_STACK_PROTECTION)
|
2018-04-11 12:56:14 +00:00
|
|
|
|
2018-06-07 10:24:31 +00:00
|
|
|
set(include_dir ${PROJECT_SOURCE_DIR}/include)
|
|
|
|
|
|
|
|
add_subdirectory(lib)
|
|
|
|
|
2019-11-27 11:34:28 +00:00
|
|
|
if(EVMC_TOOLS)
|
|
|
|
add_subdirectory(tools)
|
2019-03-14 16:37:26 +00:00
|
|
|
endif()
|
|
|
|
|
2019-11-27 11:34:28 +00:00
|
|
|
if(EVMC_EXAMPLES)
|
|
|
|
add_subdirectory(examples)
|
2018-04-12 09:01:24 +00:00
|
|
|
endif()
|
|
|
|
|
2019-11-27 11:34:28 +00:00
|
|
|
if(EVMC_TESTING)
|
|
|
|
enable_testing()
|
|
|
|
add_subdirectory(test)
|
2018-03-28 13:19:41 +00:00
|
|
|
endif()
|
2018-04-18 14:32:24 +00:00
|
|
|
|
2018-06-19 09:25:19 +00:00
|
|
|
write_basic_package_version_file(evmcConfigVersion.cmake COMPATIBILITY ExactVersion)
|
|
|
|
|
|
|
|
configure_package_config_file(
|
|
|
|
cmake/Config.cmake.in
|
|
|
|
evmcConfig.cmake
|
|
|
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evmc
|
|
|
|
)
|
|
|
|
|
2019-07-23 09:57:21 +00:00
|
|
|
if(EVMC_INSTALL)
|
|
|
|
install(DIRECTORY include/evmc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
|
|
|
|
|
|
install(
|
|
|
|
EXPORT evmcTargets
|
|
|
|
NAMESPACE evmc::
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evmc
|
|
|
|
)
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/evmcConfig.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/evmcConfigVersion.cmake
|
|
|
|
cmake/EVMC.cmake
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/evmc
|
|
|
|
)
|
|
|
|
endif()
|
2018-04-18 14:32:24 +00:00
|
|
|
|
2019-08-05 20:58:54 +00:00
|
|
|
set(
|
|
|
|
CPACK_SOURCE_IGNORE_FILES
|
|
|
|
/\\\\.git/
|
|
|
|
/\\\\.idea/
|
|
|
|
/build/
|
|
|
|
/cmake-build-.*/
|
|
|
|
/bindings/
|
|
|
|
/Cargo.lock
|
|
|
|
/Cargo.toml
|
|
|
|
/target/
|
|
|
|
)
|
2019-08-12 09:24:01 +00:00
|
|
|
cable_add_archive_package()
|