Browse Source

cmake updates for building on osx

cl-refactor
subtly 11 years ago
parent
commit
55f6989820
  1. 4
      CMakeLists.txt
  2. 11
      alethzero/CMakeLists.txt
  3. 4
      eth/CMakeLists.txt
  4. 2
      libethereum/BlockChain.cpp
  5. 4
      libethereum/CMakeLists.txt
  6. 6
      libethereum/FileSystem.cpp
  7. 4
      secp256k1/CMakeLists.txt
  8. 4
      test/CMakeLists.txt

4
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)

11
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})

4
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)

2
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");

4
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 )

6
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

4
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")

4
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)

Loading…
Cancel
Save