From 7f2ac996792ff43662b1f655a71a53f2281ae0d3 Mon Sep 17 00:00:00 2001 From: debris Date: Sat, 11 Apr 2015 19:53:45 +0200 Subject: [PATCH] fixed #1590, msvc build with cmake 3.2.1 --- CMakeLists.txt | 17 +++++++++++++---- test/CMakeLists.txt | 8 ++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 100ef9139..eb6dc9d46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,22 @@ # cmake global cmake_minimum_required(VERSION 2.8.12) + +project(ethereum) + +set(CMAKE_AUTOMOC ON) + +# link_directories interprate relative paths with respect to CMAKE_CURRENT_SOURCE_DIR +cmake_policy(SET CMP0015 NEW) + # let cmake autolink dependencies on windows # it's specified globally, cause qt libraries requires that on windows and they are also found globally cmake_policy(SET CMP0020 NEW) -project(ethereum) +# 3.1 and above +if ((${CMAKE_MAJOR_VERSION} GREATER 2) AND (${CMAKE_MINOR_VERSION} GREATER 0)) + # implicitly dereference variables (deprecated in 3.1) + cmake_policy(SET CMP0054 OLD) +endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -118,9 +130,6 @@ endfunction() ###################################################################################################### -set(CMAKE_AUTOMOC ON) -cmake_policy(SET CMP0015 NEW) - # Clear invalid option if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") if (PARANOID) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 90af5122e..1df4c7cc3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,10 +34,10 @@ endforeach(file) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) -add_executable(createRandomVMTest createRandomVMTest.cpp vm.cpp TestHelper.cpp Stats.cpp) -add_executable(createRandomStateTest createRandomStateTest.cpp TestHelper.cpp Stats.cpp) -add_executable(checkRandomVMTest checkRandomVMTest.cpp vm.cpp TestHelper.cpp Stats.cpp) -add_executable(checkRandomStateTest checkRandomStateTest.cpp TestHelper.cpp Stats.cpp) +add_executable(createRandomVMTest "./createRandomVMTest.cpp" "./vm.cpp" "./TestHelper.cpp" "./Stats.cpp") +add_executable(createRandomStateTest "./createRandomStateTest.cpp" "./TestHelper.cpp" "./Stats.cpp") +add_executable(checkRandomVMTest "./checkRandomVMTest.cpp" "./vm.cpp" "./TestHelper.cpp" "./Stats.cpp") +add_executable(checkRandomStateTest "./checkRandomStateTest.cpp" "./TestHelper.cpp" "./Stats.cpp") target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) target_link_libraries(testeth ${CURL_LIBRARIES})