blob: dd91d8a9224c9e906a067c84b08cc634f08a658a (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
if (MSVC)
if (NOT BOOST_ROOT)
set (BOOST_ROOT "$ENV{BOOST_ROOT}")
endif()
set (CMAKE_PREFIX_PATH BOOST_ROOT)
endif()
IF( NOT Boost_FOUND )
# use multithreaded boost libraries, with -mt suffix
set(Boost_USE_MULTITHREADED ON)
if (MSVC)
# TODO handle other msvc versions or it will fail find them
set(Boost_COMPILER -vc120)
# use static boost libraries *.lib
set(Boost_USE_STATIC_LIBS ON)
elseif (APPLE)
# use static boost libraries *.a
set(Boost_USE_STATIC_LIBS ON)
elseif (UNIX)
# use dynamic boost libraries .dll
set(Boost_USE_STATIC_LIBS OFF)
endif()
find_package(Boost 1.48.0 COMPONENTS unit_test_framework system filesystem)
ENDIF()
IF( Boost_FOUND )
include_directories( ${Boost_INCLUDE_DIR} )
include_directories(../../src)
link_directories ( ${Boost_LIBRARY_DIRS} )
file(GLOB HEADERS "*.h")
if (NOT MSVC)
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
endif()
if (NOT CRYPTOPP_FOUND)
find_package (CryptoPP)
endif()
if (CRYPTOPP_FOUND)
add_definitions(-DWITH_CRYPTOPP)
endif()
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
endif()
add_executable (Test test.cpp ${HEADERS})
target_link_libraries(Test ${ETHHASH_LIBS})
target_link_libraries(Test ${Boost_FILESYSTEM_LIBRARIES})
target_link_libraries(Test ${Boost_SYSTEM_LIBRARIES})
target_link_libraries (Test ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (CRYPTOPP_FOUND)
TARGET_LINK_LIBRARIES(Test ${CRYPTOPP_LIBRARIES})
endif()
enable_testing ()
add_test(NAME ethash COMMAND Test)
ENDIF()
|