summaryrefslogtreecommitdiff
path: root/toxcore/CMakeLists.txt
blob: ecbb65c2afb387ba369e361e987679bb7f821531 (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
cmake_minimum_required(VERSION 2.6.0)
project(toxcore C)

set(core_sources
	DHT.c
	network.c
	Lossless_UDP.c
	net_crypto.c
	friend_requests.c
	LAN_discovery.c
	Messenger.c
	util.c
	ping.c
        tox.c)

set(core_headers
	DHT.h
	network.h
	Lossless_UDP.h
	net_crypto.h
	friend_requests.h
	LAN_discovery.h
	Messenger.h
	util.h
	ping.h)

add_library(toxcore SHARED ${core_sources})
add_library(toxcore_static ${core_sources})
set_target_properties(toxcore_static PROPERTIES OUTPUT_NAME toxcore)

target_link_libraries(toxcore ${LINK_CRYPTO_LIBRARY})

install(TARGETS toxcore toxcore_static DESTINATION lib)
install(FILES ${core_headers} DESTINATION include)

if(WIN32)
	target_link_libraries(toxcore ws2_32)
endif()

execute_process(COMMAND git rev-list HEAD --count OUTPUT_VARIABLE COMMIT)

# Write pkgconfig-file:
include(InstallPkgConfigFile)
install_pkg_config_file(toxcore CFLAGS LIBS -ltoxcore REQUIRES VERSION 0.1.1_r${COMMIT})