Skip to content

Commit

Permalink
Fix contracts installation after add_contract #258
Browse files Browse the repository at this point in the history
  • Loading branch information
soft-bagel-93 committed Jan 31, 2020
1 parent 6f4a316 commit 488ff67
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 8 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ else()
set(TEST_BUILD_TYPE ${CMAKE_BUILD_TYPE})
endif()

macro(install_contract TARGET)
install (TARGETS ${TARGET}.wasm DESTINATION ${CMAKE_INSTALL_PREFIX}/${TARGET}/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.abi DESTINATION ${CMAKE_INSTALL_PREFIX}/${TARGET}/)
endmacro()

macro(add_contract_with_abi TARGET ABIFILE)
add_executable( ${TARGET}.wasm ${ARGN} )
configure_file(${ABIFILE} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.abi COPYONLY)
install (TARGETS ${TARGET}.wasm DESTINATION ${CMAKE_INSTALL_PREFIX}/${TARGET}/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.abi DESTINATION ${CMAKE_INSTALL_PREFIX}/${TARGET}/)
install_contract(TARGET)
endmacro()

add_subdirectory(cyber.bios)
Expand Down
2 changes: 2 additions & 0 deletions cyber.bios/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.bios cyber.bios ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.bios.cpp)
install_contract(cyber.bios)

target_include_directories(cyber.bios.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../cyber.govern/include
Expand Down
5 changes: 2 additions & 3 deletions cyber.domain/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.domain cyber.domain ${CMAKE_CURRENT_SOURCE_DIR}/cyber.domain.cpp)
install_contract(cyber.domain)

target_include_directories(cyber.domain.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../cyber.token/include
Expand All @@ -7,6 +9,3 @@ target_include_directories(cyber.domain.wasm
set_target_properties(cyber.domain.wasm
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")

install (TARGETS cyber.domain.wasm DESTINATION ${CMAKE_INSTALL_PREFIX}/cyber.domain/)
#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/cyber.domain.abi DESTINATION ${CMAKE_INSTALL_PREFIX}/cyber.domain/)
5 changes: 2 additions & 3 deletions cyber.govern/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.govern cyber.govern ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.govern.cpp)
install_contract(cyber.govern)

target_include_directories(cyber.govern.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
Expand All @@ -9,6 +11,3 @@ target_include_directories(cyber.govern.wasm
set_target_properties(cyber.govern.wasm
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")

install (TARGETS cyber.govern.wasm DESTINATION ${CMAKE_INSTALL_PREFIX}/cyber.govern/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/cyber.govern.abi DESTINATION ${CMAKE_INSTALL_PREFIX}/cyber.govern/)
2 changes: 2 additions & 0 deletions cyber.incomereject/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.incomereject cyber.incomereject ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.incomereject.cpp)
install_contract(cyber.incomereject)

target_include_directories(cyber.incomereject.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
Expand Down
2 changes: 2 additions & 0 deletions cyber.msig/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.msig cyber.msig ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.msig.cpp)
install_contract(cyber.msig)

target_include_directories(cyber.msig.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down
2 changes: 2 additions & 0 deletions cyber.rejector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.rejector cyber.rejector ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.rejector.cpp)
install_contract(cyber.rejector)

target_include_directories(cyber.rejector.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down
2 changes: 2 additions & 0 deletions cyber.stake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.stake cyber.stake ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.stake.cpp)
install_contract(cyber.stake)

target_include_directories(cyber.stake.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
Expand Down
2 changes: 2 additions & 0 deletions cyber.token/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_contract(cyber.token cyber.token ${CMAKE_CURRENT_SOURCE_DIR}/src/cyber.token.cpp)
install_contract(cyber.token)

target_include_directories(cyber.token.wasm
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down

0 comments on commit 488ff67

Please sign in to comment.