我正在解决.cmake文件问题,如何解决?

时间:2018-11-17 01:59:52

标签: c++ cmake

这是我的CMakeLists.txt

seva2文件夹位于/ home / rcarrasco /目录

具有库的.cmake文件正在寻找什么,但是我找不到它来查找库

cmake_minimum_required(VERSION 2.8)

set(PROJECT_NAME
        sevablocks)


project(${PROJECT_NAME})

set(CMAKE_CXX_FLAGS
        "${CMAKE_CXX_FLAGS} -std=c++14")


if (WIN32)
  set(BOOST_ROOT "C:\\local\\boost_1_64_0")
  set(BOOST_LIBRARYDIR "C:\\local\\boost_1_64_0\\libs")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -O3")
endif()


if (NOT SEVA_DIR)
    set(SEVA_DIR ~/seva2)
endif()

message(STATUS SEVA_DIR ": ${SEVA_DIR}")

set(SEVA_SOURCE_DIR ${SEVA_DIR}
        CACHE PATH "Path to the root directory for seva2")

# set location of SevaBit build tree
set(SEVA_BUILD_DIR ${SEVA_SOURCE_DIR}/build/release/
        CACHE PATH "Path to the build directory for seva2")

set(MY_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake"
        CACHE PATH "The path to the cmake directory of the current project")

list(APPEND CMAKE_MODULE_PATH "${MY_CMAKE_DIR}")

set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${SEVA_BUILD_DIR}"
        CACHE PATH "Add SevaBit directory for library searching")

include(MyUtils)

find_package(seva2)

# find boost
find_package(Boost COMPONENTS
        system
        filesystem
        thread
        date_time
        chrono
        regex
        serialization
        program_options
        date_time
        REQUIRED)

#info https://github.com/arsenm/sanitizers-cmake
find_package(Sanitizers)

if(APPLE)
    include_directories(/usr/local/opt/openssl/include)
    link_directories(/usr/local/opt/openssl/lib)
endif()


if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32)
    add_library(unbound STATIC IMPORTED)
    set_property(TARGET unbound PROPERTY IMPORTED_LOCATION ${SEVA_BUILD_DIR}/external/unbound/libunbound.a)
endif()

# include boost headers
include_directories(${Boost_INCLUDE_DIRS})
include_directories("ext/mstch/include")
include_directories("ext/crow")

# add ext/ subfolder
add_subdirectory(ext/)

# add src/ subfolder
add_subdirectory(src/)


set(SOURCE_FILES
        main.cpp)

#ADD_CUSTOM_TARGET(driver DEPENDS src/templates/index.html)

add_executable(${PROJECT_NAME}
        ${SOURCE_FILES})

add_sanitizers(${PROJECT_NAME})

create_git_version()

configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates ${CMAKE_CURRENT_BINARY_DIR}/templates)
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/css ${CMAKE_CURRENT_BINARY_DIR}/templates/css)
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/partials ${CMAKE_CURRENT_BINARY_DIR}/templates/partials)
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/js ${CMAKE_CURRENT_BINARY_DIR}/templates/js)

set(LIBRARIES
        sevaexplorer
        myexp
        mstch
        wallet
        blockchain_db
        cryptonote_core
        cryptonote_protocol
        cryptonote_basic
        multisig
        daemonizer
        cncrypto
        blocks
        lmdb
        ringct
        ringct_basic
        device
        common
        mnemonics
        easylogging
        checkpoints
        version
        epee
        pcsclite
        ${Boost_LIBRARIES}
        pthread
        unbound
        curl
        crypto
        ssl)

if(APPLE)
    set(LIBRARIES ${LIBRARIES} "-framework IOKit -framework PCSC")
else()
    set(LIBRARIES ${LIBRARIES} atomic)
endif()

if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT WIN32)
    set(LIBRARIES ${LIBRARIES} unwind)
endif()

if (WIN32)
    set(LIBRARIES ${LIBRARIES}
            wsock32
            ntdll
            ws2_32
            Iphlpapi
            )
else()
    set(LIBRARIES ${LIBRARIES} dl)
endif()

target_link_libraries(${PROJECT_NAME} ${LIBRARIES})

这是我的.cmake文件

