forked from minium/bitcoin-api-cpp
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
61 lines (46 loc) · 1.88 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(libbitcoin-api-cpp)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
# Set compiler settings
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MACOSX_RPATH 1)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
# Set version number
SET(MAJOR_VERSION 0)
SET(MINOR_VERSION 1)
SET(PATCH_VERSION 0)
SET(SO_VERSION 0)
# Add source directory
ADD_SUBDIRECTORY(src/bitcoinapi)
FIND_PACKAGE(Boost COMPONENTS unit_test_framework)
IF(Boost_FOUND)
ADD_SUBDIRECTORY(src/test)
ENDIF()
# Set package settings
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
INCLUDE(InstallRequiredSystemLibraries)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(CPACK_GENERATOR "PackageMaker")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/opt/local")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(CPACK_PACKAGE_DESCRIPTION "C++ interface for communication with Bitcoin Wallet.")
SET(CPACK_PACKAGE_VENDOR "Krzysztof Okupski")
SET(CPACK_PACKAGE_CONTACT "Krzysztof Okupski <[email protected]>")
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}")
SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
SET(CPACK_COMPONENTS_ALL bitcoinapi)
INCLUDE(CPack)
# Uninstall target
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")