diff --git a/CMakeLists.txt b/CMakeLists.txt index a72659e5d..79d3285ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,10 @@ mark_as_advanced(CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARIES) include_directories(${CRYPTOPP_INCLUDE_DIR}) link_directories(${CRYPTOPP_LIBRARIES}) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + link_directories(/usr/local/lib) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_subdirectory(secp256k1) add_subdirectory(libethereum) add_subdirectory(test) diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index f94896671..8b4029208 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -1,11 +1,22 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) aux_source_directory(. SRC_LIST) include_directories(..) link_directories(../libethereum) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + execute_process( + COMMAND brew info qt5 | grep Cellar | awk -F ' ' '{print $1}' + OUTPUT_VARIABLE osx_qt5 + OUTPUT_STRIP_TRAILING_WHITESPACE) + set(CMAKE_PREFIX_PATH /usr/local/Cellar/qt5/5.2.0) + include_directories(/usr/local/Cellar/qt5/5.2.0/include /usr/local/include) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + find_package(Qt5Widgets REQUIRED) add_executable(alethzero Main.ui ${SRC_LIST}) diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index c705fa006..6213c6576 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -9,6 +9,10 @@ add_executable(eth ${SRC_LIST}) find_package(Threads REQUIRED) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include_directories(/usr/local/include) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_link_libraries(eth ethereum) target_link_libraries(eth miniupnpc) target_link_libraries(eth leveldb) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index b5ce18a6b..e5ca72d34 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -67,7 +67,7 @@ BlockChain::BlockChain(std::string _path, bool _killExisting) { if (_path.empty()) _path = Defaults::get()->m_dbPath; - boost::filesystem::create_directory(_path); + boost::filesystem::create_directories(_path); if (_killExisting) { boost::filesystem::remove_all(_path + "/blocks"); diff --git a/libethereum/CMakeLists.txt b/libethereum/CMakeLists.txt index b8e568198..0675439b4 100644 --- a/libethereum/CMakeLists.txt +++ b/libethereum/CMakeLists.txt @@ -17,6 +17,10 @@ target_link_libraries(ethereum boost_system) target_link_libraries(ethereum boost_filesystem) target_link_libraries(ethereum ${CMAKE_THREAD_LIBS_INIT}) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include_directories(/usr/local/include) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + message("Installation path: ${CMAKE_INSTALL_PREFIX}") install( TARGETS ethereum ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/libethereum/FileSystem.cpp b/libethereum/FileSystem.cpp index ffd158751..c6a7aec1a 100644 --- a/libethereum/FileSystem.cpp +++ b/libethereum/FileSystem.cpp @@ -48,10 +48,10 @@ std::string eth::getDataDir() dataDirPath = boost::filesystem::path("/"); else dataDirPath = boost::filesystem::path(homeDir); + #if defined(__APPLE__) && defined(__MACH__) - dataDirPath /= "Library" / "Application Support"; - boost::filesystem::create_directory(dataDirPath); - return (dataDirPath / "Ethereum").string(); + // This eventually needs to be put in proper wrapper (to support sandboxing) + return (dataDirPath / "Library/Application Support/Ethereum").string(); #else return (dataDirPath / ".ethereum").string(); #endif diff --git a/secp256k1/CMakeLists.txt b/secp256k1/CMakeLists.txt index 4911990f9..d4c6ba548 100644 --- a/secp256k1/CMakeLists.txt +++ b/secp256k1/CMakeLists.txt @@ -10,4 +10,6 @@ add_library(secp256k1 secp256k1.c field_5x52_asm.asm) set(CMAKE_C_FLAGS "-std=c99 -DUSE_FIELD_GMP -DUSE_NUM_GMP -DUSE_FIELD_INV_NUM") target_link_libraries(secp256k1 gmp) - +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include_directories(/usr/local/include) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 515004f6d..a5581c131 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,6 +10,10 @@ add_executable(testeth ${SRC_LIST}) find_package(Threads REQUIRED) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include_directories(/usr/local/include) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_link_libraries(testeth ethereum) target_link_libraries(testeth secp256k1) target_link_libraries(testeth miniupnpc)