include(ExternalProject)

ExternalProject_Add(
   KoinosWasmLibraries
   SOURCE_DIR "${CMAKE_SOURCE_DIR}/libraries"
   BINARY_DIR "${CMAKE_BINARY_DIR}/libraries"
   CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_BINARY_DIR}/cmake/koinos-wasm-toolchain.cmake -DBoost_INCLUDE_DIR=${CMAKE_BINARY_DIR}/include -DBUILD_TESTS=OFF -DHUNTER_ENABLED=OFF -DJSON_ENABLED=OFF -DBOOST_ROOT=${CMAKE_BINARY_DIR} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/wasm_libs
   UPDATE_COMMAND ""
   PATCH_COMMAND  ""
   TEST_COMMAND   ""
   BUILD_ALWAYS 1
   DEPENDS boost_headers
)

install(DIRECTORY ${CMAKE_BINARY_DIR}/wasm_libs/ DESTINATION .)
