From 27a0ad1e766826e03446f6f35841c4dc60b601cb Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 1 Dec 2014 19:20:52 +0100 Subject: [PATCH] cmake cleanup cd. --- alethzero/CMakeLists.txt | 19 ++++++++++++-- eth/CMakeLists.txt | 25 +++++++++++-------- exp/CMakeLists.txt | 35 +++++++------------------- libdevcore/CMakeLists.txt | 26 ++++++------------- libdevcore/CommonData.cpp | 3 ++- libdevcrypto/CMakeLists.txt | 33 +++++------------------- libweb3jsonrpc/CMakeLists.txt | 47 ++++++++++------------------------- 7 files changed, 69 insertions(+), 119 deletions(-) diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 8d31f173c..0f2da0df0 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_policy(SET CMP0015 OLD) +#set(CMAKE_AUTOMOC OFF) set(CMAKE_INCLUDE_CURRENT_DIR ON) aux_source_directory(. SRC_LIST) @@ -35,7 +36,22 @@ else () endif () qt5_use_modules(${EXECUTABLE} Core) -target_link_libraries(${EXECUTABLE} webthree qethereum ethereum evm ethcore devcrypto secp256k1 gmp serpent lll solidity evmcore devcore web3jsonrpc jsqrc ${JSONCPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} qethereum) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} evm) +target_link_libraries(${EXECUTABLE} ethcore) +target_link_libraries(${EXECUTABLE} devcrypto) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} gmp) +target_link_libraries(${EXECUTABLE} serpent) +target_link_libraries(${EXECUTABLE} lll) +target_link_libraries(${EXECUTABLE} solidity) +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} web3jsonrpc) +target_link_libraries(${EXECUTABLE} jsqrc) if (APPLE) # First have qt5 install plugins and frameworks @@ -74,7 +90,6 @@ elseif ("${TARGET_PLATFORM}" STREQUAL "w64") target_link_libraries(${EXECUTABLE} Qt5PlatformSupport) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) elseif (UNIX) - else () message(STATUS "platform not supported") endif () diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index 934169e1f..5ccac182b 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -1,30 +1,35 @@ -cmake_policy(SET CMP0015 NEW) +cmake_policy(SET CMP0015 OLD) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) -include_directories(..) include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) include_directories(${LEVELDB_INCLUDE_DIR}) +include_directories(..) set(EXECUTABLE eth) file(GLOB HEADERS "*.h") + add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -target_link_libraries(${EXECUTABLE} webthree) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) if(MINIUPNPC_LS) target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) + if(JSON_RPC_CPP_FOUND) target_link_libraries(${EXECUTABLE} web3jsonrpc) endif() + if(READLINE_LS) target_link_libraries(${EXECUTABLE} ${READLINE_LS}) endif() +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} gmp) + if ("${TARGET_PLATFORM}" STREQUAL "w64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") target_link_libraries(${EXECUTABLE} boost_system-mt-s) @@ -39,10 +44,10 @@ if ("${TARGET_PLATFORM}" STREQUAL "w64") set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) elseif (UNIX) else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) + #target_link_libraries(${EXECUTABLE} boost_system) + #target_link_libraries(${EXECUTABLE} boost_filesystem) + #find_package(Threads REQUIRED) + #target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) endif () install( TARGETS ${EXECUTABLE} DESTINATION bin ) diff --git a/exp/CMakeLists.txt b/exp/CMakeLists.txt index 26ee835d4..6fcea5341 100644 --- a/exp/CMakeLists.txt +++ b/exp/CMakeLists.txt @@ -1,41 +1,24 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) -include_directories(..) include_directories(${LEVELDB_INCLUDE_DIR}) +include_directories(..) set(EXECUTABLE exp) add_executable(${EXECUTABLE} ${SRC_LIST}) -target_link_libraries(${EXECUTABLE} ethereum) -target_link_libraries(${EXECUTABLE} p2p) -target_link_libraries(${EXECUTABLE} gmp) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) + if(MINIUPNPC_LS) target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - -install( TARGETS ${EXECUTABLE} DESTINATION bin ) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} p2p) +target_link_libraries(${EXECUTABLE} gmp) + +install( TARGETS ${EXECUTABLE} DESTINATION bin) diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt index 939f20593..3ff0733b4 100644 --- a/libdevcore/CMakeLists.txt +++ b/libdevcore/CMakeLists.txt @@ -1,32 +1,24 @@ -cmake_policy(SET CMP0015 NEW) - -if (CMAKE_MAJOR_VERSION GREATER 1 AND CMAKE_MINOR_VERSION GREATER 7 AND CMAKE_PATCH_VERSION GREATER 11) - cmake_policy(SET CMP0022 NEW) -endif() +cmake_policy(SET CMP0015 OLD) +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) -include_directories(..) + include_directories(${LEVELDB_INCLUDE_DIR}) +include_directories(..) set(EXECUTABLE devcore) file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) +if (APPLE) # Latest mavericks boost libraries only come with -mt target_link_libraries(${EXECUTABLE} boost_system-mt) target_link_libraries(${EXECUTABLE} boost_filesystem-mt) @@ -38,11 +30,7 @@ elseif (UNIX) target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY}) find_package(Threads REQUIRED) target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () +endif() install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libdevcore/CommonData.cpp b/libdevcore/CommonData.cpp index bd7841402..d34b565eb 100644 --- a/libdevcore/CommonData.cpp +++ b/libdevcore/CommonData.cpp @@ -23,7 +23,8 @@ #include #include "Exceptions.h" -#include +#include "Log.h" + using namespace std; using namespace dev; diff --git a/libdevcrypto/CMakeLists.txt b/libdevcrypto/CMakeLists.txt index 7de842fc5..423a9ccc6 100644 --- a/libdevcrypto/CMakeLists.txt +++ b/libdevcrypto/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_policy(SET CMP0015 NEW) +cmake_policy(SET CMP0015 OLD) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) @@ -11,44 +12,22 @@ else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) include_directories(${CRYPTOPP_INCLUDE_DIR}) include_directories(${LEVELDB_INCLUDE_DIR}) +include_directories(..) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) +target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES}) target_link_libraries(${EXECUTABLE} devcore) target_link_libraries(${EXECUTABLE} secp256k1) target_link_libraries(${EXECUTABLE} gmp) -target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES}) -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) +if (APPLE) # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) elseif (UNIX) find_package(Boost 1.53 REQUIRED COMPONENTS filesystem) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/libweb3jsonrpc/CMakeLists.txt b/libweb3jsonrpc/CMakeLists.txt index 5fb2662e1..97130718e 100644 --- a/libweb3jsonrpc/CMakeLists.txt +++ b/libweb3jsonrpc/CMakeLists.txt @@ -1,56 +1,35 @@ -cmake_policy(SET CMP0015 NEW) +cmake_policy(SET CMP0015 OLD) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) -include_directories(..) include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) include_directories(${LEVELDB_INCLUDE_DIR}) -link_directories(../libethcore) -link_directories(../libwebthree) +include_directories(..) set(EXECUTABLE web3jsonrpc) + file(GLOB HEADERS "*.h") -if(ETH_STATIC) +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -target_link_libraries(${EXECUTABLE} webthree) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) -target_link_libraries(${EXECUTABLE} solidity) -target_link_libraries(${EXECUTABLE} serpent) -if(MINIUPNPC_LS) - target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_LIBRARIES}) -if(READLINE_LS) -target_link_libraries(${EXECUTABLE} ${READLINE_LS}) + +if (MINIUPNPC_LS) + target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) endif() -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} gmp) +target_link_libraries(${EXECUTABLE} solidity) +target_link_libraries(${EXECUTABLE} serpent) install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} )