diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a9e75df7a..6b84284295 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,16 +48,16 @@ set(WASM_SDK_BUILD true) ### Configure the EosioWasmToolchain.cmakes set(CDT_ROOT_DIR ${CMAKE_BINARY_DIR}) + configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/eosio.cdt-config.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioCDTMacros.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake @ONLY) set(CDT_ROOT_DIR ${CDT_INSTALL_PREFIX}) + configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) install(FILES ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake DESTINATION ${CDT_INSTALL_PREFIX}/lib/cmake/eosio.cdt) set(CDT_ROOT_DIR "_PREFIX_") diff --git a/modules/InstallCDT.cmake b/modules/InstallCDT.cmake index 4ba5a88502..36ec86f0a0 100644 --- a/modules/InstallCDT.cmake +++ b/modules/InstallCDT.cmake @@ -36,6 +36,12 @@ macro( eosio_tool_install_and_symlink file symlink ) install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CDT_INSTALL_PREFIX}/bin/${file} ${CMAKE_INSTALL_PREFIX}/bin/${symlink})") endmacro( eosio_tool_install_and_symlink ) +macro( eosio_cmake_install_and_symlink file symlink ) + set(BINARY_DIR ${CMAKE_BINARY_DIR}/modules) + install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt)") + install(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CDT_INSTALL_PREFIX}/lib/cmake/eosio.cdt/${file} ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt/${symlink})") +endmacro( eosio_cmake_install_and_symlink ) + macro( eosio_libraries_install) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include) @@ -51,6 +57,7 @@ eosio_clang_install_and_symlink(llvm-objdump eosio-objdump) eosio_clang_install_and_symlink(llvm-readobj eosio-readobj) eosio_clang_install_and_symlink(llvm-readelf eosio-readelf) eosio_clang_install_and_symlink(llvm-strip eosio-strip) + eosio_clang_install(opt) eosio_clang_install(llc) eosio_clang_install(lld) @@ -58,6 +65,7 @@ eosio_clang_install(ld.lld) eosio_clang_install(ld64.lld) eosio_clang_install(clang-7) eosio_clang_install(wasm-ld) + eosio_tool_install_and_symlink(eosio-pp eosio-pp) eosio_tool_install_and_symlink(eosio-wast2wasm eosio-wast2wasm) eosio_tool_install_and_symlink(eosio-wasm2wast eosio-wasm2wast) @@ -67,7 +75,13 @@ eosio_tool_install_and_symlink(eosio-ld eosio-ld) eosio_tool_install_and_symlink(eosio-abigen eosio-abigen) eosio_tool_install_and_symlink(eosio-abidiff eosio-abidiff) eosio_tool_install_and_symlink(eosio-init eosio-init) + eosio_clang_install(../lib/LLVMEosioApply${CMAKE_SHARED_LIBRARY_SUFFIX}) eosio_clang_install(../lib/LLVMEosioSoftfloat${CMAKE_SHARED_LIBRARY_SUFFIX}) eosio_clang_install(../lib/eosio_plugin${CMAKE_SHARED_LIBRARY_SUFFIX}) + +eosio_cmake_install_and_symlink(eosio.cdt-config.cmake eosio.cdt-config.cmake) +eosio_cmake_install_and_symlink(EosioWasmToolchain.cmake EosioWasmToolchain.cmake) +eosio_cmake_install_and_symlink(EosioCDTMacros.cmake EosioCDTMacros.cmake) + eosio_libraries_install()