From 7c26fa0afe2d2ff1d1498ec1df4262d2b46ef888 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 10 Dec 2014 11:52:08 +0100 Subject: [PATCH] common changes in cmakes --- mix/CMakeLists.txt | 57 ++++++++++++++++++++++---------------------- neth/CMakeLists.txt | 43 +++++++++------------------------ third/CMakeLists.txt | 2 ++ 3 files changed, 42 insertions(+), 60 deletions(-) diff --git a/mix/CMakeLists.txt b/mix/CMakeLists.txt index 03e8b45ff..3980f5642 100644 --- a/mix/CMakeLists.txt +++ b/mix/CMakeLists.txt @@ -14,7 +14,7 @@ qt5_add_resources(UI_RESOURCES qml.qrc) # Set name of binary and add_executable() file(GLOB HEADERS "*.h") if (APPLE) - set(EXECUTEABLE mix) + set(EXECUTABLE mix) set(BIN_INSTALL_DIR ".") set(DOC_INSTALL_DIR ".") @@ -25,48 +25,48 @@ if (APPLE) set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) + set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTABLE}) set(MACOSX_BUNDLE_ICON_FILE mix) include(BundleUtilities) - add_executable(${EXECUTEABLE} MACOSX_BUNDLE ${SRC_LIST} ${HEADERS} ${UI_RESOURCES}) - set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) + add_executable(${EXECUTABLE} MACOSX_BUNDLE ${SRC_LIST} ${HEADERS} ${UI_RESOURCES}) + set_target_properties(${EXECUTABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") + SET_SOURCE_FILES_PROPERTIES(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") else () - set(EXECUTEABLE mix) - add_executable(${EXECUTEABLE} ${SRC_LIST} ${HEADERS} ${UI_RESOURCES}) + set(EXECUTABLE mix) + add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS} ${UI_RESOURCES}) endif () -target_link_libraries(${EXECUTEABLE} Qt5::Core) -target_link_libraries(${EXECUTEABLE} Qt5::Gui) -target_link_libraries(${EXECUTEABLE} webthree) -target_link_libraries(${EXECUTEABLE} qethereum) -target_link_libraries(${EXECUTEABLE} ethereum) -target_link_libraries(${EXECUTEABLE} evm) -target_link_libraries(${EXECUTEABLE} ethcore) -target_link_libraries(${EXECUTEABLE} devcrypto) -target_link_libraries(${EXECUTEABLE} secp256k1) -target_link_libraries(${EXECUTEABLE} serpent) -target_link_libraries(${EXECUTEABLE} lll) -target_link_libraries(${EXECUTEABLE} solidity) -target_link_libraries(${EXECUTEABLE} evmcore) -target_link_libraries(${EXECUTEABLE} devcore) -target_link_libraries(${EXECUTEABLE} web3jsonrpc) -target_link_libraries(${EXECUTEABLE} jsqrc) +target_link_libraries(${EXECUTABLE} Qt5::Core) +target_link_libraries(${EXECUTABLE} Qt5::Gui) +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} 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 - add_custom_command(TARGET ${EXECUTEABLE} POST_BUILD - COMMAND ${CMAKE_DEPENDENCY_INSTALL_DIR}/bin/macdeployqt -qmldir=${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTEABLE}.app + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + COMMAND ${CMAKE_DEPENDENCY_INSTALL_DIR}/bin/macdeployqt -qmldir=${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # This tool and next will inspect linked libraries in order to determine which dependencies are required if (${CMAKE_CFG_INTDIR} STREQUAL ".") - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTEABLE}.app") + set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.app") else () - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTEABLE}.app") + set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") endif () install(CODE " include(BundleUtilities) @@ -81,5 +81,6 @@ if (APPLE) endif () ") else() - install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin) + install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) endif () + diff --git a/neth/CMakeLists.txt b/neth/CMakeLists.txt index 4dd49874d..731f1e4fc 100644 --- a/neth/CMakeLists.txt +++ b/neth/CMakeLists.txt @@ -2,52 +2,31 @@ cmake_policy(SET CMP0015 NEW) aux_source_directory(. SRC_LIST) -include_directories(..) include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) include_directories(${LEVELDB_INCLUDE_DIR}) +include_directories(..) set(EXECUTABLE neth) add_executable(${EXECUTABLE} ${SRC_LIST}) -target_link_libraries(${EXECUTABLE} webthree) -target_link_libraries(${EXECUTABLE} ethereum) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) +add_dependencies(${EXECUTABLE} BuildInfo.h) + +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) + if(MINIUPNPC_FOUND) target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) + if(JSON_RPC_CPP_FOUND) target_link_libraries(${EXECUTABLE} web3jsonrpc) endif() -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} cryptopp) - target_link_libraries(${EXECUTABLE} ncurses) - target_link_libraries(${EXECUTABLE} form) - 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) - target_link_libraries(${EXECUTABLE} ncurses) - target_link_libraries(${EXECUTABLE} form) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} ncurses) - target_link_libraries(${EXECUTABLE} form) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} ncurses) +target_link_libraries(${EXECUTABLE} form) install( TARGETS ${EXECUTABLE} DESTINATION bin ) diff --git a/third/CMakeLists.txt b/third/CMakeLists.txt index de0581067..98efde545 100644 --- a/third/CMakeLists.txt +++ b/third/CMakeLists.txt @@ -40,6 +40,8 @@ else () add_executable(${EXECUTABLE} Main.ui ${SRC_LIST} ${HEADERS}) endif () +add_dependencies(${EXECUTABLE} BuildInfo.h) + target_link_libraries(${EXECUTABLE} Qt5::Core) target_link_libraries(${EXECUTABLE} webthree) target_link_libraries(${EXECUTABLE} qethereum)