-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
51 lines (35 loc) · 1.95 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.9)
project(polleos CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
set(BOOST_INCLUDEDIR $ENV{HOME}/opt/boost_1_67_0/include CACHE PATH "Path to boost instalation directory")
set(EOSIO_INSTALL_DIR /usr/local CACHE PATH "Path to eosio intstall dir")
set(S2WASM_PATH ${EOSIO_INSTALL_DIR}/bin/eosio-s2wasm)
set(WAST2WASM_PATH ${EOSIO_INSTALL_DIR}/bin/eosio-wast2wasm)
set(EOSIOCPP_PATH ${EOSIO_INSTALL_DIR}/bin/eosiocpp)
set(EOSIO_CONTRACTSDK_PATH ${EOSIO_INSTALL_DIR}/usr/share/eosio/contractsdk/lib)
include("wasm")
set(DEFAULT_SYSTEM_INCLUDE_FOLDERS ${EOSIO_INSTALL_DIR}/include/libc++/upstream/include
${EOSIO_INSTALL_DIR}/include/musl/upstream/include ${BOOST_INCLUDEDIR})
set(EOSIO_LIBS ${EOSIO_CONTRACTSDK_PATH}/eosiolib.bc ${EOSIO_CONTRACTSDK_PATH}/libc++.bc
${EOSIO_CONTRACTSDK_PATH}/libc.bc)
set(INCLUDE_DIRS "${EOSIO_INSTALL_DIR}/include" "${CMAKE_SOURCE_DIR}/include")
#include_directories(include)
#include_directories(${EOSIO_INSTALL_DIR}/include)
#include_directories(${EOSIO_INSTALL_DIR}/include/libc++/upstream/include)
#include_directories(${EOSIO_INSTALL_DIR}/include/musl/upstream/include)
#include_directories(${BOOST_INCLUDE_DIR})
#include_directories(${EOSIO_TOKEN_INCLUDE_DIR})
set(CPP_FILES
${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cpp)
set(HPP_FILES
${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.hpp)
#set(CONTRACT_ASSEMBLY_FILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.s)
#set(CONTRACT_WAST_FILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.wast)
add_wast_executable(TARGET ${CMAKE_PROJECT_NAME}
INCLUDE_FOLDERS "${INCLUDE_DIRS}"
LIBRARIES ${EOSIO_LIBS}
DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_FILES ${CPP_FILES})
set(CONTRACT_ABI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.abi)
configure_file("${CONTRACT_ABI_SRC}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)
add_subdirectory(tests)