Browse Source

common changes

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
2121aad995
  1. 2
      alethzero/CMakeLists.txt
  2. 4
      extdep/CMakeLists.txt
  3. 68
      iethxi/CMakeLists.txt

2
alethzero/CMakeLists.txt

@ -94,6 +94,6 @@ elseif ("${TARGET_PLATFORM}" STREQUAL "w64")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX) elseif (UNIX)
else () else ()
message(STATUS "platform not supported") message(ERROR "platform not supported")
endif () endif ()

4
extdep/CMakeLists.txt

@ -23,7 +23,5 @@ include(leveldb.cmake)
# will be re-eanbled later # will be re-eanbled later
# include(miniupnpc.cmake) # include(miniupnpc.cmake)
# if install phase of extep fails, even if libs are already created, the ethereum install will fail
# BUG
# becouse extdep/cmakelist.txt is subfolder of ethereum project its being install into binary destination on macos. it's a bug

68
iethxi/CMakeLists.txt

@ -1,9 +1,4 @@
cmake_policy(SET CMP0015 NEW) cmake_policy(SET CMP0015 OLD)
if ("${TARGET_PLATFORM}" STREQUAL "w64")
cmake_policy(SET CMP0020 NEW)
endif ()
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
aux_source_directory(. SRC_LIST) aux_source_directory(. SRC_LIST)
@ -13,31 +8,12 @@ link_directories(../libethcore)
link_directories(../libethereum) link_directories(../libethereum)
link_directories(../libqethereum) link_directories(../libqethereum)
# Find Qt5 for Apple and update src_list for windows
if (APPLE)
# homebrew defaults to qt4 and installs qt5 as 'keg-only'
# which places it into /usr/local/opt insteadof /usr/local.
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)
elseif (UNIX)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake")
endif ()
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5Qml REQUIRED)
find_package(Qt5Network REQUIRED)
qt5_wrap_ui(ui_Main.h Main.ui) qt5_wrap_ui(ui_Main.h Main.ui)
qt5_add_resources(RESOURCE_ADDED Resources.qrc) qt5_add_resources(RESOURCE_ADDED Resources.qrc)
# Set name of binary and add_executable() # Set name of binary and add_executable()
if (APPLE) if (APPLE)
set(EXECUTEABLE IEthXi) set(EXECUTABLE IEthXi)
set(CMAKE_INSTALL_PREFIX ./) set(CMAKE_INSTALL_PREFIX ./)
set(BIN_INSTALL_DIR ".") set(BIN_INSTALL_DIR ".")
set(DOC_INSTALL_DIR ".") set(DOC_INSTALL_DIR ".")
@ -49,24 +25,26 @@ 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})
include(BundleUtilities) include(BundleUtilities)
add_executable(${EXECUTEABLE} MACOSX_BUNDLE Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) add_executable(${EXECUTABLE} MACOSX_BUNDLE Main.ui ${RESOURCE_ADDED} ${SRC_LIST})
else () else ()
set(EXECUTEABLE iethxi) set(EXECUTABLE iethxi)
add_executable(${EXECUTEABLE} Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) add_executable(${EXECUTABLE} Main.ui ${RESOURCE_ADDED} ${SRC_LIST})
endif () endif ()
qt5_use_modules(${EXECUTEABLE} Core Gui Widgets Network Quick Qml) qt5_use_modules(${EXECUTABLE} Core Gui Widgets Network Quick Qml)
target_link_libraries(${EXECUTEABLE} qethereum ethereum secp256k1) target_link_libraries(${EXECUTABLE} qethereum)
target_link_libraries(${EXECUTABLE} ethereum)
target_link_libraries(${EXECUTABLE} secp256k1)
if (APPLE) if (APPLE)
if (${ADDFRAMEWORKS}) if (${ADDFRAMEWORKS})
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")
endif () endif ()
SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) SET_SOURCE_FILES_PROPERTIES(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
# This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type # This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type
# will not be set but defaults to release. # will not be set but defaults to release.
@ -79,7 +57,7 @@ if (APPLE)
set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}") set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}")
endif () endif ()
set(APPS ${binary_build_dir}/${EXECUTEABLE}.app) set(APPS ${binary_build_dir}/${EXECUTABLE}.app)
# This tool and the next will automatically looked at the linked libraries in order to determine what dependencies are required. Thus, target_link_libaries only needs to add ethereum and secp256k1 (above) # This tool and the next will automatically looked at the linked libraries in order to determine what dependencies are required. Thus, target_link_libaries only needs to add ethereum and secp256k1 (above)
install(CODE " install(CODE "
@ -90,7 +68,7 @@ if (APPLE)
if (${ADDFRAMEWORKS}) if (${ADDFRAMEWORKS})
add_custom_target(addframeworks ALL add_custom_target(addframeworks ALL
COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTEABLE}.app COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTABLE}.app
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DEPENDS ${PROJECT_NAME} DEPENDS ${PROJECT_NAME}
) )
@ -99,19 +77,15 @@ if (APPLE)
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") elseif ("${TARGET_PLATFORM}" STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") 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") 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(${EXECUTABLE} gcc)
target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) target_link_libraries(${EXECUTABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32)
target_link_libraries(${EXECUTEABLE} boost_system-mt-s) target_link_libraries(${EXECUTABLE} boost_system-mt-s)
target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s)
target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) target_link_libraries(${EXECUTABLE} Qt5PlatformSupport)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX) elseif (UNIX)
else () else ()
target_link_libraries(${EXECUTEABLE} boost_system) message(ERROR "platform not supported")
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 ()

Loading…
Cancel
Save