You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmonero/CMakeLists.txt

158 lines
3.1 KiB

cmake_minimum_required(VERSION 3.2)
set(PROJECT_NAME
openmonero)
project(${PROJECT_NAME})
6 years ago
set(CMAKE_CXX_STANDARD 11)
8 years ago
if(CMAKE_SIZEOF_VOID_P EQUAL "4")
add_definitions(-DMDB_VL32)
endif()
7 years ago
if (NOT MONERO_DIR)
set(MONERO_DIR ~/monero)
endif()
6 years ago
option(BUILD_TEST "Build tests for the project" ON)
7 years ago
message(STATUS MONERO_DIR ": ${MONERO_DIR}")
7 years ago
set(MONERO_SOURCE_DIR ${MONERO_DIR}
CACHE PATH "Path to the root directory for Monero")
7 years ago
# set location of monero build tree
set(MONERO_BUILD_DIR ${MONERO_SOURCE_DIR}/build/release/
CACHE PATH "Path to the build directory for Monero")
7 years ago
set(MY_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake"
CACHE PATH "The path to the cmake directory of the current project")
7 years ago
list(APPEND CMAKE_MODULE_PATH "${MY_CMAKE_DIR}")
7 years ago
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${MONERO_BUILD_DIR}"
CACHE PATH "Add Monero directory for library searching")
7 years ago
include(MyUtils)
7 years ago
find_package(Monero)
7 years ago
7 years ago
include_directories(/usr/include/mysql)
# include boost headers
include_directories(${Boost_INCLUDE_DIRS})
8 years ago
# include monero headers
7 years ago
include_directories("ext/restbed/source")
include_directories(
${MONERO_SOURCE_DIR}/build
/usr/local/include
/usr/local/include/mysql
/usr/local/opt/openssl/include
)
link_directories(
${MONERO_BUILD_DIR}/src/crypto
/usr/local/lib
/usr/local/opt/openssl/lib
)
7 years ago
create_git_version()
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/config ${CMAKE_CURRENT_BINARY_DIR}/config)
7 years ago
# find boost
find_package(Boost COMPONENTS
system
filesystem
thread
date_time
chrono
regex
serialization
program_options
date_time
REQUIRED)
# add src/ subfolder
add_subdirectory(src/)
# add ext/ subfolder
add_subdirectory(ext/)
8 years ago
set(SOURCE_FILES
main.cpp)
add_executable(${PROJECT_NAME}
8 years ago
${SOURCE_FILES})
7 years ago
set(LIBRARIES
myxrm
myext
8 years ago
restbed
wallet
blockchain_db
cryptonote_core
cryptonote_protocol
cryptonote_basic
daemonizer
cncrypto
blocks
lmdb
ringct
ringct_basic
common
7 years ago
mnemonics
epee
7 years ago
easylogging
mysqlpp
mysqlclient
device
epee
checkpoints
version
pcsclite
${Boost_LIBRARIES}
pthread
unbound
curl
7 years ago
cncrypto
ssl
crypto)
if(APPLE)
set(LIBRARIES ${LIBRARIES} "-framework IOKit -framework PCSC")
else()
set(LIBRARIES ${LIBRARIES} atomic)
endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT WIN32)
set(LIBRARIES ${LIBRARIES} unwind)
7 years ago
endif()
if (WIN32)
set(LIBRARIES ${LIBRARIES}
wsock32
ntdll
ws2_32
Iphlpapi
)
else()
set(LIBRARIES ${LIBRARIES} dl)
endif()
7 years ago
target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
6 years ago
include_directories(
${CMAKE_SOURCE_DIR}/tests/googletest/googletest/include
${CMAKE_SOURCE_DIR}/tests/googletest/googlemock/include)
enable_testing()
add_subdirectory(ext/googletest)
add_subdirectory(tests)