2016-04-12 07:15:33 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2016-04-06 06:53:37 +00:00
|
|
|
|
|
|
|
set(PROJECT_NAME
|
2016-04-15 21:59:39 +00:00
|
|
|
xmrblocks)
|
2016-04-06 06:53:37 +00:00
|
|
|
|
2016-04-12 03:31:26 +00:00
|
|
|
|
2016-04-06 06:53:37 +00:00
|
|
|
project(${PROJECT_NAME})
|
|
|
|
|
2018-09-14 04:58:03 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
2017-04-18 05:10:09 +00:00
|
|
|
|
2017-02-02 14:17:43 +00:00
|
|
|
if (WIN32)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -O3")
|
|
|
|
endif()
|
2016-04-06 06:53:37 +00:00
|
|
|
|
2017-04-18 05:10:09 +00:00
|
|
|
|
|
|
|
if (NOT MONERO_DIR)
|
2018-12-11 15:43:06 +00:00
|
|
|
set(MONERO_DIR ~/wownero)
|
2017-04-18 05:10:09 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS MONERO_DIR ": ${MONERO_DIR}")
|
|
|
|
|
2018-12-31 00:48:47 +00:00
|
|
|
if (NOT MONERO_SOURCE_DIR)
|
|
|
|
set(MONERO_SOURCE_DIR ${MONERO_DIR}
|
|
|
|
CACHE PATH "Path to the root directory for Monero")
|
|
|
|
endif()
|
2017-04-18 05:10:09 +00:00
|
|
|
|
2018-12-31 00:48:47 +00:00
|
|
|
if (NOT MONERO_BUILD_DIR)
|
|
|
|
# set location of monero build tree
|
|
|
|
set(MONERO_BUILD_DIR ${MONERO_SOURCE_DIR}/build/release/
|
|
|
|
CACHE PATH "Path to the build directory for Monero")
|
|
|
|
endif()
|
2017-04-18 05:10:09 +00:00
|
|
|
|
|
|
|
set(MY_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake"
|
|
|
|
CACHE PATH "The path to the cmake directory of the current project")
|
|
|
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${MY_CMAKE_DIR}")
|
|
|
|
|
|
|
|
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${MONERO_BUILD_DIR}"
|
|
|
|
CACHE PATH "Add Monero directory for library searching")
|
|
|
|
|
|
|
|
include(MyUtils)
|
|
|
|
|
|
|
|
find_package(Monero)
|
|
|
|
|
2016-04-06 06:53:37 +00:00
|
|
|
# find boost
|
|
|
|
find_package(Boost COMPONENTS
|
|
|
|
system
|
|
|
|
filesystem
|
|
|
|
thread
|
|
|
|
date_time
|
|
|
|
chrono
|
|
|
|
regex
|
|
|
|
serialization
|
|
|
|
program_options
|
|
|
|
date_time
|
|
|
|
REQUIRED)
|
|
|
|
|
2017-12-21 23:52:14 +00:00
|
|
|
#info https://github.com/arsenm/sanitizers-cmake
|
|
|
|
find_package(Sanitizers)
|
2016-04-06 06:53:37 +00:00
|
|
|
|
2017-01-13 16:25:36 +00:00
|
|
|
if(APPLE)
|
2017-04-28 05:45:30 +00:00
|
|
|
include_directories(/usr/local/opt/openssl/include)
|
|
|
|
link_directories(/usr/local/opt/openssl/lib)
|
2017-01-13 16:25:36 +00:00
|
|
|
endif()
|
|
|
|
|
2016-09-28 02:21:14 +00:00
|
|
|
|
2017-02-03 01:06:45 +00:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32)
|
|
|
|
add_library(unbound STATIC IMPORTED)
|
2017-08-24 23:54:27 +00:00
|
|
|
set_property(TARGET unbound PROPERTY IMPORTED_LOCATION ${MONERO_BUILD_DIR}/external/unbound/libunbound.a)
|
2017-02-03 01:06:45 +00:00
|
|
|
endif()
|
2017-02-02 14:17:43 +00:00
|
|
|
|
2018-11-29 04:48:53 +00:00
|
|
|
|
|
|
|
|
2016-04-06 06:53:37 +00:00
|
|
|
# include boost headers
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2018-11-29 04:48:53 +00:00
|
|
|
|
|
|
|
# include monero
|
|
|
|
include_directories(${MONERO_SOURCE_DIR}/build)
|
|
|
|
|
2016-04-06 06:53:37 +00:00
|
|
|
include_directories("ext/mstch/include")
|
2018-11-29 04:48:53 +00:00
|
|
|
include_directories("ext/mstch/include/src")
|
2017-12-19 22:31:04 +00:00
|
|
|
include_directories("ext/crow")
|
2016-04-06 06:53:37 +00:00
|
|
|
|
|
|
|
# add ext/ subfolder
|
|
|
|
add_subdirectory(ext/)
|
|
|
|
|
|
|
|
# add src/ subfolder
|
|
|
|
add_subdirectory(src/)
|
|
|
|
|
|
|
|
|
|
|
|
set(SOURCE_FILES
|
|
|
|
main.cpp)
|
|
|
|
|
2016-04-12 03:31:26 +00:00
|
|
|
#ADD_CUSTOM_TARGET(driver DEPENDS src/templates/index.html)
|
2016-04-08 06:14:42 +00:00
|
|
|
|
2016-04-06 06:53:37 +00:00
|
|
|
add_executable(${PROJECT_NAME}
|
|
|
|
${SOURCE_FILES})
|
|
|
|
|
2017-12-21 23:52:14 +00:00
|
|
|
add_sanitizers(${PROJECT_NAME})
|
|
|
|
|
2017-04-18 05:10:09 +00:00
|
|
|
create_git_version()
|
2016-04-12 03:31:26 +00:00
|
|
|
|
|
|
|
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates ${CMAKE_CURRENT_BINARY_DIR}/templates)
|
|
|
|
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/css ${CMAKE_CURRENT_BINARY_DIR}/templates/css)
|
2016-04-30 01:35:48 +00:00
|
|
|
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/partials ${CMAKE_CURRENT_BINARY_DIR}/templates/partials)
|
2018-01-12 23:18:44 +00:00
|
|
|
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/js ${CMAKE_CURRENT_BINARY_DIR}/templates/js)
|
2016-04-12 03:31:26 +00:00
|
|
|
|
2017-01-19 05:05:24 +00:00
|
|
|
set(LIBRARIES
|
2016-04-06 06:53:37 +00:00
|
|
|
myxrm
|
|
|
|
myext
|
|
|
|
mstch
|
2016-09-28 02:21:14 +00:00
|
|
|
wallet
|
2017-02-12 01:48:56 +00:00
|
|
|
blockchain_db
|
2016-04-06 06:53:37 +00:00
|
|
|
cryptonote_core
|
2016-11-17 01:07:12 +00:00
|
|
|
cryptonote_protocol
|
2017-02-12 01:48:56 +00:00
|
|
|
cryptonote_basic
|
2018-03-27 11:23:21 +00:00
|
|
|
multisig
|
2017-02-12 01:48:56 +00:00
|
|
|
daemonizer
|
2017-06-26 02:10:17 +00:00
|
|
|
cncrypto
|
2016-04-06 06:53:37 +00:00
|
|
|
blocks
|
|
|
|
lmdb
|
2016-09-06 10:34:07 +00:00
|
|
|
ringct
|
2018-03-15 01:44:43 +00:00
|
|
|
ringct_basic
|
2018-03-05 00:07:27 +00:00
|
|
|
device
|
2016-11-17 01:07:12 +00:00
|
|
|
common
|
2016-12-24 08:40:28 +00:00
|
|
|
mnemonics
|
2017-06-26 02:10:17 +00:00
|
|
|
easylogging
|
2017-10-02 03:31:04 +00:00
|
|
|
checkpoints
|
|
|
|
version
|
2017-12-20 00:04:17 +00:00
|
|
|
epee
|
2019-05-19 04:26:53 +00:00
|
|
|
randomx
|
2018-08-24 06:05:59 +00:00
|
|
|
sodium
|
2016-04-06 06:53:37 +00:00
|
|
|
${Boost_LIBRARIES}
|
|
|
|
pthread
|
2016-07-06 08:23:44 +00:00
|
|
|
unbound
|
2016-11-23 05:32:51 +00:00
|
|
|
curl
|
2016-12-19 01:47:19 +00:00
|
|
|
crypto
|
|
|
|
ssl)
|
2017-01-19 05:05:24 +00:00
|
|
|
|
2017-08-24 23:54:27 +00:00
|
|
|
if(APPLE)
|
2018-10-25 23:34:10 +00:00
|
|
|
set(LIBRARIES ${LIBRARIES} "-framework IOKit -framework Foundation")
|
2017-08-24 23:54:27 +00:00
|
|
|
else()
|
2018-10-25 23:34:10 +00:00
|
|
|
set(LIBRARIES ${LIBRARIES} atomic)
|
2017-08-24 23:54:27 +00:00
|
|
|
endif()
|
|
|
|
|
2017-02-02 14:17:43 +00:00
|
|
|
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT WIN32)
|
2017-04-28 05:45:30 +00:00
|
|
|
set(LIBRARIES ${LIBRARIES} unwind)
|
2017-01-13 16:25:36 +00:00
|
|
|
endif()
|
2017-01-19 05:05:24 +00:00
|
|
|
|
2017-02-02 14:17:43 +00:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBRARIES ${LIBRARIES}
|
2017-04-28 05:45:30 +00:00
|
|
|
wsock32
|
|
|
|
ntdll
|
|
|
|
ws2_32
|
|
|
|
Iphlpapi
|
|
|
|
)
|
2017-02-02 14:17:43 +00:00
|
|
|
else()
|
|
|
|
set(LIBRARIES ${LIBRARIES} dl)
|
|
|
|
endif()
|
|
|
|
|
2018-10-25 23:34:10 +00:00
|
|
|
find_package(HIDAPI)
|
|
|
|
set(LIBRARIES ${LIBRARIES} ${HIDAPI_LIBRARIES})
|
|
|
|
|
2017-01-19 05:05:24 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
|