summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 146baec699f4f693730889d2eb4ed8e5208c93b1 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET (this_target osp-bluetooth)

SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)

INCLUDE_DIRECTORIES(
	inc
	src
	src/inc
	/usr/include/chromium
	/usr/include/glib-2.0 
	/usr/lib/glib-2.0/include
	/usr/include/system
	/usr/include/network
	/usr/include/osp
	/usr/include/osp/app
	/usr/include/osp/base
	/usr/include/osp/io	
	/usr/include/osp/net
	/usr/include/osp/security	
	/usr/include/osp/system	
)

SET (${this_target}_SOURCE_FILES
    src/FNetBtBluetoothDevice.cpp
    src/FNetBtBluetoothManager.cpp
    src/FNetBtBluetoothOppClient.cpp
    src/FNetBtBluetoothOppServer.cpp
    src/FNetBtBluetoothSppInitiator.cpp
    src/FNetBtBluetoothSppAcceptor.cpp
    src/FNetBtBluetoothSppInitiator.cpp
    src/FNetBtBluetoothHealth.cpp
    src/FNetBt_BluetoothAdapterUtility.cpp
    src/FNetBt_BluetoothDeviceEvent.cpp
    src/FNetBt_BluetoothDeviceEventArg.cpp
    src/FNetBt_BluetoothDeviceImpl.cpp
    src/FNetBt_BluetoothGapSystemAdapter.cpp
    src/FNetBt_BluetoothHealthEvent.cpp
    src/FNetBt_BluetoothHealthEventArg.cpp
    src/FNetBt_BluetoothHealthImpl.cpp
    src/FNetBt_BluetoothHdpSystemAdapter.cpp
    src/FNetBt_BluetoothIpcMessages.cpp
    src/FNetBt_BluetoothIpcProxy.cpp
    src/FNetBt_BluetoothManagerEvent.cpp
    src/FNetBt_BluetoothManagerEventArg.cpp
    src/FNetBt_BluetoothManagerImpl.cpp
    src/FNetBt_BluetoothOppClientEvent.cpp
    src/FNetBt_BluetoothOppClientEventArg.cpp
    src/FNetBt_BluetoothOppClientImpl.cpp
    src/FNetBt_BluetoothOppServerEvent.cpp
    src/FNetBt_BluetoothOppServerEventArg.cpp
    src/FNetBt_BluetoothOppServerImpl.cpp
    src/FNetBt_BluetoothOppSystemAdapter.cpp
    src/FNetBt_BluetoothSppAcceptorEvent.cpp
    src/FNetBt_BluetoothSppAcceptorEventArg.cpp
    src/FNetBt_BluetoothSppAcceptorImpl.cpp
    src/FNetBt_BluetoothSppInitiatorEvent.cpp
    src/FNetBt_BluetoothSppInitiatorEventArg.cpp
    src/FNetBt_BluetoothSppInitiatorImpl.cpp
    src/FNetBt_BluetoothSppSystemAdapter.cpp
    )

SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )

## SET C COMPILER FLAGS
SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")

## SET CPP COMPILER FLAGS
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")

## Create Library
ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})

## SET LINKER FLAGS
SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)

TARGET_LINK_LIBRARIES(${this_target} "-lchromium" )
TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -losp-net" )
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-bluetooth" )

SET_TARGET_PROPERTIES(${this_target} 
	PROPERTIES 
	VERSION ${FULLVER}
	SOVERSION ${MAJORVER}
	CLEAN_DIRECT_OUTPUT 1
	)

ADD_CUSTOM_COMMAND(TARGET ${this_target}
    POST_BUILD
		COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} 
		COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER}
		COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}
		COMMENT "strip ${this_target}"
		)   

INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
				FILES_MATCHING PATTERN "*.so*" 
				PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ					  
										GROUP_EXECUTE GROUP_READ
										WORLD_EXECUTE WORLD_READ)
INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug 
				FILES_MATCHING PATTERN "*.so*" 
				PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ					  
										GROUP_EXECUTE GROUP_READ
										WORLD_EXECUTE WORLD_READ)

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/net FILES_MATCHING PATTERN "*.h")

SET(PC_NAME ${this_target})
SET(VERSION ${FULLVER})
SET(PC_LDFLAGS -l${this_target})

# pkgconfig file
CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)