I'm trying to build cleos separately from the eos directory.
bernardo@instance-1:~$ cp -r eos/programs/cleos/ ~/cleos
bernardo@instance-1:~$ cd cleos/
bernardo@instance-1:~/cleos$ cmake .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Intl: /usr/include
CMake Error at CMakeLists.txt:40 (install):
install TARGETS given no RUNTIME DESTINATION for executable target "cleos".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "/home/bernardo/cleos/CMakeFiles/CMakeOutput.log".
Here's the full log: https://pastebin.com/1Z26uVx3
I guess the cleos/CMakeLists.txt
file needs some adaptations?
This is how it looks like:
bernardo@instance-1:~$ cat cleos/CMakeLists.txt
add_executable( cleos main.cpp httpc.cpp help_text.cpp localize.hpp config.hpp CLI11.hpp)
if( UNIX AND NOT APPLE )
set(rt_library rt )
endif()
find_package( Gperftools QUIET )
if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling with TCMalloc")
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../.git)
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../.."
OUTPUT_VARIABLE "cleos_BUILD_VERSION"
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git commit revision: ${cleos_BUILD_VERSION}")
else()
set(cleos_BUILD_VERSION 0)
endif()
else()
set(cleos_BUILD_VERSION 0)
endif()
find_package(Intl REQUIRED)
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
set(LOCALEDOMAIN cleos)
configure_file(config.hpp.in config.hpp ESCAPE_QUOTES)
target_include_directories(cleos PUBLIC ${Intl_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries( cleos
PRIVATE appbase chain_api_plugin producer_plugin chain_plugin http_plugin eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ${Intl_LIBRARIES} )
install( TARGETS
cleos
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
)