diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/ethereum/ethash/test/c/CMakeLists.txt')
-rw-r--r-- | Godeps/_workspace/src/github.com/ethereum/ethash/test/c/CMakeLists.txt | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/test/c/CMakeLists.txt b/Godeps/_workspace/src/github.com/ethereum/ethash/test/c/CMakeLists.txt index 02e2aab91..dd91d8a92 100644 --- a/Godeps/_workspace/src/github.com/ethereum/ethash/test/c/CMakeLists.txt +++ b/Godeps/_workspace/src/github.com/ethereum/ethash/test/c/CMakeLists.txt @@ -1,5 +1,30 @@ +if (MSVC) + if (NOT BOOST_ROOT) + set (BOOST_ROOT "$ENV{BOOST_ROOT}") + endif() + set (CMAKE_PREFIX_PATH BOOST_ROOT) +endif() + IF( NOT Boost_FOUND ) - find_package(Boost COMPONENTS unit_test_framework) + # 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 ) @@ -8,21 +33,29 @@ IF( Boost_FOUND ) link_directories ( ${Boost_LIBRARY_DIRS} ) file(GLOB HEADERS "*.h") - ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK) - + if (NOT MSVC) + ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK) + endif() if (NOT CRYPTOPP_FOUND) - find_package (CryptoPP) + find_package (CryptoPP) endif() if (CRYPTOPP_FOUND) - add_definitions(-DWITH_CRYPTOPP) + 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 ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${ETHHASH_LIBS}) + 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}) + TARGET_LINK_LIBRARIES(Test ${CRYPTOPP_LIBRARIES}) endif() enable_testing () |