|
@ -1,26 +1,21 @@ |
|
|
|
|
|
cmake_policy(SET CMP0015 NEW) |
|
|
|
|
|
# this policy was introduced in cmake 3.0 |
|
|
|
|
|
# remove if, once 3.0 will be used on unix |
|
|
|
|
|
if (APPLE) |
|
|
|
|
|
cmake_policy(SET CMP0043 OLD) |
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
|
|
aux_source_directory(. SRC_LIST) |
|
|
aux_source_directory(. SRC_LIST) |
|
|
include_directories(..) |
|
|
include_directories(..) |
|
|
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) |
|
|
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) |
|
|
|
|
|
|
|
|
if (APPLE) |
|
|
|
|
|
# Add homebrew path for qt5 |
|
|
|
|
|
#set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) |
|
|
|
|
|
#include_directories(/usr/local/opt/qt5/include /usr/local/include) |
|
|
|
|
|
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
|
|
|
|
set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) |
|
|
|
|
|
include_directories(/usr/x86_64-w64-mingw32/include /usr/x86_64-w64-mingw32/include/QtCore /usr/x86_64-w64-mingw32/include/QtGui /usr/x86_64-w64-mingw32/include/QtQuick /usr/x86_64-w64-mingw32/include/QtQml /usr/x86_64-w64-mingw32/include/QtNetwork /usr/x86_64-w64-mingw32/include/QtWidgets /usr/x86_64-w64-mingw32/include/QtWebKit /usr/x86_64-w64-mingw32/include/QtWebKitWidgets) |
|
|
|
|
|
elseif (UNIX) |
|
|
|
|
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") |
|
|
|
|
|
endif () |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qt5_wrap_ui(ui_Main.h Main.ui) |
|
|
qt5_wrap_ui(ui_Main.h Main.ui) |
|
|
|
|
|
|
|
|
# Set name of binary and add_executable() |
|
|
# Set name of binary and add_executable() |
|
|
file(GLOB HEADERS "*.h") |
|
|
file(GLOB HEADERS "*.h") |
|
|
if (APPLE) |
|
|
if (APPLE) |
|
|
set(EXECUTEABLE Third) |
|
|
set(EXECUTABLE Third) |
|
|
set(BIN_INSTALL_DIR ".") |
|
|
set(BIN_INSTALL_DIR ".") |
|
|
set(DOC_INSTALL_DIR ".") |
|
|
set(DOC_INSTALL_DIR ".") |
|
|
|
|
|
|
|
@ -31,34 +26,45 @@ if (APPLE) |
|
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") |
|
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") |
|
|
set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") |
|
|
set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") |
|
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") |
|
|
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 third) |
|
|
set(MACOSX_BUNDLE_ICON_FILE third) |
|
|
include(BundleUtilities) |
|
|
include(BundleUtilities) |
|
|
|
|
|
|
|
|
add_executable(${EXECUTEABLE} MACOSX_BUNDLE third.icns Main.ui ${SRC_LIST} ${HEADERS}) |
|
|
add_executable(${EXECUTABLE} MACOSX_BUNDLE third.icns Main.ui ${SRC_LIST} ${HEADERS}) |
|
|
set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") |
|
|
set_target_properties(${EXECUTABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") |
|
|
SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) |
|
|
SET_SOURCE_FILES_PROPERTIES(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) |
|
|
SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") |
|
|
SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") |
|
|
|
|
|
|
|
|
else () |
|
|
else () |
|
|
set(EXECUTEABLE third) |
|
|
set(EXECUTABLE third) |
|
|
add_executable(${EXECUTEABLE} Main.ui ${SRC_LIST} ${HEADERS}) |
|
|
add_executable(${EXECUTABLE} Main.ui ${SRC_LIST} ${HEADERS}) |
|
|
endif () |
|
|
endif () |
|
|
|
|
|
|
|
|
qt5_use_modules(${EXECUTEABLE} Core)# Gui Widgets Network WebKit WebKitWidgets) |
|
|
target_link_libraries(${EXECUTABLE} Qt5::Core) |
|
|
target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore secp256k1 gmp serpent lll evmcore devcore web3jsonrpc jsqrc) |
|
|
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} secp256k1) |
|
|
|
|
|
target_link_libraries(${EXECUTABLE} serpent) |
|
|
|
|
|
target_link_libraries(${EXECUTABLE} lll) |
|
|
|
|
|
target_link_libraries(${EXECUTABLE} evmcore) |
|
|
|
|
|
target_link_libraries(${EXECUTABLE} devcore) |
|
|
|
|
|
target_link_libraries(${EXECUTABLE} web3jsonrpc) |
|
|
|
|
|
target_link_libraries(${EXECUTABLE} jsqrc) |
|
|
|
|
|
|
|
|
if (APPLE) |
|
|
if (APPLE) |
|
|
# First have qt5 install plugins and frameworks |
|
|
# First have qt5 install plugins and frameworks |
|
|
add_custom_command(TARGET ${EXECUTEABLE} POST_BUILD |
|
|
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD |
|
|
COMMAND ${CMAKE_PREFIX_PATH}/bin/macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTEABLE}.app |
|
|
COMMAND ${CMAKE_DEPENDENCY_INSTALL_DIR}/bin/macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app |
|
|
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) |
|
|
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) |
|
|
|
|
|
|
|
|
# This tool and next will inspect linked libraries in order to determine which dependencies are required |
|
|
# This tool and next will inspect linked libraries in order to determine which dependencies are required |
|
|
if (${CMAKE_CFG_INTDIR} STREQUAL ".") |
|
|
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 () |
|
|
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 () |
|
|
endif () |
|
|
install(CODE " |
|
|
install(CODE " |
|
|
include(BundleUtilities) |
|
|
include(BundleUtilities) |
|
@ -72,23 +78,7 @@ if (APPLE) |
|
|
file(REMOVE \${LINGER_RM}) |
|
|
file(REMOVE \${LINGER_RM}) |
|
|
endif () |
|
|
endif () |
|
|
") |
|
|
") |
|
|
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") |
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} gcc) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport opengl32 gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} boost_system-mt-s) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} crypt32) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) |
|
|
|
|
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) |
|
|
|
|
|
elseif (UNIX) |
|
|
|
|
|
else () |
|
|
else () |
|
|
target_link_libraries(${EXECUTEABLE} boost_system) |
|
|
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) |
|
|
target_link_libraries(${EXECUTEABLE} boost_filesystem) |
|
|
|
|
|
find_package(Threads REQUIRED) |
|
|
|
|
|
target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
|
|
|
|
install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) |
|
|
|
|
|
endif () |
|
|
endif () |
|
|
|
|
|
|
|
|