aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/EthDependencies.cmake
blob: 477a604d6dd853c9f0cb6f779e78f43e7466d2cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# all dependencies that are not directly included in the cpp-ethereum distribution are defined here
# for this to work, download the dependency via the cmake script in extdep or install them manually!

function(eth_show_dependency DEP NAME)
    get_property(DISPLAYED GLOBAL PROPERTY ETH_${DEP}_DISPLAYED)
    if (NOT DISPLAYED)
        set_property(GLOBAL PROPERTY ETH_${DEP}_DISPLAYED TRUE)
        if (NOT("${${DEP}_VERSION}" STREQUAL ""))
            message(STATUS "${NAME} version: ${${DEP}_VERSION}")
        endif()
        message(STATUS "${NAME} headers: ${${DEP}_INCLUDE_DIRS}")
        message(STATUS "${NAME} lib   : ${${DEP}_LIBRARIES}")
        if (NOT("${${DEP}_DLLS}" STREQUAL ""))
            message(STATUS "${NAME} dll   : ${${DEP}_DLLS}")
        endif()
    endif()
endfunction()

if (DEFINED MSVC)
    # by defining CMAKE_PREFIX_PATH variable, cmake will look for dependencies first in our own repository before looking in system paths like /usr/local/ ...
    # this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory

    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
        set (ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_LIST_DIR}/../extdep/install/windows/x64")
    else()
        get_filename_component(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/../deps/install" ABSOLUTE)
        set(ETH_DEPENDENCY_INSTALL_DIR
            "${DEPS_DIR}/x64"                   # Old location for deps.
            "${DEPS_DIR}/win64"                 # New location for deps.
            "${DEPS_DIR}/win64/Release/share"   # LLVM shared cmake files.
        )
    endif()
    set (CMAKE_PREFIX_PATH ${ETH_DEPENDENCY_INSTALL_DIR} ${CMAKE_PREFIX_PATH})
endif()

# custom cmake scripts
set(ETH_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts)

## use multithreaded boost libraries, with -mt suffix
set(Boost_USE_MULTITHREADED ON)
option(Boost_USE_STATIC_LIBS "Link Boost statically" ON)

find_package(Boost 1.65.0 QUIET REQUIRED COMPONENTS regex filesystem unit_test_framework program_options system)

eth_show_dependency(Boost boost)