#------------------------------------------------------------------------------
 # CMake helper for the majority of the cpp-ethereum modules.
 #
 # This module defines
 #     LOKI_XXX_LIBRARIES, the libraries needed to use ethereum.
 #     LOKI_FOUND, If false, do not try to use ethereum.
 #
 # File addetped from cpp-ethereum
 #
 # The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
 #
 # ------------------------------------------------------------------------------
 # This file is part of cpp-ethereum.
 #
 # cpp-ethereum is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # cpp-ethereum is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>
 #
 # (c) 2014-2016 cpp-ethereum contributors.
 #------------------------------------------------------------------------------

 set(LIBS common;blocks;cryptonote_basic;cryptonote_core;multisig;
        cryptonote_protocol;daemonizer;mnemonics;epee;lmdb;device;
        blockchain_db;ringct;wallet;cncrypto;easylogging;version;checkpoints)

     set(LOK_INCLUDE_DIRS "${CPP_LOKI_DIR}")

 # if the project is a subset of main cpp-ethereum project
 # use same pattern for variables as Boost uses

 foreach (l ${LIBS})

    string(TOUPPER ${l} L)

    find_library(LOK_${L}_LIBRARY       NAMES ${l}      PATHS
 ${CMAKE_LIBRARY_PATH}      PATH_SUFFIXES "/src/${l}" "/src/"
 "/external/db_drivers/lib${l}" "/lib" "/src/crypto"
 "/contrib/epee/src" "/external/easylogging++/"         NO_DEFAULT_PATH     )

    set(LOK_${L}_LIBRARIES ${LOK_${L}_LIBRARY})

     message(STATUS FindLoki " LOK_${L}_LIBRARIES ${LOK_${L}_LIBRARY}")

    add_library(${l} STATIC IMPORTED)   set_property(TARGET ${l} PROPERTY
 IMPORTED_LOCATION ${LOK_${L}_LIBRARIES})

 endforeach()

 if (EXISTS ${LOKI_BUILD_DIR}/src/ringct/libringct_basic.a)
    message(STATUS FindLoki " found libringct_basic.a")
    add_library(ringct_basic STATIC IMPORTED)   set_property(TARGET
 ringct_basic       PROPERTY IMPORTED_LOCATION
 ${LOKI_BUILD_DIR}/src/ringct/libringct_basic.a) endif()


 message(STATUS ${LOKI_SOURCE_DIR}/build)

 # include SevaBit headers include_directories(
     ${LOKI_SOURCE_DIR}/src
     ${LOKI_SOURCE_DIR}/external
     ${LOKI_SOURCE_DIR}/build
     ${LOKI_SOURCE_DIR}/external/easylogging++
     ${LOKI_SOURCE_DIR}/contrib/epee/include
     ${LOKI_SOURCE_DIR}/external/db_drivers/liblmdb)

该文件的输出是

> -- LOKI_DIR: ~/seva2
> -- FindLoki  /home/rcarrasco/seva2/
> -- FindLoki LOK_COMMON_LIBRARIES LOK_COMMON_LIBRARY-NOTFOUND
> -- FindLoki LOK_BLOCKS_LIBRARIES LOK_BLOCKS_LIBRARY-NOTFOUND
> -- FindLoki LOK_CRYPTONOTE_BASIC_LIBRARIES LOK_CRYPTONOTE_BASIC_LIBRARY-NOTFOUND
> -- FindLoki LOK_CRYPTONOTE_CORE_LIBRARIES LOK_CRYPTONOTE_CORE_LIBRARY-NOTFOUND
> -- FindLoki LOK_MULTISIG_LIBRARIES LOK_MULTISIG_LIBRARY-NOTFOUND
> -- FindLoki LOK_CRYPTONOTE_PROTOCOL_LIBRARIES LOK_CRYPTONOTE_PROTOCOL_LIBRARY-NOTFOUND
> -- FindLoki LOK_DAEMONIZER_LIBRARIES LOK_DAEMONIZER_LIBRARY-NOTFOUND
> -- FindLoki LOK_MNEMONICS_LIBRARIES LOK_MNEMONICS_LIBRARY-NOTFOUND
> -- FindLoki LOK_EPEE_LIBRARIES LOK_EPEE_LIBRARY-NOTFOUND
> -- FindLoki LOK_LMDB_LIBRARIES LOK_LMDB_LIBRARY-NOTFOUND
> -- FindLoki LOK_DEVICE_LIBRARIES LOK_DEVICE_LIBRARY-NOTFOUND
> -- FindLoki LOK_BLOCKCHAIN_DB_LIBRARIES LOK_BLOCKCHAIN_DB_LIBRARY-NOTFOUND
> -- FindLoki LOK_RINGCT_LIBRARIES LOK_RINGCT_LIBRARY-NOTFOUND
> -- FindLoki LOK_WALLET_LIBRARIES LOK_WALLET_LIBRARY-NOTFOUND
> -- FindLoki LOK_CNCRYPTO_LIBRARIES LOK_CNCRYPTO_LIBRARY-NOTFOUND
> -- FindLoki LOK_EASYLOGGING_LIBRARIES LOK_EASYLOGGING_LIBRARY-NOTFOUND
> -- FindLoki LOK_VERSION_LIBRARIES LOK_VERSION_LIBRARY-NOTFOUND
> -- FindLoki LOK_CHECKPOINTS_LIBRARIES LOK_CHECKPOINTS_LIBRARY-NOTFOUND
> -- /home/rcarrasco/seva2/build
and then when making i get this output
> [ 40%] Built target mstch [ 55%] Built target myext [ 90%] Built
> target myxrm Scanning dependencies of target SevaBitBlocks make[2]:
> *** No rule to make target 'LOK_WALLET_LIBRARY-NOTFOUND', needed by 'SevaBitBlocks'.  Stop. make[2]: *** Waiting for unfinished jobs.... [
> 95%] Building CXX object CMakeFiles/SevaBitBlocks.dir/main.cpp.o

我该怎么办?如果您需要查看一些文件,请告诉我,这也是git存储库中的整个代码 github repo

0 个答案:

没有答案