File tree Expand file tree Collapse file tree 4 files changed +42
-10
lines changed Expand file tree Collapse file tree 4 files changed +42
-10
lines changed Original file line number Diff line number Diff line change @@ -16,5 +16,6 @@ before_script:
16
16
- cd build
17
17
- cmake ..
18
18
19
- script : make
19
+ script :
20
+ - make
20
21
Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ SET(MINOR_VERSION 0)
7
7
8
8
# Add source directory
9
9
ADD_SUBDIRECTORY (src/api )
10
- ADD_SUBDIRECTORY (src/jsonrpc )
11
10
12
- # ADD_SUBDIRECTORY(test)
11
+ FIND_PACKAGE (Boost COMPONENTS unit_test_framework )
12
+ IF (Boost_FOUND )
13
+ ADD_SUBDIRECTORY (src/test )
14
+ ENDIF ()
13
15
14
16
# Set package settings
15
17
IF (EXISTS "${CMAKE_ROOT} /Modules/CPack.cmake" )
Original file line number Diff line number Diff line change @@ -5,20 +5,16 @@ SET(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
5
5
FILE (GLOB bitcoinapi_header ${CMAKE_CURRENT_SOURCE_DIR} /*.h )
6
6
FILE (GLOB bitcoinapi_source ${CMAKE_CURRENT_SOURCE_DIR} /*.cpp )
7
7
8
+ # Add jsonrpc directory
9
+ ADD_SUBDIRECTORY (jsonrpc )
10
+
8
11
# Set target libraries
9
12
ADD_LIBRARY (bitcoinapi SHARED ${bitcoinapi_source} )
10
13
ADD_LIBRARY (bitcoinapi_static STATIC ${bitcoinapi_source} )
11
14
12
- # Add boost header include
13
- INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} /.. )
14
-
15
15
# Set output name of static library
16
16
SET_TARGET_PROPERTIES (bitcoinapi_static PROPERTIES OUTPUT_NAME bitcoinapi )
17
17
18
- # Set version number of both libraries
19
- SET (VERSION_STRING ${MAJOR_VERSION} .${MINOR_VERSION} )
20
- SET_TARGET_PROPERTIES (bitcoinapi bitcoinapi_static PROPERTIES VERSION "${VERSION_STRING} " SOVERSION "${VERSION_MAJOR} " )
21
-
22
18
# Link the library with jsonrpc libs
23
19
TARGET_LINK_LIBRARIES (bitcoinapi jsonrpc )
24
20
TARGET_LINK_LIBRARIES (bitcoinapi_static jsonrpc )
Original file line number Diff line number Diff line change
1
+ # Set compiler settings
2
+ SET (CMAKE_CXX_FLAGS "-std=c++11 -g -Wall" )
3
+ SET (CMAKE_C_FLAGS "-Wall" )
4
+
5
+ # Require curl to be present
6
+ FIND_PACKAGE (Threads REQUIRED )
7
+ FIND_PACKAGE (CURL REQUIRED )
8
+
9
+ # Find header and source files
10
+ FILE (GLOB jsonrpc_header ${CMAKE_CURRENT_SOURCE_DIR} /*.h )
11
+ FILE (GLOB connector_header ${CMAKE_CURRENT_SOURCE_DIR} /connectors/*.h )
12
+ FILE (GLOB jsoncpp_header ${CMAKE_CURRENT_SOURCE_DIR} /json/*.h )
13
+ FILE (GLOB_RECURSE jsonrpc_source ${CMAKE_CURRENT_SOURCE_DIR} /*.c* )
14
+
15
+ # Set target libraries
16
+ ADD_LIBRARY (jsonrpc SHARED ${jsonrpc_source} )
17
+ ADD_LIBRARY (jsonrpc_static STATIC ${jsonrpc_source} )
18
+
19
+ # Set output name of static library
20
+ SET_TARGET_PROPERTIES (jsonrpc_static PROPERTIES OUTPUT_NAME jsonrpc )
21
+
22
+ # Link the library with dependencies
23
+ TARGET_LINK_LIBRARIES (jsonrpc pthread dl curl )
24
+ TARGET_LINK_LIBRARIES (jsonrpc_static pthread dl curl )
25
+
26
+ # Install to appropriate destinations
27
+ INSTALL (FILES ${jsonrpc_header} DESTINATION include /jsonrpc )
28
+ INSTALL (FILES ${connector_header} DESTINATION include /jsonrpc/connectors )
29
+ INSTALL (FILES ${jsoncpp_header} DESTINATION include /jsonrpc/json )
30
+
31
+ INSTALL (TARGETS jsonrpc jsonrpc_static
32
+ LIBRARY DESTINATION lib
33
+ ARCHIVE DESTINATION lib )
You can’t perform that action at this time.
0 commit comments